コード例 #1
0
        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);
        }
コード例 #2
0
        public ActionResult Prev()
        {
            FatModel FM = GetFatModel();

            FM.Schedule.PreviousDay();
            ViewData["FatModel"] = FM;
            ViewData["imgsrc"]   = Logo();
            WriteFatModel(FM);
            return(PartialView("_ShowPartial", FM));
        }
コード例 #3
0
        public FatModel GetFatModel()
        {
            FatModel FM = new FatModel()
            {
                Student  = GetStudent(),
                Schedule = GetSchedule()
            };

            return(FM);
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        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));
        }
コード例 #8
0
 public void WriteFatModel(FatModel FM)
 {
     Session["Student"]  = FM.Student;
     Session["Schedule"] = FM.Schedule;
 }