private void btnAdd_Click(object sender, EventArgs e) { MasterPass master = new MasterPass(); master.ShowDialog(); if (master.Result()) { fail.setGroupId(Convert.ToInt32(((Item)cbbCategory.SelectedItem).Value)); fail.setName(txtFailName.Text); fail.Add(); LoadData(); } }
private void btnRemove_Click(object sender, EventArgs e) { MasterPass masterPass = new MasterPass(); masterPass.ShowDialog(); if (masterPass.Result()) { int temp = rowTemp; BLFailRecord re = new BLFailRecord(); re.setId(Convert.ToInt32(gvProblem.Rows[temp].Cells[recordIdIndex].Value.ToString())); re.Remove(Convert.ToInt32(gvProblem.Rows[temp].Cells[recordIdIndex].Value.ToString())); MessageBox.Show("Đã xóa"); LoadData(); } }