Exemple #1
0
        private void dgvUGR_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            GroupBusinessLogic      groupBusinessLogic      = new GroupBusinessLogic();
            View_GroupBusinessLogic view_GroupBusinessLogic = new View_GroupBusinessLogic();

            //单击班组名称显示该班组成员
            if (e.ColumnIndex == 3 && e.RowIndex != -1)
            {
                string groupID = this.dgvUGR.Rows[e.RowIndex].Cells[2].Value.ToString();
                this.dgvUserInGroup.DataSource = view_GroupBusinessLogic.GetView_GroupByGroupID(groupID);
                SetdgvUserInGroupColumns();
                txbGroupID.Text = groupID;
            }
            //单击编辑执行的操作
            if (e.ColumnIndex == 0 && e.RowIndex != -1)
            {
                string        groupID       = this.dgvUGR.Rows[e.RowIndex].Cells[2].Value.ToString();
                EditGroupForm editGroupForm = new EditGroupForm(groupID);
                editGroupForm.ShowDialog();
                this.dgvUGR.DataSource = groupBusinessLogic.GetAllGroup();
            }
            //单击删除执行的操作
            if (e.ColumnIndex == 1 && e.RowIndex != -1)
            {
                DialogResult result = MessageBox.Show("确定删除该组?", "提示", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    string groupID = this.dgvUGR.Rows[e.RowIndex].Cells[2].Value.ToString();
                    groupBusinessLogic.DeleteGroupById(groupID);//删除已经做级联
                    MessageBox.Show("删除成功!");
                    LoadGroup();
                }
            }
        }
Exemple #2
0
 public UserAuthorizeForm()
 {
     InitializeComponent();
     this.groupBusinessLogic      = new GroupBusinessLogic();
     this.ugrBusinessLogic        = new UGRBusinessLogic();
     this.userBusinessLogic       = new UserBusinessLogic();
     this.view_GroupBusinessLogic = new View_GroupBusinessLogic();
     LoadGroup();
     LoadUsers();
     SetdgvUGRColumns();
     SetdgvUserColumns();
     txbGroupID.Visible = false;
     txbugrID.Visible   = false;
     txbUserID.Visible  = false;
 }