Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("AsthmaRiskId,AsthmaHospitalization,AsthmaHospitalizationDate,AsthmaIcu,IcuAdmitDate,AsthmaTriggers,AsthmaSymptoms,AsthmaSeverity,MedicationForAsthma,MedicationName,Comments")] AsthmaRisk asthmaRisk)
        {
            if (id != asthmaRisk.AsthmaRiskId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(asthmaRisk);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AsthmaRiskExists(asthmaRisk.AsthmaRiskId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(asthmaRisk));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("AsthmaRiskId,AsthmaHospitalization,AsthmaHospitalizationDate,AsthmaIcu,IcuAdmitDate,AsthmaTriggers,AsthmaSymptoms,AsthmaSeverity,MedicationForAsthma,MedicationName,Comments")] AsthmaRisk asthmaRisk)
        {
            if (ModelState.IsValid)
            {
                _context.Add(asthmaRisk);
                await _context.SaveChangesAsync();

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