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));
     }
 }
Esempio n. 2
0
 // GET: ProductionLineReport
 public ActionResult Index()
 {
     ViewBag.ProductionLineAttributes = new SelectList(_configurationAppService.GetConfigurationByParentConfigValue("04"), "ConfigText", "ConfigText");
     return(View());
 }