Exemplo n.º 1
0
        public ActionResult GetRoleCode()
        {
            EmployeeBll employeeBll              = new EmployeeBll();
            Dictionary <string, string> dicRole  = new Dictionary <string, string>();
            List <Bas_Role>             rolelist = employeeBll.GetRoleList();
            var list = rolelist.Select(s => { return(new { id = s.Bro_Id, text = s.Bro_Name }); });

            return(Select2(list, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult EditEmployee(int bem_id)
        {
            EmployeeViewModel employeeViewModel = new EmployeeViewModel();

            employeeViewModel.RuleSource = employeeBll.GetRoleList().Select(s =>
            {
                return(new DtoKeyValue <string, string>()
                {
                    key = s.Bro_code, value = s.Bro_Name
                });
            }).ToList();

            if (bem_id > 0)
            {
                var model = employeeBll.GetEmployeeEntity(bem_id);

                #region
                if (model != null)
                {
                    employeeViewModel.Id          = model.Bem_Id;
                    employeeViewModel.Account     = model.Bem_Account;
                    employeeViewModel.Password    = model.Bem_Password;
                    employeeViewModel.Name        = model.Bem_Name;
                    employeeViewModel.Sex         = model.Bem_Sex;
                    employeeViewModel.Phone       = model.Bem_Phone;
                    employeeViewModel.Email       = model.Bem_Email;
                    employeeViewModel.Roles       = model.Bem_Roles;
                    employeeViewModel.Status      = model.Bem_Status;
                    employeeViewModel.Remark      = model.Bem_Remark;
                    employeeViewModel.TotalGrades = model.Bem_Grades;
                }

                #endregion
            }
            return(View(employeeViewModel));
        }