Ejemplo n.º 1
0
        private void gvProblem_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Chắc chắn xóa ?", "Xac nhan", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                // MessageBox.Show(e.Row.Cells[0].Value.ToString());
                f.Remove(Convert.ToInt32(e.Row.Cells[recordIdIndex].Value.ToString()));
                MessageBox.Show("Đã xóa");
                LoadData();
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }