public ActionResult DeleteConfirmed(int id) { CaseServiceType caseservicetype = db.CaseServiceTypes.Find(id); db.CaseServiceTypes.Remove(caseservicetype); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Admin/CaseServiceType/Edit/5 public ActionResult Edit(int id = 0) { CaseServiceType caseservicetype = db.CaseServiceTypes.Find(id); if (caseservicetype == null) { return(HttpNotFound()); } return(View(caseservicetype)); }
public ActionResult Edit(CaseServiceType caseservicetype) { if (ModelState.IsValid) { //db.Entry(caseservicetype).State = EntityState.Modified; caseservicetype.Update(); return(RedirectToAction("Index")); } return(View(caseservicetype)); }
public ActionResult Create(CaseServiceType caseservicetype) { if (ModelState.IsValid) { db.CaseServiceTypes.Add(caseservicetype); caseservicetype.Create(db, db.CaseServiceTypes); return(RedirectToAction("Index")); } return(View(caseservicetype)); }
public ActionResult Sort(string sortData) { if (!string.IsNullOrEmpty(sortData)) { string[] tempDatas = sortData.TrimEnd(',').Split(','); foreach (string tempData in tempDatas) { string[] itemDatas = tempData.Split(':'); CaseServiceType caseservicetype = db.CaseServiceTypes.Find(Convert.ToInt16(itemDatas[0])); caseservicetype.ListNum = Convert.ToInt16(itemDatas[1]); //db.Entry(publish).State = EntityState.Modified; db.SaveChanges(); } } return(RedirectToAction("Index")); }