private void btnThem_Click(object sender, EventArgs e) { FormThem_CapNhatTheLoai newForm = new FormThem_CapNhatTheLoai(); this.Visible = false; newForm.Show(); newForm.Disposed += NewForm_Disposed; }
private void btnSua_Click(object sender, EventArgs e) { DataGridViewRow row = dataGVTheLoai.SelectedRows.Count >= 1 ? dataGVTheLoai.SelectedRows[0] : null; if (row != null) { string maTheLoai = row.Cells["colMaTL"].Value.ToString(); string tenTheLoai = row.Cells["colTenTL"].Value.ToString(); FormThem_CapNhatTheLoai newForm = new FormThem_CapNhatTheLoai(maTheLoai, tenTheLoai); this.Visible = false; newForm.Show(); newForm.Disposed += NewForm_Disposed; } else { MessageBox.Show("Bạn chưa chọn thể loại để sửa"); } }