public OrdersForm(string CustID) { // // Required for Windows Form Designer support // InitializeComponent(); _CustID = CustID; // create an instance of the orders Web Service // and fetch the data OrdersService.RemotingOrders wsOrders = new OrdersService.RemotingOrders(); _dsOrders = wsOrders.Orders(CustID); _dsLookups = wsOrders.Lookups(); BindData(); // set some default values for new rows _dsOrders.Tables["Orders"].Columns["CustomerID"].DefaultValue = _CustID; _dsOrders.Tables["Orders"].Columns["ShipVia"].DefaultValue = _dsLookups.Tables["Shippers"].Rows[0]["ShipperID"]; // set the position for the first row // this ensures that the buttons/textboxes are enabled or disabled according to the data OrdersRowPosition_Changed(this.BindingContext[_dsOrders, "Orders"], (EventArgs)null); }
// the errors form has been closed so refresh the data void ErrorFormClosed(Object sender, EventArgs e) { OrdersService.RemotingOrders wsOrders = new OrdersService.RemotingOrders(); DataSet dsOrders = wsOrders.Orders(_CustID); _dsOrders.Merge(dsOrders, false); _dsOrders.AcceptChanges(); }