public ActionResult CreateUser() { ViewData["employeeNumber"] = new BLLUserAccount().GetMaxEmployeeNumber() + 1; IList<DepartmentModel> deptList = new List<DepartmentModel>(); BLLDepartment bllDepartment = new BLLDepartment(); deptList = bllDepartment.GetAllDepartments(); if (deptList.Count == 0) { ViewData["deptList"] = "nodata"; } else { ViewData["deptList"] = deptList; } return View(); }
public ActionResult Search() { IList<DepartmentModel> deptList = new List<DepartmentModel>(); BLLDepartment bllDepartment = new BLLDepartment(); deptList = bllDepartment.GetAllDepartments(); if (deptList.Count == 0) { ViewData["deptList"] = "nodata"; } else { ViewData["deptList"] = deptList; } int deptId = Convert.ToInt32(Request.Form["dept_name"]); string conditions = Request.Form["search_key"]; BLLUserAccount bllUserAccount = new BLLUserAccount(); List<UserEmployeeModel> empList = new List<UserEmployeeModel>(); List<UserEmployeeModel> resultList = new List<UserEmployeeModel>(); if (deptId == 0) { empList = bllUserAccount.GetAllEmployeeDetails(); } else { empList = bllUserAccount.GetUserDetailsByDeptId(deptId); } if (conditions.Equals("登录名/姓名")) { ViewData["empList"] = empList; return View(); } else { if (isnumeric(conditions)) { foreach (UserEmployeeModel element in empList) { if (element.EmployeeNumber == Convert.ToInt32(conditions)) resultList.Add(element); } ViewData["empList"] = resultList; } else { foreach (UserEmployeeModel element in empList) { if (element.Name == conditions) resultList.Add(element); } ViewData["empList"] = resultList; } return View(); } }
public ActionResult Index() { IList<DepartmentModel> deptList = new List<DepartmentModel>(); BLLDepartment bllDepartment = new BLLDepartment(); deptList = bllDepartment.GetAllDepartments(); if (deptList.Count == 0) { ViewData["deptList"] = "nodata"; } else { ViewData["deptList"] = deptList; } List<UserEmployeeModel> empList = new List<UserEmployeeModel>(); BLLUserAccount bllUserAccount = new BLLUserAccount(); empList = bllUserAccount.GetAllEmployeeDetails(); if (empList.Count == 0) { ViewData["empList"] = "nodata"; } else { ViewData["empList"] = empList; } return View(); }
public ActionResult Edit(int empNo) { IList<DepartmentModel> deptList = new List<DepartmentModel>(); BLLDepartment bllDepartment = new BLLDepartment(); deptList = bllDepartment.GetAllDepartments(); if (deptList.Count == 0) { ViewData["deptList"] = "nodata"; } else { ViewData["deptList"] = deptList; } BLLUserAccount bllUserAccount = new BLLUserAccount(); UserEmployeeModel userEmployeeModel = bllUserAccount.GetSingleUser(empNo); ViewData["id"] = userEmployeeModel.Id; ViewData["employeeNumber"] = userEmployeeModel.EmployeeNumber; ViewData["password"] = userEmployeeModel.Password; ViewData["dept_name"] = userEmployeeModel.DepartmentId; ViewData["isManager"] = userEmployeeModel.IsManager; ViewData["isChecker"] = userEmployeeModel.IsChecker; ViewData["isAvailable"] = userEmployeeModel.IsChecker; ViewData["name"] = userEmployeeModel.Name; ViewData["email"] = userEmployeeModel.Email; ViewData["phone"] = userEmployeeModel.Phone; return View(); }
public IList<FolderModel> getAllFoldersByDepartmentId(int deptId) { DepartmentModel deptModel = new BLLDepartment().GetDepartment(deptId); FolderModel parentFolderModel = folderDAL.GetFolderById(deptModel.FolderId); return folderDAL.GetAllSubFolders(parentFolderModel); }
//部门经理中心首页 //文件夹最多三级 public ActionResult Manager() { int empNumber = Convert.ToInt32(User.Identity.Name); BLLUserAccount bllUserAccount = new BLLUserAccount(); UserEmployeeModel empModel = new BLLUserAccount().GetUserByEmpNumber(empNumber); ViewData["empModel"] = empModel; BLLFolder bllFolder = new BLLFolder(); ViewData["outsideFolderId"] = new BLLDepartment().GetDepartment(empModel.DepartmentId).FolderId; ViewData["outsideFolderName"] = new BLLDepartment().GetDepartment(empModel.DepartmentId).DepartmentName; if (empModel.IsManager.Equals(false)) { //非部门经理 return RedirectToAction("Index", "Index"); } IList<FolderModel> folderModelList = bllFolder.getAllFoldersByDepartmentId(empModel.DepartmentId); if (folderModelList.Count() == 0) { ViewData["folderModelList"] = "nodata"; } else { ViewData["folderModelList"] = folderModelList.ToList<FolderModel>(); } return View(); }