Esempio n. 1
0
        public void SaveUser(BaseEmployee emp, BaseUser user, int[] deptId, int defaultDeptId, int[] groupIds)
        {
            emp.Pym = SpellAndWbCode.GetSpellCode(emp.Name);
            emp.Wbm = SpellAndWbCode.GetWBCode(emp.Name);
            emp.Brithday = DateTime.Now;
            emp.Szm = "";
            emp.save();
            user.EmpId = emp.EmpId;
            user.PassWord = ConvertExtend.ToPassWord("1");
            user.Memo = "";
            user.save();

            NewObject<Employee>().SetHaveEmpDeptRole(emp.EmpId, deptId);
            NewObject<Employee>().SetDefaultEmpDeptRole(emp.EmpId, defaultDeptId);
            NewObject<User>().SetGroupUserRole(user.UserId, groupIds);

        }
Esempio n. 2
0
        public void loadAddUserView(BaseEmployee _currEmp, int _currdeptId, BaseUser _currUser, List<BaseGroup> _groupList, List<BaseDept> _deptList, List<BaseGroup> _userGroupId, List<BaseDept> _empDeptId)
        {
            frmForm1.Clear();

            emp = _currEmp;
            user = _currUser;
            groupList = _groupList;
            deptList = _deptList;
            frmForm1.Load<BaseEmployee>(emp);
            frmForm1.Load<BaseUser>(user);


            this.textShowCard1.ShowCardDataSource = ConvertExtend.ToDataTable(_deptList);
            textShowCard1.MemberValue = _currdeptId;

            this.checkedListBox1.Items.Clear();
            foreach (BaseGroup val in _groupList)
            {
                checkedListBox1.Items.Add(val.Name);
            }

            this.checkedListBox2.Items.Clear();
            foreach (BaseDept val in _deptList)
            {
                checkedListBox2.Items.Add(val.Name);
            }

            if (_userGroupId != null)
                foreach (BaseGroup val in _userGroupId)
                {
                    checkedListBox1.SetItemChecked(_groupList.FindIndex(x => x.GroupId == val.GroupId), true);
                }
            if (_empDeptId != null)
                foreach (BaseDept val in _empDeptId)
                {
                    checkedListBox2.SetItemChecked(_deptList.FindIndex(x => x.DeptId == val.DeptId), true);
                }
        }