예제 #1
0
        // 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()));
        }
예제 #2
0
        // 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));
        }