//单元格单击事件
        private void dgvUserList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            SetCheckBoxFalse();                                      //将groupbox1和groupbox3上的checkbox修改为false
            int    currentIndex = this.dgvUserList.CurrentRow.Index; //当前选中的行的索引
            string purviewStr   = this.dgvUserList["userPurview", currentIndex].Value.ToString();

            //组别显示

            foreach (Control x in groupBox3.Controls)
            {
                CheckBox ca = (CheckBox)x;
                if (ca.Text == this.dgvUserList["userSort", currentIndex].Value.ToString())
                {
                    ca.Checked = true;
                }
            }


            //权限显示
            char[] openOrclose = purviewStr.ToCharArray();
            foreach (Control y in groupBox1.Controls)
            {
                CheckBox cb = (CheckBox)y;
                cb.Checked = CCharToBool.CharToBool(openOrclose[int.Parse(cb.Tag.ToString())]);
            }
        }
Exemple #2
0
 public frmBookSortManage()
 {
     InitializeComponent();
     //权限读取,从权限字符串中取出该功能对应的字符,判断时候具有该功能的权限
     char[] openOrclose = Session.UserPurview.ToCharArray();
     tsbAddSort.Enabled    = CCharToBool.CharToBool(openOrclose[1]);
     tsbDeleteSort.Enabled = CCharToBool.CharToBool(openOrclose[2]);
 }
        public delegate void _delegateRefreshAllInfo();//定义委托

        public frmBookInfoManage()
        {
            InitializeComponent();
            //权限检查语法
            char[] openOrclose = Session.UserPurview.ToCharArray();
            tsbBookSortManage.Enabled = CCharToBool.CharToBool(openOrclose[3]);
            tsbAddInfo.Enabled        = CCharToBool.CharToBool(openOrclose[4]);
            tsbUpdateInfo.Enabled     = CCharToBool.CharToBool(openOrclose[5]);
            tsbDeleteInfo.Enabled     = CCharToBool.CharToBool(openOrclose[6]);
        }
 private void frmManagePannel_Load(object sender, EventArgs e)
 {
     //权限读取与设置
     char[] openOrclose = Session.UserPurview.ToCharArray();
     btBookInfo    = CCharToBool.CharToBool(openOrclose[3]);
     btReader      = CCharToBool.CharToBool(openOrclose[9]);
     btLend        = CCharToBool.CharToBool(openOrclose[15]);
     btSysInfo     = CCharToBool.CharToBool(openOrclose[20]);
     btUserPurview = CCharToBool.CharToBool(openOrclose[25]);
 }
Exemple #5
0
        public delegate void _delegateRefreshAllReader(); //委托定义,用于同步刷新

        public frmReaderManage()
        {
            InitializeComponent();
            //权限检查语法
            char[] openOrclose = Session.UserPurview.ToCharArray();

            tsbAddNewReader.Enabled = CCharToBool.CharToBool(openOrclose[10]);
            tsbUpdateReader.Enabled = CCharToBool.CharToBool(openOrclose[11]);
            tsbDeleteReader.Enabled = CCharToBool.CharToBool(openOrclose[12]);
        }
Exemple #6
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            if (Session.UserName != "")
            {
                //权限读取与设置
                char[] openOrclose = Session.UserPurview.ToCharArray();

                图书卡片管理ToolStripMenuItem.Enabled = CCharToBool.CharToBool(openOrclose[3]);
                读者信息维护ToolStripMenuItem.Enabled = CCharToBool.CharToBool(openOrclose[9]);
                借阅图书ToolStripMenuItem.Enabled   = CCharToBool.CharToBool(openOrclose[16]);
                归还图书ToolStripMenuItem.Enabled   = CCharToBool.CharToBool(openOrclose[17]);
                图书信息查询ToolStripMenuItem.Enabled = CCharToBool.CharToBool(openOrclose[21]);
                读者信息查询ToolStripMenuItem.Enabled = CCharToBool.CharToBool(openOrclose[22]);
                图书借阅查询ToolStripMenuItem.Enabled = CCharToBool.CharToBool(openOrclose[23]);
                用户权限管理ToolStripMenuItem.Enabled = CCharToBool.CharToBool(openOrclose[27]);


                frmManagePannel frmMp = new frmManagePannel();
                frmMp.MdiParent = this;
                frmMp.Show();
            }
        }
Exemple #7
0
        //在窗体加载事件中载入列表
        private void frmBorrowReturnMana_Load(object sender, EventArgs e)
        {
            ReadersComboxBinding();
            BooksComboxBinding();

            //将应还书日期定在30天后
            DateTime dt = dtkBorrowDate.Value;

            dt = dt.AddDays(30);
            dtkYReturnDate.Value = dt;

            //权限读取与设置
            char[] openOrclose = Session.UserPurview.ToCharArray();
            if (!CCharToBool.CharToBool(openOrclose[16]))
            {
                this.tabControl1.TabPages.Remove(tabBorrow);
            }
            if (!CCharToBool.CharToBool(openOrclose[17]))
            {
                this.tabControl1.TabPages.Remove(tabReturn);
            }
        }
Exemple #8
0
        //重载构造函数
        public frmUserAddUpdate(CtbUserInformation _cUser)
        {
            InitializeComponent();

            //----------修改用户信息------------
            this.Text    = "修改用户信息";
            btEnter.Text = "保存";

            cUser = _cUser;//接收传过来的用户信息

            //----以下提取用户信息进行控件赋值-----
            charPurview = cUser.userPurview.ToCharArray();

            //----组别赋值---
            foreach (Control x in groupBox3.Controls)
            {
                RadioButton ra = (RadioButton)x;
                if (ra.Text == cUser.userSort)
                {
                    ra.Checked = true;
                }
            }

            //----权限控件赋值----
            foreach (Control y in groupBox2.Controls)
            {
                CheckBox ca = (CheckBox)y;
                ca.Checked = CCharToBool.CharToBool(charPurview[int.Parse(ca.Tag.ToString())]);
            }

            //----基本信息赋值----
            tbUserName.Text    = cUser.userName;
            tbUserPwd.Text     = cUser.userPwd;
            tbUserAllName.Text = cUser.userAllName;


            tbUserName.ReadOnly = true;
        }
Exemple #9
0
        private void frmSystemInfoSearch_Load(object sender, EventArgs e)
        {
            //开始时间比结束时间小30天
            DateTime dt = dtpEndTime.Value;

            dt = dt.AddDays(-30);
            dtpStartTime.Value = dt;


            //权限读取与设置
            char[] openOrclose = Session.UserPurview.ToCharArray();
            if (!CCharToBool.CharToBool(openOrclose[21]))
            {
                this.tabControl1.TabPages.Remove(tpBookInfo);
            }
            if (!CCharToBool.CharToBool(openOrclose[22]))
            {
                this.tabControl1.TabPages.Remove(tpReaderInfo);
            }
            if (!CCharToBool.CharToBool(openOrclose[23]))
            {
                this.tabControl1.TabPages.Remove(tpLendInfo);
            }
        }