public static CarrierDS GetTrailerOwners() { //Get a list of trailer types CarrierDS owners = new CarrierDS(); try { DataSet ds = Mediator.FillDataset("", "CarrierListTable", null); if (ds != null) { owners.Merge(ds.Tables["CarrierListTable"].Select("", "CarrierName", DataViewRowState.CurrentRows)); } } catch (Exception ex) { throw ex; } return(owners); }
public static CarrierDS ViewCarriers() { //Get a list of carriers CarrierDS carriers = new CarrierDS(); try { DataSet ds = Mediator.FillDataset("uspEnterpriseCarrierGetList", "CarrierViewTable", null); if (ds != null) { carriers.Merge(ds.Tables["CarrierViewTable"].Select("", "CarrierName", DataViewRowState.CurrentRows)); } } catch (Exception ex) { throw ex; } return(carriers); }
public static CarrierDS GetCarrier(int carrierID) { //Get a new or existing carrier CarrierDS carrier = new CarrierDS(); try { if (carrierID == 0) { //New CarrierDS.CarrierDetailTableRow row = carrier.CarrierDetailTable.NewCarrierDetailTableRow(); row.CarrierID = carrierID; row.Number = ""; row.CarrierName = ""; row.Phone = ""; row.Extension = ""; row.AddressLine1 = ""; row.AddressLine2 = ""; row.City = ""; row.StateOrProvince = "NJ"; row.PostalCode = ""; row.CountryID = 1; row.ContactName = ""; row.Fax = ""; row.Email = ""; row.ControlDrivers = false; row.ControlTrailers = false; row.SCAC = ""; row.IsActive = true; row.LastUpdated = DateTime.Now; row.UserID = System.Environment.UserName; row.RowVersion = ""; carrier.CarrierDetailTable.AddCarrierDetailTableRow(row); } else { //Existing DataSet ds = Mediator.FillDataset("uspEnterpriseCarrierGet", "CarrierDetailTable", new object[] { carrierID }); if (ds != null) { carrier.Merge(ds, true, MissingSchemaAction.Ignore); } } } catch (Exception ex) { throw ex; } return(carrier); }