public IActionResult CalculateCalories(UsersCaloriesCalculated userInfo) { // Men: 10 x weight(kg) +6.25 x height(cm) – 5 x age(y) +5 //Women: calories / day = 10 x weight(kg) +6.25 x height(cm) – 5 x age(y) – 161 //Then, multiply your result by an activity factor — a number that represents different levels of activity(7): if (userInfo.Gender == "Male") { var weightCalc = 10 * userInfo.Weight; var heightCalc = 6.25 * Convert.ToDouble(userInfo.HeightInCentimeters); var ageCalc = 5 * userInfo.Age; var uniqueNumberForMen = 5; var total = weightCalc + Convert.ToDecimal(heightCalc) - ageCalc + uniqueNumberForMen; userInfo.TotalCalories = total.ToString(); } return(View("Build", userInfo)); }
public IActionResult Build() { UsersCaloriesCalculated buildBasicInfo = new UsersCaloriesCalculated(); return(View(buildBasicInfo)); }