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 Update(EmployeeItemModel employeeItemModel) { try { if (IsUpdate(employeeItemModel.OperationResult)) { if (IsValid(employeeItemModel.OperationResult, employeeItemModel.Employee)) { Employee employee = (Employee)employeeItemModel.Employee.ToData(); if (Application.Update(employeeItemModel.OperationResult, employee)) { if (employeeItemModel.IsSave) { return(JsonResultSuccess(employeeItemModel.OperationResult, Url.Action("Update", "Employee", new { EmployeeId = employee.EmployeeId }, Request.Url.Scheme))); } else { return(JsonResultSuccess(employeeItemModel.OperationResult)); } } } } } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } employeeItemModel.ActivityOperations = ActivityOperations; return(JsonResultOperationResult(employeeItemModel.OperationResult)); }
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 Create(string masterEntity = null, string masterKey = null) { EmployeeItemModel employeeItemModel = new EmployeeItemModel(ActivityOperations, "Create", masterEntity, masterKey); try { if (IsCreate(employeeItemModel.OperationResult)) { return(ZPartialView("CRUD", employeeItemModel)); } } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } return(JsonResultOperationResult(employeeItemModel.OperationResult)); }
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)); }
public ActionResult Delete(EmployeeItemModel employeeItemModel) { try { if (IsDelete(employeeItemModel.OperationResult)) { if (Application.Delete(employeeItemModel.OperationResult, (Employee)employeeItemModel.Employee.ToData())) { return(JsonResultSuccess(employeeItemModel.OperationResult)); } } } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } employeeItemModel.ActivityOperations = ActivityOperations; return(JsonResultOperationResult(employeeItemModel.OperationResult)); }
public ActionResult Delete(int employeeId, string masterEntity = null, string masterKey = null) { EmployeeItemModel employeeItemModel = new EmployeeItemModel(ActivityOperations, "Delete", masterEntity, masterKey); try { if (IsDelete(employeeItemModel.OperationResult)) { Employee employee = Application.GetById(employeeItemModel.OperationResult, new object[] { employeeId }); if (employee != null) { employeeItemModel.Employee = new EmployeeViewModel(employee); return(ZPartialView("CRUD", employeeItemModel)); } } } catch (Exception exception) { employeeItemModel.OperationResult.ParseException(exception); } return(JsonResultOperationResult(employeeItemModel.OperationResult)); }