private void btnAddUser_Click(object sender, EventArgs e) { this.flag = "1"; //获取所选机构 bool result = GetOwnOrg(); if (!result) { return; } //初始化AddUser AddConfigInfo addConfigInfo = new AddConfigInfo(); addConfigInfo.Owner = this; addConfigInfo.Init(); addConfigInfo.ShowDialog(this); }
private void btnUpdate_Click(object sender, EventArgs e) { //判断选中几行 只修改第一行 try { this.flag = "2"; int count = 0; for (int i = 0; i < this.dgvConfigInfo.Rows.Count; i++) { if (this.dgvConfigInfo.Rows[i].Cells[this.dgvConfigInfo.Columns["SelectCheck"].Index].EditedFormattedValue.ToString() == "True") { count++; this.configID = this.dgvConfigInfo.Rows[i].Cells["id"].Value.ToString(); AddConfigInfo addConfigInfo = new AddConfigInfo(); addConfigInfo.Owner = this; addConfigInfo.Init(); addConfigInfo.ShowDialog(this); return; } } if (count == 0) { MessageBox.Show("请选择要修改的行!"); return; } else if (count > 1) { MessageBox.Show("请选择一行修改记录!"); return; } } catch (Exception ex) { throw ex; } }