Пример #1
0
        public IActionResult Calculate(ResistorBands rb)
        {
            var C = new OhmValueCalc();

            ViewData["OhmValue"]  = C.CalculateOhmValue(rb.bandA, rb.bandB, rb.bandC);
            ViewData["Tolerance"] = $"{C.GetTolerance(rb.bandD)}%";
            return(View("index"));
        }
Пример #2
0
        public IActionResult Calculate(ResistorBands rb)
        {
            var C = new OhmValueCalc();

            ViewData["OhmValue"]  = C.CalculateOhmValue(rb.bandA, rb.bandB, rb.bandC);
            ViewData["Tolerance"] = $"{C.GetTolerance(rb.bandD)}%";
            ViewBag.bandOne       = rb.bandA;
            ViewBag.bandTwo       = rb.bandB;
            ViewBag.bandThree     = rb.bandC;
            ViewBag.bandFour      = rb.bandD;
            return(View("index", rb));
        }
Пример #3
0
        public List <string> GetBandAColors()
        {
            List <string> bandAColors;

            var bandcolors = ResistorBands.Where <ResistorBand>(band => band.SignificantFigures1 != -1).ToList <ResistorBand>();

            bandAColors = new List <string>();
            foreach (ResistorBand b in bandcolors)
            {
                bandAColors.Add(b.Color);
            }

            return(bandAColors);
        }
Пример #4
0
        public List <string> GetBandDColors()
        {
            List <string> bandDColors;

            var bandcolors = ResistorBands.Where <ResistorBand>(band => band.ToleranceInPercentage != -1).ToList <ResistorBand>();

            bandDColors = new List <string>();
            foreach (ResistorBand b in bandcolors)
            {
                bandDColors.Add(b.Color);
            }

            return(bandDColors);
        }
Пример #5
0
        public List <string> GetBandCColors()
        {
            List <string> bandCColors;

            var bandcolors = ResistorBands.Where <ResistorBand>(band => band.Multiplier != -1).ToList <ResistorBand>();

            bandCColors = new List <string>();
            foreach (ResistorBand b in bandcolors)
            {
                bandCColors.Add(b.Color);
            }

            return(bandCColors);
        }
Пример #6
0
 public CalculateOhmValues()
 {
     _resistorBands = new ResistorBands();
 }