public ActionResult AddOrEdit(int id = 0) { if (id == 0) { ViewBag.Employees = new SelectList(_employeeAppService.GetEmployeeList().Take(10), "EmployeeCode", "EmployeeName"); ViewBag.Departments = new SelectList(_employeeAppService.GetDepartmentList().Take(10), "DeptCode1", "DeptName1"); return(View(new Team.Team())); } else { var team = _teamAppService.GetTeamList().Where(x => x.Id == id).FirstOrDefault(); ViewBag.Employees = new SelectList(_employeeAppService.GetEmployeeList().Where(x => x.EmployeeCode == team.TeamLeader).ToList(), "EmployeeCode", "EmployeeName"); ViewBag.Departments = new SelectList(_employeeAppService.GetDepartmentList().Where(x => x.DeptCode1 == team.DepartmentID).ToList(), "DeptCode1", "DeptName1"); return(View(team)); } }
public ActionResult AddOrEdit(int id = 0) { if (id == 0) { return(View(new Role { Users = _employeeAppService.GetEmployeeList().Take(10).ToList() })); } else { var role = _roleManagementAppService.GetRole(id); return(View(role)); } }
public ActionResult AddOrEdit(int id = 0) { ViewBag.ProjectTypes = new SelectList(_configurationAppService.GetConfigurationByParentConfigValue("01"), "ConfigText", "ConfigText"); ViewBag.ProjectKinds = new SelectList(_configurationAppService.GetConfigurationByParentConfigValue("02"), "ConfigText", "ConfigText"); ViewBag.ProjectLevels = new SelectList(_configurationAppService.GetConfigurationByParentConfigValue("03"), "ConfigText", "ConfigText"); ViewBag.ProductionLineAttributes = new SelectList(_configurationAppService.GetConfigurationByParentConfigValue("04"), "ConfigText", "ConfigText"); ViewBag.ProjectStatusList = new SelectList(_configurationAppService.GetConfigurationByParentConfigValue("05"), "ConfigText", "ConfigText"); if (id == 0) { ViewBag.Employees = new SelectList(_employeeAppService.GetEmployeeList().Take(10), "EmployeeCode", "EmployeeName"); return(View(new Project.Project { NextID = UniqueIDGenerator.GetNextID() })); } else { var project = _projectAppService.GetAllProjectList().Where(x => x.Id == id).FirstOrDefault(); ViewBag.Employees = new SelectList(_employeeAppService.GetEmployeeList().Where(x => x.EmployeeCode == project.ProductManagerID || x.EmployeeCode == project.ProjectManagerID || x.EmployeeCode == project.ProductLeaderID ).ToList(), "EmployeeCode", "EmployeeName"); return(View(project)); } }
public ActionResult GetEmployeeList(string searchTerm, int pageSize, int pageNum) { int totalCount = 0; var itemList = _employeeAppService.GetEmployeeList(searchTerm, pageSize, pageNum, out totalCount); var result = new { Total = totalCount, Results = itemList }; return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }