public Case Create(Case acase) { db.Cases.Add(acase); db.SaveChanges(); return GetById(acase.Id); }
public ActionResult NewCase(Case newcase) { if (ModelState.IsValid) { CaseService caseService = new CaseService(); caseService.Create(newcase); } else { return View(newcase); } return RedirectToAction("Index"); }
public Case Update(Case acase) { var thelead = db.Cases.FirstOrDefault(c => c.Id == acase.Id); thelead.Title = acase.Title; thelead.Description = acase.Description; thelead.Slug = acase.Slug; thelead.DownloadUrl = acase.DownloadUrl; db.SaveChanges(); return GetById(acase.Id); }
public ActionResult EditCase(Case newcase) { if (ModelState.IsValid) { CaseService caseService = new CaseService(); if (caseService.GetById(newcase.Id) != null) { caseService.Update(newcase); } } else { return View(newcase); } return RedirectToAction("Index"); }