private FatModel GetBodyFat(MeasureModel me, double height, double weight) { FatModel fat = new FatModel(); fat.BodyFat = this.CalculateBodyFat(me, height); fat.FatMass = weight * fat.BodyFat; fat.LeanMass = weight - fat.FatMass; return(fat); }
public ActionResult Prev() { FatModel FM = GetFatModel(); FM.Schedule.PreviousDay(); ViewData["FatModel"] = FM; ViewData["imgsrc"] = Logo(); WriteFatModel(FM); return(PartialView("_ShowPartial", FM)); }
public FatModel GetFatModel() { FatModel FM = new FatModel() { Student = GetStudent(), Schedule = GetSchedule() }; return(FM); }
public ActionResult PressButton(string buttonValue) { FatModel FM = GetFatModel(); FM.Schedule.PressButton(buttonValue); FM.Student.Update(); WriteFatModel(FM); ViewData["FatModel"] = FM; ViewData["imgsrc"] = Logo(); return(PartialView("_ShowPartial", FM)); }
public ActionResult Show(string i2) { FatModel FM = GetFatModel(); switch (i2) { case "Next": FM.Schedule.NextDay(); break; case "Prev": FM.Schedule.PreviousDay(); break; default: break; } ViewData["FatModel"] = FM; ViewData["imgsrc"] = Logo(); WriteFatModel(FM); return(PartialView("_ShowPartial", FM)); }
public ActionResult Rc(string PlaceId) { FatModel FM = GetFatModel(); int placeId; if (Int32.TryParse(PlaceId, out placeId)) { FM.Schedule.SelectPlace(placeId); } else { FM.Schedule.SelectPlace(0); } WriteFatModel(FM); ViewData["FatModel"] = FM; ViewData["imgsrc"] = Logo(); return(PartialView("_ShowPartial", FM)); }
public ActionResult Aj(string SDate) { FatModel FM = GetFatModel(); DateTime dateValue; if (DateTime.TryParseExact(SDate, "dd.MM.yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dateValue)) { FM.Schedule.SelectDay(dateValue); WriteFatModel(FM); } else { FM.Schedule.Message = "Строка " + SDate + " не является датой"; } ViewData["FatModel"] = FM; ViewData["imgsrc"] = Logo(); return(PartialView("_ShowPartial", FM)); }
public void WriteFatModel(FatModel FM) { Session["Student"] = FM.Student; Session["Schedule"] = FM.Schedule; }