Example #1
0
 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"));
     }
 }
Example #2
0
 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"));
     }
 }