public ActionResult Edit(int id, detail ob) { try { using (SD info = new SD()) { info.Entry(ob).State = EntityState.Modified; info.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(detail ob) { try { using (var record = new SD()) { record.details.Add(ob); record.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int id, FormCollection collection) { try { using (SD info = new SD()) { detail ob = info.details.Where(x => x.id == id).FirstOrDefault(); info.details.Remove(ob); info.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }