/// <summary>
        /// 保存权限事件
        /// </summary>
        private void btnSaveRight_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FrmMainDAO.QueryUserButtonPower(this.Name, this.Text, sender, true))
                {
                    return;
                }

                if (!string.IsNullOrEmpty(DataTypeConvert.GetString(cboRoleName.EditValue)))
                {
                    dgvUserList.SetFocusedRowCellValue(dgvUserList.Columns["RoleName"], cboRoleName.Text);
                    dgvUserList.SetFocusedRowCellValue(dgvUserList.Columns["RoleNo"], cboRoleName.EditValue);
                    dgvUserList.SetFocusedRowCellValue(gridColButtonPower, DataTypeConvert.GetInt(checkButtonPower.EditValue));
                    FrmRightDAO.SaveRoleUser(cboRoleName.EditValue.ToString(), DataTypeConvert.GetInt(dgvUserList.GetFocusedDataRow()["AutoId"]), DataTypeConvert.GetInt(checkButtonPower.EditValue));
                    FrmRightDAO.GiveRoleAllButtonRight();
                }
                FrmRightBLL.SavePersonalRightFromTree(tvwUserRight, dgvUserList);//遍历树保存权限

                //FrmMain.frmMain.tsrLblCurrentStatusText = "【用户权限】已成功保存";
                MessageHandler.ShowMessageBox(tsmiYhqxycgbc.Text);// ("【用户权限】已成功保存。");
            }
            catch (Exception ex)
            {
                //ExceptionHandler.HandleException(this.Text + "--查询用户权限信息错误。", ex);
                ExceptionHandler.HandleException(this.Text + "--" + tsmiCxyhqxxxcw.Text, ex);
            }
        }
Beispiel #2
0
        private void btnSaveRight_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(cboRoleName.SelectedValue.ToString()))
            {
                dgvUserList.CurrentRow.Cells[4].Value = cboRoleName.Text;
                dgvUserList.CurrentRow.Cells[5].Value = cboRoleName.SelectedValue;
                FrmRightDAO.SaveRoleUser(cboRoleName.SelectedValue.ToString(), (int)dgvUserList.CurrentRow.Cells[0].Value, 0);
                FrmRightDAO.GiveRoleAllButtonRight();
            }
            FrmRightBLL.SavePersonalRightFromTree(tvwUserRight, dgvUserList);//遍历树保存权限

            FrmMain.frmMain.tsrLblCurrentStatusText = "【用户权限】已成功保存";
        }