Ejemplo n.º 1
0
        private void Getmodule()
        {
            DataTable dt = T_Sysset.IsGetModule(0);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return;
            }
            DataRow[] drt = dt.Select("ModuleSys is null");
            chkMouduleCol.Items.Clear();
            chkMouduleColSet.Items.Clear();
            T_addModule.ModuleColSet.Clear();
            foreach (DataRow dr in drt)
            {
                string str = dr[1].ToString();
                chkMouduleCol.Items.Add(str);
            }
            DataRow[] drj = dt.Select("ModuleSys='1'");
            foreach (DataRow dr in drj)
            {
                string str = dr[1].ToString();
                chkMouduleColSet.Items.Add(str);
                T_addModule.ModuleColSet.Add(str);
            }
        }
Ejemplo n.º 2
0
        void InitModule()
        {
            DataTable dt = T_Sysset.IsGetModule(1);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return;
            }
            Task.Run(() =>
            {
                foreach (DataRow dr in dt.Rows)
                {
                    int idGroup         = Convert.ToInt32(dr["ModuleInt"].ToString());
                    string nameChModule = dr["ModuleChName"].ToString();
                    if (T_User.UserSys.IndexOf(DESEncrypt.DesEncrypt(nameChModule)) < 0)
                    {
                        continue;
                    }
                    string nameModule     = DESEncrypt.DesDecrypt(dr["ModuleName"].ToString());
                    string nameModuleFile = DESEncrypt.DesDecrypt(dr["ModuleFileName"].ToString());
                    int imgIdx            = Convert.ToInt32(dr["ModuleImgIdx"].ToString());
                    string menuModule     = dr["ModuleMenuName"].ToString();
                    ButtonItem item       = new ButtonItem
                    {
                        Name          = nameModule,
                        Tag           = nameModuleFile,
                        ImagePosition = eImagePosition.Top,
                        ImageIndex    = imgIdx
                    };
                    item.Click += Item_Click;
                    sideBarManger.Invoke(new Action(() =>
                    {
                        item.Text = nameChModule;
                        for (int i = 0; i < sideBarManger.Panels.Count; i++)
                        {
                            string str = sideBarManger.Panels[i].Text;
                            if (str.IndexOf(menuModule) >= 0)
                            {
                                sideBarManger.Panels[i].SubItems.Add(item);
                            }
                        }
                        sideBarManger.Refresh();
                    }));
                }
                ButtonItem item1 = new ButtonItem
                {
                    Name          = "FrmModuleSet",
                    ImagePosition = eImagePosition.Top,
                    ImageIndex    = 21
                };
                item1.Click += Item_Click;
                sideBarManger.BeginInvoke(new Action(() =>
                {
                    item1.Text = "模块授权设置";
                    for (int i = 0; i < sideBarManger.Panels.Count; i++)
                    {
                        string str = sideBarManger.Panels[i].Text;
                        if (str.IndexOf("系统") >= 0)
                        {
                            sideBarManger.Panels[2].SubItems.Add(item1);
                        }
                    }
                    sideBarManger.Refresh();
                }));
            });
            AcAbout();
        }