public ActionResult Delete(int id, StaffDto staff) { try { StaffLoader.Save(staff); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(StaffDto staff) { try { StaffLoader.Save(staff); // TODO: Add insert logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, StaffDto staff) { try { if (id == staff.Id) { TempData["SuccessMessage"] = "Updated Successfully"; StaffLoader.Save(staff); } else { TempData["FailMessage"] = "Updated Failed"; return(View()); } // TODO: Add update logic here return(RedirectToAction("Index")); } catch { return(View()); } }