Exemplo n.º 1
0
 public async Task<ActionResult> DeleteConfirmed(int id)
 {
     DiseaseGroup diseaseGroup = await db.DiseaseGroups.FindAsync(id);
     db.DiseaseGroups.Remove(diseaseGroup);
     await db.SaveChangesAsync();
     return RedirectToAction("Index");
 }
Exemplo n.º 2
0
 public async Task<ActionResult> Edit([Bind(Include = "Id,Name")] DiseaseGroup diseaseGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(diseaseGroup).State = EntityState.Modified;
         await db.SaveChangesAsync();
         return RedirectToAction("Index");
     }
     return View(diseaseGroup);
 }
Exemplo n.º 3
0
        public async Task<ActionResult> Create([Bind(Include = "Id,Name")] DiseaseGroup diseaseGroup)
        {
            if (ModelState.IsValid)
            {
                db.DiseaseGroups.Add(diseaseGroup);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(diseaseGroup);
        }
Exemplo n.º 4
0
 // GET: DiseaseGroups/Edit/5
 public async Task<ActionResult> Edit(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     DiseaseGroup diseaseGroup = await db.DiseaseGroups.FindAsync(id);
     if (diseaseGroup == null)
     {
         return HttpNotFound();
     }
     return View(diseaseGroup);
 }