コード例 #1
0
        private void Delete()
        {
            try
            {
                BusinessManager BM = new BusinessManager();
                BOSales         BO = new BOSales();
                BO.InvoiceNo = txtInvoiceNo.Text;
                int rowsAffected = BM.BALDeleteInvoiceData(BO);

                if (rowsAffected > 0)
                {
                    MessageBox.Show("The record has been successfully deleted", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    New();
                }
                else
                {
                    MessageBox.Show("No Record found", "Sorry", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    New();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }