private void FrmClose(bool isCancel = false) { if (gbNew.Visible) { this.btnNewClose.Click -= this.BtnNewCloseClick; this.btnNewSave.Click -= this.BtnNewSaveClick; gbNew.Visible = false; tableLayoutPanel1.Enabled = true; if (_mModule == "NEW") { LoadAll(); } else { if (!isCancel) { dgView.Rows[dgView.SelectedRows[0].Index].Cells[1].Value = txtSuburb.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[2].Value = txtTrainer.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[3].Value = txtQualification.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[4].Value = txtTransmission.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[5].Value = txtModel.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[6].Value = txtRegNo.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[7].Value = txtArea.Text; } } EmptyAll(); } else { this.dgView.MouseDoubleClick -= this.DgViewMouseDoubleClick; this.btnSearch.Click -= new System.EventHandler(this.BtnSearchClick); this.btnClose.Click -= new System.EventHandler(this.BtnCloseClick); this.btnDel.Click -= new System.EventHandler(this.BtnDelClick); this.btnEdit.Click -= new System.EventHandler(this.BtnEditClick); this.btNew.Click -= new System.EventHandler(this.BtNewClick); this.Load -= new System.EventHandler(this.frmListingLoad); FrmClass.CloseForm(this, _bgWrkr); } }
private void FrmClose(bool isCancel = false) { if (gbNew.Visible) { this.btnNewClose.Click -= this.BtnNewCloseClick; this.btnNewSave.Click -= this.BtnNewSaveClick; gbNew.Visible = false; tableLayoutPanel1.Enabled = true; if (_mModule == "NEW") { LoadAll(); } else { if (!isCancel) { dgView.Rows[dgView.SelectedRows[0].Index].Cells[1].Value = txtUserID.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[2].Value = txtUserName.Text; dgView.Rows[dgView.SelectedRows[0].Index].Cells[4].Value = chkStatus.Checked ? RecordStatus.Active : RecordStatus.Cancel; dgView.Rows[dgView.SelectedRows[0].Index].Cells[5].Value = txtPwd.Text; } } EmptyAll(); } else { this.dgView.MouseDoubleClick -= this.DgViewMouseDoubleClick; this.btnSearch.Click -= new System.EventHandler(this.BtnSearchClick); this.btnClose.Click -= new System.EventHandler(this.BtnCloseClick); this.btnDel.Click -= new System.EventHandler(this.BtnDelClick); this.btnEdit.Click -= new System.EventHandler(this.BtnEditClick); this.btNew.Click -= new System.EventHandler(this.BtNewClick); this.Load -= new System.EventHandler(this.FrmUserSetupLoad); FrmClass.CloseForm(this, _bgWrkr); } }