// GET: Employees/Details/{id} public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EmployeeDTO employee = _services.GetEmployeeDetailsById(id); employee.DesignationId = _services.GetDesignationName(employee.DesignationId); employee.QualificationId = _services.GetQualificationName(employee.QualificationId); employee.RoleId = _services.GetRoleName(employee.RoleId); employee.EmployeeId = _services.GetManagerName(employee.EmployeeId); if (employee == null) { return(HttpNotFound()); } return(View(employee.EmployeeDTOtoViewModel())); }
// GET: Employees/Edit/{id} public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EmployeeDTO employee = _services.GetEmployeeDetailsById(id); if (employee == null) { return(HttpNotFound()); } ViewData["Designations"] = GetDesignations(); ViewData["Qualifications"] = GetQualifications(); ViewData["Managers"] = GetManagers(); ViewData["Roles"] = GetRoles(); EmployeeViewModel employeeDetails = employee.EmployeeDTOtoViewModel(); Session["EmployeeOriginal"] = employeeDetails; return(View(employeeDetails)); }