public ActionResult EditOffice(OfficeDto office) { try { var editedOffice = new OfficeCommands().EditOffice(office); return(RedirectToAction("OfficeEditor", new { edit = true, officeId = editedOffice.OfficeId })); } catch (Exception ex) { TempData["Error"] = ex.GetBaseException(); return(RedirectToAction("OfficeEditor")); } }
public ActionResult AddOffice(OfficeDto office) { try { var addedoffice = new OfficeCommands().AddOffice(office); return(RedirectToAction("OfficeEditor", new { id = addedoffice.OfficeId })); } catch (Exception ex) { TempData["Error"] = ex.GetBaseException(); return(RedirectToAction("OfficeEditor")); } }