コード例 #1
0
        public JsonResult CalculateOhmValue(string bandAColor, string bandBColor, string bandCColor, string bandDColor)
        {
            int    ohmValue = ohmCalculator.CalculateOhmValue(bandAColor, bandBColor, bandCColor, bandDColor);
            string result;

            if (ohmValue != 0)
            {
                result = ohmCalculator.DecodeOhmValue(ohmValue);
            }
            else
            {
                result = "An unexpected input was received, please try again";
            }

            return(Json(result));
        }