Exemple #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            bool CHK = DBLayer.CHK_B4_DEL_AREA(txtName.Text);

            if (CHK)
            {
                MessageBox.Show("Cannot Delete! Already in use", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                lbl.Text = header + " >> Delete Area";
                DialogResult result = MessageBox.Show("Are You Sure You Want to Delete??", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    usp_SEL_tblAreaTableAdapter.Delete1(Convert.ToInt32(txtID.Text));
                    usp_SEL_tblAreaTableAdapter.Fill(comDataSet.usp_SEL_tblArea);
                    MessageBox.Show("Deleted Succesfully!", "Suucess", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                lbl.Text = header;
            }
        }