Exemple #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int BillStatus = -1;
            int SupID      = int.Parse(MyCommon.GetSelectedID(cmbSupplier, true));

            BillStatus = MyBill.GetBillStatus(cmbGRN.Text, SupID);
            string respond = "";

            if (MessageBox.Show("Do you want to delete current record ? ", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                if (BillStatus == 3)
                {
                    Program.VerningMessage("you cannot delete this bill it is already accounted");
                }
                else
                {
                    respond = MyBill.DeleteBilling(cmbGRN.Text, SupID);
                    if (respond == "True")
                    {
                        Program.InformationMessage("Record Deleted Successfully");
                        ClearFullscreen();
                    }
                    else
                    {
                        Program.VerningMessage(respond);
                    }
                }
            }
        }