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()); }
static public void LoadVendors() { using (InvoiceDC dc = GetDC()) { if (dc != null) { var vendors = from vendor in dc.Vendors orderby vendor.VendorName select vendor; AllVendors = new List <Vendor>(); AllVendorNames = new List <string>(); foreach (var vendor in vendors) { AllVendors.Add(vendor); AllVendorNames.Add(vendor.VendorName); } } } }
private void VendorForm_Load(object sender, EventArgs e) { mDC = Utilities.GetDC(); GridBuilder builder; builder = new GridBuilder(grdVendors); builder.AddIntegerColumn("VendorId", "ID", 3, true); builder.AddTextBoxColumn("VendorName", "Vendor Name", 16, false); builder.AddCheckBoxColumn("ScanInvoices", "Scan Invoices", 5, false); builder.AddTextBoxColumn("CategoryName", "Category", 12, false); builder.AddTextBoxColumn("InvNumFormat", "Invoice# Format", 10, false); builder.AddTextBoxColumn("Terms", "Terms", 6, false); builder.AddTextBoxColumn("Memo", "Memo", 20, false); var vendors = from vendor in mDC.Vendors orderby vendor.VendorName select vendor; grdVendors.DataSource = vendors; }