예제 #1
0
        private void Cmb_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmb = (ComboBox)sender;

            if (cmb.Text == "Bill Payment")
            {
                string      billslno          = dgvBills.CurrentRow.Cells["slno"].Value.ToString();
                string      supplier          = dgvBills.CurrentRow.Cells["PartyName"].Value.ToString();
                BillPayment frmReceiptVoucher = new BillPayment(BillPayment._FromWhere.Expense_Bill, billslno, supplier);
                frmReceiptVoucher.OnClose += GenerateBillingList;
                frmReceiptVoucher.ShowDialog();
            }
            else if (cmb.Text == "Cancel")
            {
                if (UserTools._IsCancel)
                {
                    //string billid = dgvBills.CurrentRow.Cells["Billid"].Value.ToString();
                    //string status = dgvBills.CurrentRow.Cells["STATUS"].Value.ToString();
                    //PurchaseBillEntry purchasebillentry = new PurchaseBillEntry(billid, status);
                    //purchasebillentry.CancelBill(status);
                    //GenerateBillingList();
                }
                else
                {
                    MessageBox.Show("permission denied", "Permission", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    GenerateBillingList();
                }
            }
        }
        private void Cmb_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmb = (ComboBox)sender;

            if (cmb.Text == "Bill Payment")
            {
                string      billid            = dgvBills.CurrentRow.Cells["Billid"].Value.ToString();
                string      supplier          = dgvBills.CurrentRow.Cells["Supplier"].Value.ToString();
                BillPayment frmReceiptVoucher = new BillPayment(BillPayment._FromWhere.Purchase_Bill, billid, supplier);
                frmReceiptVoucher.OnClose += GenerateBillingList;
                frmReceiptVoucher.ShowDialog();
            }
            else if (cmb.Text == "Debit Note")
            {
                string          billid         = dgvBills.CurrentRow.Cells["Billid"].Value.ToString();
                CreditNoteIssue creditnoteissu = new CreditNoteIssue(CreditNoteIssue._NoteType.Debit_Note, billid);
                creditnoteissu.OnClose += GenerateBillingList;
                creditnoteissu.ShowDialog();
            }
            else if (cmb.Text == "Cancel")
            {
                if (UserTools._IsCancel)
                {
                    string            billid            = dgvBills.CurrentRow.Cells["Billid"].Value.ToString();
                    string            status            = dgvBills.CurrentRow.Cells["STATUS"].Value.ToString();
                    PurchaseBillEntry purchasebillentry = new PurchaseBillEntry(billid, status);
                    purchasebillentry.CancelBill(status);
                    GenerateBillingList();
                }
                else
                {
                    MessageBox.Show("Cancel permission denied by Admin.", "Permission", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    GenerateBillingList();
                }
            }
        }