private void barButtonItemAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (xtraTabControlLeft.SelectedTabPage.Name.Equals("xtraTabPageGroup")) { frmGroupChild form = new frmGroupChild(this, "INSERT", null); ProtocolForm.ShowModalDialog(this, form); this.gridControlGroup.DataSource = Group.loadAllGroup(); this.editEnabledButtonDeleteAndEdit(); } else { frmUserChild form = new frmUserChild(this, "INSERT", null); ProtocolForm.ShowModalDialog(this, form); this.gridControlUser.DataSource = User.loadAllUser(); this.editEnabledButtonDeleteAndEdit(); } reLoadGroupUserThanhPhan(); }
private void btnEdit_Click() { if (xtraTabControlLeft.SelectedTabPage.Name.Equals("xtraTabPageGroup")) { if (btnEdit.Enabled) { DataRow row = gridViewGroup.GetDataRow(gridViewGroup.FocusedRowHandle); frmGroupChild form = new frmGroupChild(this, "EDIT", row["GROUPID"].ToString()); ProtocolForm.ShowModalDialog(this, form); this.gridControlGroup.DataSource = Group.loadAllGroup(); } } else { if (btnEdit.Enabled) { DataRow row = gridViewUser.GetDataRow(gridViewUser.FocusedRowHandle); frmUserChild form = new frmUserChild(this, "EDIT", row["userid"].ToString()); ProtocolForm.ShowModalDialog(this, form); this.gridControlUser.DataSource = User.loadAllUser(); } } reLoadGroupUserThanhPhan(); }
private void lbUser_DoubleClick(object sender, System.EventArgs e) { if (lbUser.SelectedIndex <= 0) return; User u = new User(); u.username = lbUser.SelectedItem.ToString(); u.loadByUserName(); frmUserChild form = new frmUserChild(null, "EDIT", u.id.ToString()); ProtocolForm.ShowModalDialog(this, form); }