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

            if (cmb.Text == "Receive Payment")
            {
                string         billNo            = dgvBills.CurrentRow.Cells["InvoiceNo"].Value.ToString();
                string         customer          = dgvBills.CurrentRow.Cells["Buyer"].Value.ToString();
                ReceiptVoucher frmReceiptVoucher = new ReceiptVoucher(billNo, customer);
                frmReceiptVoucher.OnClose += GenerateBillingList;
                frmReceiptVoucher.ShowDialog();
            }
            else if (cmb.Text == "Original for Recipient")
            {
                string billNo    = dgvBills.CurrentRow.Cells["InvoiceNo"].Value.ToString();
                string suppliers = dgvBills.CurrentRow.Cells["Buyer"].Value.ToString();
                InvoiceReportViewer frmInvoiceReportViewer = new InvoiceReportViewer(InvoiceReportViewer._InvoiceCopy.Original, billNo);
                frmInvoiceReportViewer.OnClose += GenerateBillingList;
                frmInvoiceReportViewer.ShowDialog();
            }
            else if (cmb.Text == "Duplicate for Transporter")
            {
                string billNo    = dgvBills.CurrentRow.Cells["InvoiceNo"].Value.ToString();
                string suppliers = dgvBills.CurrentRow.Cells["Buyer"].Value.ToString();
                InvoiceReportViewer frmInvoiceReportViewer = new InvoiceReportViewer(InvoiceReportViewer._InvoiceCopy.Duplicate, billNo);
                frmInvoiceReportViewer.OnClose += GenerateBillingList;
                frmInvoiceReportViewer.ShowDialog();
            }
            else if (cmb.Text == "Triplicate for Supplier")
            {
                string billNo    = dgvBills.CurrentRow.Cells["InvoiceNo"].Value.ToString();
                string suppliers = dgvBills.CurrentRow.Cells["Buyer"].Value.ToString();
                InvoiceReportViewer frmInvoiceReportViewer = new InvoiceReportViewer(InvoiceReportViewer._InvoiceCopy.Triplicate, billNo);
                frmInvoiceReportViewer.OnClose += GenerateBillingList;
                frmInvoiceReportViewer.ShowDialog();
            }
            else if (cmb.Text == "Credit Note")
            {
                string          invoiceNo      = dgvBills.CurrentRow.Cells["InvoiceNo"].Value.ToString();
                CreditNoteIssue creditnoteissu = new CreditNoteIssue(CreditNoteIssue._NoteType.Credit_Note, invoiceNo);
                creditnoteissu.OnClose += GenerateBillingList;
                creditnoteissu.ShowDialog();
            }
            else if (cmb.Text == "Cancel")
            {
                if (UserTools._IsCancel)
                {
                    string         invoiceno     = dgvBills.CurrentRow.Cells["invoiceno"].Value.ToString();
                    string         status        = dgvBills.CurrentRow.Cells["STATUS"].Value.ToString();
                    Invoice_Direct invoicedirect = new Invoice_Direct(invoiceno, status, "");
                    invoicedirect.InvoiceCancel();
                    GenerateBillingList();
                }
                else
                {
                    MessageBox.Show("Cancel permission denied by Admin", "Permission", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    GenerateBillingList();
                }
            }
        }
        private void dgvadvanceReceipt_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
            {
                if (UserTools._IsEdit)
                {
                    //string status = dgvNote.Rows[e.RowIndex].Cells["Status"].Value.ToString();
                    string noteid           = dgvNote.Rows[e.RowIndex].Cells["noteid"].Value.ToString();
                    double totAmount        = double.Parse(dgvNote.Rows[e.RowIndex].Cells["amount"].Value.ToString());
                    double willadjustamount = double.Parse(dgvNote.Rows[e.RowIndex].Cells["willadjustamount"].Value.ToString());
                    string status           = "Close";
                    if (willadjustamount == totAmount)
                    {
                        status = "Open";
                    }

                    CreditNoteIssue creditnote = new CreditNoteIssue(noteid, status, "");
                    creditnote.OnClose += GenerateNoteList;
                    creditnote.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Permission Denied", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
        }
 private void dgvadvanceReceipt_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0 && dgvNote.Columns[e.ColumnIndex].Name == "Action")
     {
         string          advanceNoteno = dgvNote.CurrentRow.Cells["ReceiptNo"].Value.ToString();
         CreditNoteIssue crnoteissu    = new CreditNoteIssue(CreditNoteIssue._NoteType.Refund_Voucher, advanceNoteno);
         crnoteissu.OnClose += GenerateNoteList;
         crnoteissu.ShowDialog();
     }
 }
        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();
                }
            }
        }