示例#1
0
        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();
        }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }