public ActionResult Delete(int?employeeId, int?masterReportsTo = null) { EmployeeItemModel employeeItemModel = new EmployeeItemModel() { IsSecurityOperations = this.IsSecurityOperations, Employee = new EmployeeViewModel(), ControllerAction = "Delete", MasterReportsTo = masterReportsTo }; try { EmployeeDTO employeeDTO = Application.GetById(employeeItemModel.OperationResult, new object[] { employeeId }); if (employeeDTO != null) { employeeItemModel.Employee = new EmployeeViewModel(employeeDTO); } } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } return(PartialView(employeeItemModel)); }
public ActionResult Delete(EmployeeItemModel employeeItemModel) { try { if (Application.Delete(employeeItemModel.OperationResult, (EmployeeDTO)employeeItemModel.Employee.ToDTO())) { return(JsonResultSuccess(new { uri = ReadUrlDictionary() })); } } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } return(JsonResultOperationResult(employeeItemModel.OperationResult)); }
public ActionResult Delete(EmployeeItemModel employeeItemModel) { try { if (Application.Delete(employeeItemModel.OperationResult, (EmployeeDTO)employeeItemModel.Employee.ToDTO())) { return(RedirectToUrlDictionary()); } } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } employeeItemModel.IsSecurityOperations = IsSecurityOperations; return(View(employeeItemModel)); }
public ActionResult Create(int?masterReportsTo = null) { EmployeeItemModel employeeItemModel = new EmployeeItemModel() { IsSecurityOperations = this.IsSecurityOperations, Employee = new EmployeeViewModel(), ControllerAction = "Create", MasterReportsTo = masterReportsTo }; try { IsCreate(employeeItemModel.OperationResult); } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } return(PartialView(employeeItemModel)); }