private void dgvThuaDat_DoubleClick(object sender, EventArgs e) { bool flag = this.dgvThuaDat.SelectedRows != null && this.dgvThuaDat.SelectedRows.Count > 0; if (flag) { ThuaDat thuaDat = (ThuaDat)this.dgvThuaDat.SelectedRows[0].DataBoundItem; bool flag2 = this._frmThuaDat == null; if (flag2) { this._frmThuaDat = new FormThuaDat(); } this._frmThuaDat.IsNew = false; this._frmThuaDat.ThuaDat = thuaDat; this._frmThuaDat.ShowDialog(); } this.dgvThuaDat.Refresh(); }
private void lblThemThua_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { bool flag = this._frmThuaDat == null; if (flag) { this._frmThuaDat = new FormThuaDat(); } this._frmThuaDat.IsNew = true; this._frmThuaDat.ShowDialog(); bool flag2 = this._frmThuaDat.ThuaDat != null; if (flag2) { BindingList <ThuaDat> bindingList = (BindingList <ThuaDat>) this.dgvThuaDat.DataSource; bindingList.Add(this._frmThuaDat.ThuaDat); } this.dgvThuaDat.Refresh(); }