コード例 #1
0
 private void toolStripLabel1_Click(object sender, EventArgs e)
 {
     try
     {
         if (lvwUserList.SelectedRows.Count > 0)//选择行
         {
             if (UserIDSearch == 0)
             {
                 return;
             }
             if (UserIDSearch > 0)
             {
                 if (UserIDSearch == CommonalityEntity.USERID)
                 {
                     MessageBox.Show("不能给自己配置权限!"); return;
                 }
                 UserRoleADD uradd = new UserRoleADD();
                 CommonalityEntity.YesNoBoolRoleUser = true;
                 CommonalityEntity.rbools            = false;
                 CommonalityEntity.UserID            = UserIDSearch;
                 UserRoleADD ur = new UserRoleADD();
                 ur.ShowDialog(uradd);
             }
         }
         else
         {
             MessageBox.Show("请选择行", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch
     {
         CommonalityEntity.WriteTextLog("UserRole.tsl_Role_Click()");
     }
 }
コード例 #2
0
        private void tsl_Role_Click(object sender, EventArgs e)
        {
            try
            {
                if (lvwUserList.SelectedRows.Count > 0)//选择行
                {
                    if (lvwUserList.SelectedRows.Count > 1)
                    {
                        MessageBox.Show("只能选择一行进行权限设置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        if (lvwUserList.SelectedRows[0].Cells["Role_Id"].Value == null)
                        {
                            return;
                        }

                        if (int.Parse(lvwUserList.SelectedRows[0].Cells["Role_Id"].Value.ToString()) > 0)
                        {
                            UserRoleADD uradd = new UserRoleADD();
                            CommonalityEntity.YesNoBoolRoleUser = false;
                            CommonalityEntity.rbools            = false;
                        }
                    }
                }
                else
                {
                    MessageBox.Show("请选择行", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                CommonalityEntity.WriteTextLog("UserRole.tsl_Role_Click()");
            }
        }
コード例 #3
0
        /// <summary>
        /// 用户权限配置
        /// </summary>
        private void lb_UserRole_Click(object sender, EventArgs e)
        {
            UserRoleADD uradd = new UserRoleADD();

            CommonalityEntity.rbools            = true;
            CommonalityEntity.YesNoBoolRoleUser = true;
            uradd.ShowDialog();
        }
コード例 #4
0
        /// <summary>
        /// 权限设置
        /// </summary>
        /// <param name="?"></param>
        private void tsl_Role_Click()
        {
            try
            {
                if (lvwUserList.SelectedRows.Count > 0)//选择行
                {
                    if (lvwUserList.SelectedRows.Count > 1)
                    {
                        MessageBox.Show("只能选择一行进行权限设置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        if (lvwUserList.SelectedRows[0].Cells["Userid"].Value == null)
                        {
                            return;
                        }
                        if (lvwUserList.SelectedRows[0].Cells["Role_Id"].Value == null)
                        {
                            return;
                        }

                        if (Convert.ToInt32(lvwUserList.SelectedRows[0].Cells["Userid"].Value.ToString()) > 0)
                        {
                            UserRoleADD uradd = new UserRoleADD();
                            CommonalityEntity.YesNoBoolRoleUser = true;
                            CommonalityEntity.rbools            = false;
                            //common.UserID = common.GetInt(lvwUserList.SelectedRows[0].Cells["Userid"].Value.ToString());
                            //common.RoleID = common.GetInt(lvwUserList.SelectedRows[0].Cells["Role_Id"].Value.ToString());
                            //mf.ShowChildForm(uradd);
                            //uradd.ShowDialog();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("请选择行", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                CommonalityEntity.WriteTextLog("UserRole.tsl_Role_Click()");
            }
        }