Exemplo n.º 1
0
        private void frmUserRight_Load(object sender, EventArgs e)
        {
            LoginUserManage lum = new LoginUserManage();
            DataTable       dtl = lum.GetLoginUserInfo();
            ListItem        item;

            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                item       = new ListItem();
                item.Text  = dtl.Rows[i]["USERNAME"].ToString();
                item.Value = dtl.Rows[i]["USERID"].ToString();
                checkedListBox1.Items.Add(item);
            }


            UserRightManage urm = new UserRightManage();

            dtl = urm.GetModule();

            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                item       = new ListItem();
                item.Text  = dtl.Rows[i]["ModuleName"].ToString();
                item.Value = dtl.Rows[i]["ModuleId"].ToString();
                chLBPopedom.Items.Add(item);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 绑定下拉列表框,通用方法
        /// </summary>
        public void cboDataBind(ComboBox obj)
        {
            LoginUserManage lum = new LoginUserManage();
            DataTable       dtl = lum.GetLoginUserInfo();
            ListItem        item;

            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                item       = new ListItem();
                item.Text  = dtl.Rows[i]["USERNAME"].ToString();
                item.Value = dtl.Rows[i]["USERID"].ToString();
                obj.Items.Add(item);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 加载当前所有用户
        /// </summary>
        private void LoadLoginUser()
        {
            LoginUserManage LoginUserManage = new LoginUserManage();
            DataTable       dtl             = LoginUserManage.GetLoginUserInfo();

            ListItem listitem = new ListItem();

            chklstUser.Items.Clear();

            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                listitem       = new ListItem();
                listitem.Text  = dtl.Rows[i]["UserName"].ToString();
                listitem.Value = dtl.Rows[i]["UserID"].ToString();
                chklstUser.Items.Add(listitem);
            }
        }