示例#1
0
        public ActionResult Index(string Department)
        {
            List <tbl_User> listDeputy = null;
            var             deputyList = "";
            // For admin config
            SelectList groupList = new SelectList((IEnumerable)GetDepartMent(), "Value", "Value");

            ViewBag.GroupList = groupList;

            if (Department == null || Department == "")
            {
                Department = mEmployee.employee.departmentName;
            }

            ViewBag.HeadName   = new DepartmentDao().GetHeadIdByDepartment(Department);
            ViewBag.Department = Department;
            deputyList         = new DepartmentDao().GetListDeputyByDepartment(Department);
            // add to user
            // add list deputy
            if (deputyList != null && deputyList != "")
            {
                var listUser = deputyList.Split(';').ToList();
                listDeputy = new UserDao().GetListUser(listUser);
            }
            ViewBag.ListDeputy = listDeputy;
            return(View());
        }
示例#2
0
        public ActionResult CreateRequest()
        {
            // Create GUIID
            Guid idRequest = Guid.NewGuid();

            CreateRequestModel newRequest = new CreateRequestModel();

            newRequest.Id         = idRequest;
            newRequest.EmployeeId = mEmployee.employee.employee_id;
            var employeeInfor = adWebHelper.GetDetailUserInfo(mEmployee.employee.access_token, mEmployee.employee.employee_id);

            newRequest.SLM      = adWebHelper.GetDetailUserInfoByID(mEmployee.employee.access_token, Convert.ToInt32(employeeInfor.parent_id[0].ToString())).ad_user_displayName;
            newRequest.FullName = mEmployee.employee.display_name;
            // Approver Information
            List <tbl_User> listApproval = null;
            var             listApprov   = new DepartmentDao().GetApproverName(mEmployee.employee.departmentName);

            if (listApprov != null && listApprov != "")
            {
                var listUser = listApprov.Split(';').ToList();
                listApproval = new UserDao().GetListUser(listUser);
            }
            ViewBag.ApproverName = string.Join("; ", listApproval.Select(x => x.FullName.ToString()).ToArray());

            // Information the requester

            return(View(newRequest));
        }
示例#3
0
        public JsonResult GetListReception()
        {
            List <tbl_User> listApproval = null;
            var             listApprov   = new DepartmentDao().GetApproverName(mEmployee.employee.departmentName);

            if (listApprov != null && listApprov != "")
            {
                var listUser = listApprov.Split(';').ToList();
                listApproval = new UserDao().GetListUser(listUser);
            }
            var listEmail = string.Join("; ", listApproval.Select(x => x.Email.ToString()).ToArray());

            // check and delete permisstion
            if (listEmail != null && listEmail != "")
            {
                return(Json(new { result = listEmail }));
            }
            else
            {
                return(Json(new { result = false }));
            }
        }