Ejemplo n.º 1
0
        private void LoadGroup()
        {
            RightGroupManage RightGroupManage = new RightGroupManage();
            DataTable        dtl = RightGroupManage.GetRightGroupInfo();

            gridGroup.DataSource = dtl;
        }
Ejemplo n.º 2
0
        private void chklstUser_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (int i = 0; i < chklstGroup.Items.Count; i++)
            {
                chklstGroup.SetItemChecked(i, false);
            }

            RightGroupManage RightGroupManage = new RightGroupManage();
            string           userid           = ((ListItem)chklstUser.SelectedItem).Value;
            DataTable        dtl      = RightGroupManage.GetUserGroup(userid);
            ListItem         listitem = new ListItem();

            for (int i = 0; i < chklstGroup.Items.Count; i++)
            {
                listitem = chklstGroup.Items[i] as ListItem;

                for (int j = 0; j < dtl.Rows.Count; j++)
                {
                    if (dtl.Rows[j]["GroupID"].ToString().Trim() == listitem.Value)
                    {
                        chklstGroup.SetItemChecked(i, true);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            RightGroupManage RightGroupManage = new RightGroupManage();
            //保存
            bool i = false;

            i = RightGroupManage.IsOperateRightByUserID("admin", "ClientOrder", "Save");

            //删除
            i = RightGroupManage.IsOperateRightByUserID("admin", "ClientOrder", "Delete");

            //查询
            i = RightGroupManage.IsOperateRightByUserID("admin", "ClientOrder", "Qry");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 加载权限组
        /// </summary>
        private void LoadRightGroup()
        {
            RightGroupManage RightGroupManage = new RightGroupManage();
            DataTable        dtl = RightGroupManage.GetRightGroupInfo();

            ListItem listitem = new ListItem();

            chklstGroup.Items.Clear();

            for (int i = 0; i < dtl.Rows.Count; i++)
            {
                listitem       = new ListItem();
                listitem.Text  = dtl.Rows[i]["GroupName"].ToString();
                listitem.Value = dtl.Rows[i]["GroupGuid"].ToString();
                chklstGroup.Items.Add(listitem);
            }
        }
Ejemplo n.º 5
0
        private void tsbtnSave_Click(object sender, EventArgs e)
        {
            if (txtGroupName.Text.Trim() == "")
            {
                this.ShowMessage("请输入组名!");
                return;
            }

            RightGroupManage RightGroupManage = new RightGroupManage();

            RightGroupManage.AddGroup(txtGroupName.Text.Trim());

            //写日志
            SysLog.AddOperateLog(SysParams.UserName, "权限组新增", "新增", SysParams.UserName + "用户新增权限组,组名:" + txtGroupName.Text.Trim());



            LoadGroup();
        }
Ejemplo n.º 6
0
        //保存
        private void tsbtnSave_Click(object sender, EventArgs e)
        {
            //先判断是否有选择操作员
            if (chklstUser.CheckedItems.Count <= 0)
            {
                this.ShowMessage("请选择操作员!");
                return;
            }


            List <string> lstUser  = new List <string>();
            List <string> lstGroup = new List <string>();
            ListItem      listitem = new ListItem();

            for (int i = 0; i < chklstUser.CheckedItems.Count; i++)
            {
                listitem = chklstUser.CheckedItems[i] as ListItem;


                lstUser.Add(listitem.Value);
            }

            listitem = new ListItem();
            for (int i = 0; i < chklstGroup.CheckedItems.Count; i++)
            {
                listitem = chklstGroup.CheckedItems[i] as ListItem;

                lstGroup.Add(listitem.Value);
            }

            RightGroupManage RightGroupManage = new RightGroupManage();

            RightGroupManage.SaveUserRightGroup(lstUser, lstGroup);

            this.ShowMessage("用户权限设置保存成功!");
        }