I create a business object for invoices with 2 tables: Invoice (default) and InvoiceList. I also have a business object for stores. My form has a combo box for stores, which populates correctly. The combo box for invoices uses the table invoicelist as its binding source. It should have the invoices for all the stores at start up but it is not loading at all.
What I want to happen is that when the user selects a store, only the invoices related to that store will appear on the pull down. Currently, when I select a store, the hourglass comes up and the program locks up. I have indexes set on the VFP tables. I set a break point in the SelectedIndexChanged method but the debugger never reaches that.
The properties for the invoice drop down list are set as follows:
BindingSource Invoice
BindingSourceDisplayMember InvoiceList.InvoiceNo
BindingSourceValueMember InvoiceList.InvoiceNo
I have done something similar in ASP.Net that worked correctly. Any ideas what the problem might be or where to look next?
Here is the code.
using OakLeaf.MM.Main;
using OakLeaf.MM.Main.Windows.Forms;
using ESK.DataUploadSystem.Business;
namespace ESK.InvoiceUploadSystem.Windows
{
public partial class ViewInvoices : mmBusinessForm
{
private Stores oStores;
private Invoice oInvoice;
private DataSet dsInvoices;
public ViewInvoices()
{
this.oStores = (Stores)this.RegisterBizObj(new Stores());
this.oInvoice = (Invoice)this.RegisterPrimaryBizObj(new Invoice());
oStores.GetAllStores();
oInvoice.GetUniqueInvoices("*");
InitializeComponent();
}
private void ddlStoreNo_SelectedIndexChanged(object sender, EventArgs e)
{
oInvoice.GetUniqueInvoices(this.ddlStoreNo.Text.ToString());
this.ddlInvoiceNo.Refresh();
}
private void ddlInvoiceNo_SelectedIndexChanged(object sender, EventArgs e)
{
oInvoice.GetInvoiceByInvoiceNo(this.ddlInvoiceNo.Text.ToString());
this.grdInvoice.Refresh();
}
}
}
Thanks.
Linda Harmes
HiBit Technologies, Inc.