示例#1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (!vOpenMode)
                {
                    return;
                }

                string vMessage = string.Empty;

                vMessage = "Are you Sure To Delete";
                new Speak().SayIt(vMessage);
                DialogResult dMsg = MessageBox.Show("Are you Sure To Delete!!!", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dMsg == DialogResult.No)
                {
                    return;
                }

                //Delete Activity
                objDAL.DeleteRecord(int.Parse(txtID.Text));



                vMessage = "Record Deleted Successfully";
                new Speak().SayIt(vMessage);
                MessageBox.Show(vMessage, "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadGrid();
                btnClear_Click(sender, e);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message.ToString(), "Error");
            }
        }