public ActionResult ChoosPlan()
        {
            IEnumerable <TrainingPlan> myList;

            using (var dbContext = new Model1())
            {
                myList = dbContext.TrainingPlan.ToList();
                foreach (var tp in myList)
                {
                    if (tp.Type.HasValue)
                    {
                        tp.TrainingType = dbContext.GetTrainingTypeBtId(tp.Type.Value);
                    }
                }
            }
            return(View(myList));
        }
        public PlanHelperViewModel(Results result)
        {
            Debug.Assert(result.Height != null, "result.Height != null");
            var bmi = result.Weights / Math.Pow(result.Height.Value / 100, 2);

            Debug.Assert(result.BodyFat != null, "result.BodyFat != null");
            var myClass      = getPeapoleClass(bmi.Value, result.BodyFat.Value);
            var trainingType = GetTrainingType(myClass);

            Training   = trainingType.Item1.ToString();
            UsserClass = trainingType.Item2 + "";
            using (var db = new Model1())
            {
                var list =
                    db.TrainingPlan.Where(p => p.TrainingType.Name == Training && p.Level == trainingType.Item2)
                    .ToList();

                foreach (var temp in list)
                {
                    temp.TrainingType = db.GetTrainingTypeBtId(temp.Type.Value);
                }
                Plans = list;
            }
        }