コード例 #1
0
        void Init()
        {
            myPayGroupList.Clear();
            myCalRunList.Clear();

            DateTime end   = DateTime.Today;
            DateTime start = end.AddMonths(-MyHelper.LatestMonths); //最近三个月

            foreach (CalRunInfo cal in CalRunInfo.GetList(start, end))
            {
                foreach (string groupId in cal.薪资组列表)
                {
                    bool enabled = AccessController.CheckPayGroup(groupId);
                    if (enabled)
                    {
                        PayGroup pg = PayGroup.Get(groupId);
                        if (pg != null)
                        {
                            if (myPayGroupList.Find(a => a.英文名 == pg.英文名) == null)
                            {
                                myPayGroupList.Add(pg);
                            }
                            if (myCalRunList.Find(a => a.日历组编号 == cal.日历组编号) == null)
                            {
                                myCalRunList.Add(cal);
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        private void InitListBox()
        {
            if (this.CurrentRole != null)
            {
                if (checkedListBoxControl1.Items.Count == 0)
                {
                    foreach (PayGroup pg in PayGroup.薪资组集合)
                    {
                        checkedListBoxControl1.Items.Add(pg, false);
                    }
                }

                checkedListBoxControl1.BeginUpdate();

                List <RolePayGroup> groups = RolePayGroup.GetPayGroups(this.CurrentRole.Name);
                foreach (CheckedListBoxItem item in checkedListBoxControl1.Items)
                {
                    PayGroup paygroup  = (PayGroup)item.Value;
                    bool     isChecked = groups.Find(a => a.薪资组 == paygroup.英文名) != null;
                    item.CheckState = isChecked ? CheckState.Checked : CheckState.Unchecked;
                }

                checkedListBoxControl1.EndUpdate();
            }
        }
コード例 #3
0
        private void SearchEmployeeInfoForm_Load(object sender, EventArgs e)
        {
            cb薪资组.Properties.Items.Clear();
            foreach (PayGroup rpg in AccessController.我管理的薪资组)
            {
                PayGroup pg = PayGroup.Get(rpg.英文名);
                if (pg != null)
                {
                    ImageComboBoxItem item = new ImageComboBoxItem(pg.中文名, rpg.英文名);
                    cb薪资组.Properties.Items.Add(item);
                }
            }
            ImageComboBoxItem all = new ImageComboBoxItem("所有薪资组", "");

            cb薪资组.Properties.Items.Add(all);
            cb薪资组.SelectedItem = all;
        }
コード例 #4
0
        void Init()
        {
            myPayGroupList.Clear();
            myCalRunList.Clear();

            DateTime end   = DateTime.Today;
            DateTime start = end.AddMonths(-MyHelper.LatestMonths); //最近三个月

            foreach (CalRunInfo cal in CalRunInfo.GetList(start, end))
            {
                foreach (string groupId in cal.薪资组列表)
                {
                    bool enabled = AccessController.CheckPayGroup(groupId);
                    if (enabled)
                    {
                        PayGroup pg = PayGroup.Get(groupId);
                        if (pg != null)
                        {
                            if (myPayGroupList.Find(a => a.英文名 == pg.英文名) == null)
                            {
                                myPayGroupList.Add(pg);
                            }
                            if (myCalRunList.Find(a => a.日历组编号 == cal.日历组编号) == null)
                            {
                                myCalRunList.Add(cal);
                            }
                        }
                    }
                }
            }
            ccb发放单位.Properties.Items.Clear();
            foreach (DictionaryEntry entry in PsHelper.GetCompanyTable())
            {
                ImageComboBoxItem item = new ImageComboBoxItem((string)entry.Key, (string)entry.Key);
                ccb发放单位.Properties.Items.Add(item);
            }
            ccb所属公司.Properties.Items.Clear();
            foreach (DictionaryEntry entry in PsHelper.GetCompanyTable())
            {
                ImageComboBoxItem item = new ImageComboBoxItem((string)entry.Key, (string)entry.Key);
                ccb所属公司.Properties.Items.Add(item);
            }
        }
コード例 #5
0
        private void cbb日历组_SelectedIndexChanged(object sender, EventArgs e)
        {
            cb薪资组.Properties.Items.Clear();
            CalRunInfo cal = CalRunInfo.Get((string)cbb日历组.EditValue);

            if (cal != null)
            {
                foreach (string groupId in cal.薪资组列表)
                {
                    bool enabled = AccessController.CheckPayGroup(groupId);
                    if (enabled)
                    {
                        PayGroup pg = PayGroup.Get(groupId);
                        if (pg != null)
                        {
                            ImageComboBoxItem item = new ImageComboBoxItem(pg.中文名, groupId);
                            cb薪资组.Properties.Items.Add(item);
                        }
                    }
                }
            }
        }
コード例 #6
0
        private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            CheckedListBoxItem currItem = (CheckedListBoxItem)checkedListBoxControl1.GetItem(e.Index);
            PayGroup           paygroup = (PayGroup)currItem.Value;
            string             rolename = this.CurrentRole.Name;

            //如果选中
            if (e.State == CheckState.Checked)
            {
                RolePayGroup rpg = new RolePayGroup();
                rpg.角色  = rolename;
                rpg.薪资组 = paygroup.英文名;
                rpg.Save();
            }
            //如果没有选中
            if (e.State == CheckState.Unchecked)
            {
                RolePayGroup rpg = RolePayGroup.GetRolePayGroup(paygroup.英文名, rolename);
                if (rpg != null)
                {
                    rpg.Del();
                }
            }
        }