public ActionResult Create(Campus campus) { if (ModelState.IsValid) { try { _work.Campus.Insert(campus); _work.Save(); return RedirectToAction("Index"); } catch (Exception exe) { throw exe; } } return View(campus); }
public ActionResult Edit(Campus campus) { if (ModelState.IsValid) { try { Campus c = _work.Campus.GetById(campus.Campid); c.Camp_name = campus.Camp_name; c.camp_city = campus.camp_city; _work.Save(); } catch (Exception exe) { ViewBag.Error = "Unable to Update Campus"; } } return RedirectToAction("Index"); }