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")); }
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)); }
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); }
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); }
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); }
public CalculateOhmValues() { _resistorBands = new ResistorBands(); }