public ActionResult Create(ExamTB e) { try { // TODO: Add insert logic here objexam.ExamTBs.InsertOnSubmit(e); objexam.SubmitChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, ExamTB e) { try { var editdata = objexam.ExamTBs.SingleOrDefault(ee => ee.Id == id); UpdateModel(editdata); objexam.SubmitChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }