public ActionResult SubmitEditedRequest(PtoEditVM ptoEditVm) { var ops = OperationsFactory.CreatePaidTimeOffOperations(); if (ptoEditVm.PtoRequestToEdit.ReasonRejected == null) ptoEditVm.PtoRequestToEdit.ReasonRejected = "N/A"; ops.EditPtoRequest(ptoEditVm.PtoRequestToEdit); return RedirectToAction("ViewPtoRequests"); }
public ActionResult EditPtoRequest(int PtoRequestId) { PtoEditVM ptoEditVm = new PtoEditVM(); ptoEditVm.GetSingleRequest(PtoRequestId); var ops = new TimeTrackerOperations(); var selectedEmp = ops.GetAllEmployees().Data.FirstOrDefault(x=>x.EmpID == ptoEditVm.PtoRequestToEdit.EmpID); ptoEditVm.FullName = string.Format("{0}, {1}", selectedEmp.LastName, selectedEmp.FirstName); var managers = ops.GetManagers(); ptoEditVm.GenerateManagersList(managers); return View(ptoEditVm); }