public VendorDS GetVendors(string clientNumber, string clientTerminal) { //Get a list of vendors VendorDS vendors = null; try { vendors = new VendorDS(); DataSet ds = FillDataset(USP_VENDORS, TBL_VENDORS, new object[] { clientNumber, clientTerminal }); if (ds.Tables[TBL_VENDORS] != null && ds.Tables[TBL_VENDORS].Rows.Count > 0) { VendorDS _vendors = new VendorDS(); _vendors.Merge(ds); for (int i = 0; i < _vendors.VendorTable.Rows.Count; i++) { _vendors.VendorTable.Rows[i]["VendorSummary"] = (!_vendors.VendorTable.Rows[i].IsNull("VendorNumber") ? _vendors.VendorTable.Rows[i]["VendorNumber"].ToString() : " ") + " - " + (!_vendors.VendorTable.Rows[i].IsNull("VendorName") ? _vendors.VendorTable.Rows[i]["VendorName"].ToString().Trim() : ""); } vendors.Merge(_vendors.VendorTable.Select("", "VendorNumber ASC")); vendors.AcceptChanges(); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating vendor list.", ex); } return(vendors); }
public VendorDS GetParentVendors(string clientNumber, string clientTerminal) { //Get a list of parent vendors System.Diagnostics.Debug.WriteLine("GetParentVendors"); VendorDS vendors = null; try { vendors = new VendorDS(); VendorDS ds = GetVendors(clientNumber, clientTerminal); if (clientNumber != null && ds.VendorTable.Rows.Count > 0) { vendors.Merge(ds.VendorTable.Select("VendorParentNumber = ''")); vendors.AcceptChanges(); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating vendor list.", ex); } return(vendors); }
public VendorDS GetVendorsList(string clientNumber, string clientTerminal) { //Get a list of vendors VendorDS vendors = null; try { vendors = new VendorDS(); DataSet ds = FillDataset(USP_VENDORS, TBL_VENDORS, new object[] { clientNumber, clientTerminal }); if (ds.Tables[TBL_VENDORS] != null && ds.Tables[TBL_VENDORS].Rows.Count > 0) { VendorDS _vendors = new VendorDS(); _vendors.Merge(ds); vendors.Merge(_vendors.VendorTable.Select("", "VendorName ASC")); vendors.AcceptChanges(); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating vendor list.", ex); } return(vendors); }