Example #1
0
        private void InvoicesForm_Load(object sender, EventArgs e)
        {
            mDC = Utilities.GetDC();
            GridBuilder builder;

            builder = new GridBuilder(grdInvoices);
            builder.AddIntegerColumn("InvoiceId", "ID", 4, true);
            mColIdxVendorName = builder.AddColumn(new GridSpecializedTextBoxColumn <GridVendorSearchEditCell>(), "VendorName", "Vendor Name", 20, false).DisplayIndex;
            builder.AddTextBoxColumn("PONumber", "PO Number", 7, false);
            mColIdxInvoiceNumber = builder.AddTextBoxColumn("InvoiceNumber", "Invoice Number", 7, false).DisplayIndex;
            builder.AddColumn(new GridDateColumn(), "InvoiceDate", "Invoice Date", 6, false);
            builder.AddTextBoxColumn("Terms", "Terms", 5, false);
            builder.AddColumn(new GridDateColumn(), "DueDate", "Due Date", 6, false);
            builder.AddCurrencyColumn("Amount", "Amount", 6, false);
            builder.AddCheckBoxColumn("IsCredit", "Is Credit", 5, false);
            builder.AddCheckBoxColumn("Exported", "Exported", 5, false);
            mColIdxMoreButton = builder.AddButtonColumn("Scanning", "More...", 5).DisplayIndex;
            builder.AddColumn(new GridDateColumn(), "CreateDate", "Create Date", 6, false);

            cboQueryMethod.Items.Add(new QueryInvoicesOption(QueryInvoicesByCreateDate, "By create date"));
            cboQueryMethod.Items.Add(new QueryInvoicesOption(QueryInvoicesByDueDate, "By due date"));
            cboQueryMethod.Items.Add(new QueryInvoicesOption(QueryInvoicesByVendorInvNum, "By vendor & invoice number"));
            cboQueryMethod.SelectedIndex = 0;
            QueryInvoicesOption option = (QueryInvoicesOption)cboQueryMethod.SelectedItem;

            ShowInvoices(option.Query());
        }
Example #2
0
 private void btnShowInvoices_Click(object sender, EventArgs e)
 {
     if (mHelper.CurrentRowIsValid())
     {
         mHelper.SaveWork();
         QueryInvoicesOption option = (QueryInvoicesOption)cboQueryMethod.SelectedItem;
         var query = option.Query();
         ShowInvoices(query);
     }
 }