public async Task <IActionResult> Edit(int id, [Bind("DiabetesRiskId,DateTaken,LevelBeforeBreakfast,LevelAfterBreakfast,LeverlBeforeLunch,LevelAfterLunch,LevelBeforeDinner,LevelAfterDinner,LevelAtBedtime,Medications,TargertGlucoseBeforeMealLow,TargetGlucoseAfterMealHigh,TargetGlucoseRangeAfterMealLow,TargetGlucoseRangeAfterMealHigh,DateSpan,Comments")] DiabetesRisk diabetesRisk)
        {
            if (id != diabetesRisk.DiabetesRiskId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(diabetesRisk);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DiabetesRiskExists(diabetesRisk.DiabetesRiskId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(diabetesRisk));
        }
        public async Task <IActionResult> Create([Bind("DiabetesRiskId,DateTaken,LevelBeforeBreakfast,LevelAfterBreakfast,LeverlBeforeLunch,LevelAfterLunch,LevelBeforeDinner,LevelAfterDinner,LevelAtBedtime,Medications,TargertGlucoseBeforeMealLow,TargetGlucoseAfterMealHigh,TargetGlucoseRangeAfterMealLow,TargetGlucoseRangeAfterMealHigh,DateSpan,Comments")] DiabetesRisk diabetesRisk)
        {
            if (ModelState.IsValid)
            {
                _context.Add(diabetesRisk);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(diabetesRisk));
        }