public static DestinationRouting CreateDestinationRoutingMultiManifestX(string clientNumber, string clientDivision, string vendorNumber, string terminalLocation, string TDSID, string inputString, string zoneCode, string cartonNumber, bool checkForDuplicates) { // DestinationRouting destinationRouting = null; try { //The freight type of the shipment determines whether a regular or returns profile is needed DataSet ds = Mediator.FillDataset(USP_DEST_ROUTING_MULTIMANIFESTX, TBL_DESTINATION_ROUTING, new object[] { clientNumber, clientDivision, vendorNumber, terminalLocation, TDSID, inputString, cartonNumber, (checkForDuplicates?1:0), zoneCode }); if (ds != null && ds.Tables[TBL_DESTINATION_ROUTING].Rows.Count > 0) { //Create a sort profile that specifies freight type, sort type, and inbound label DestinationRoutingDS destinationRoutingDS = new DestinationRoutingDS(); destinationRoutingDS.Merge(ds); destinationRouting = new DestinationRouting(destinationRoutingDS.DestinationRoutingTable[0]); } else { throw new ApplicationException("Destination & routing information not found for input string" + inputString + "."); } } catch (DataAccessException ex) { if (ex.InnerException != null) { throw ex.InnerException; } else { throw ex; } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating destination and routing.", ex); } return(destinationRouting); }
public DataSet ToDataSet() { //Return a dataset containing values for this object DestinationRoutingDS destinationRoutingDS = null; try { destinationRoutingDS = new DestinationRoutingDS(); DestinationRoutingDS.DestinationRoutingTableRow destinationrouting = destinationRoutingDS.DestinationRoutingTable.NewDestinationRoutingTableRow(); if (this._clientnumber.Length > 0) { destinationrouting.clientNumber = this._clientnumber; } if (this._destinationname.Length > 0) { destinationrouting.destinationName = this._destinationname; } if (this._destinationnumber > 0) { destinationrouting.destinationNumber = this._destinationnumber; } if (this._destinationphone.Length > 0) { destinationrouting.destinationPhone = this._destinationphone; } if (this._destinationaddressline1.Length > 0) { destinationrouting.destinationAddressLine1 = this._destinationaddressline1; } if (this._destinationaddressline2.Length > 0) { destinationrouting.destinationAddressLine2 = this._destinationaddressline2; } if (this._destinationaddresscity.Length > 0) { destinationrouting.destinationAddressCity = this._destinationaddresscity; } if (this._destinationaddressstate.Length > 0) { destinationrouting.destinationAddressState = this._destinationaddressstate; } if (this._destinationaddresszip.Length > 0) { destinationrouting.destinationAddressZip = this._destinationaddresszip; } if (this._destinationaltroute.Length > 0) { destinationrouting.destinationAltRoute = this._destinationaltroute; } if (this._destinationroute.Length > 0) { destinationrouting.destinationRoute = this._destinationroute; } if (this._destinationuserlabeldata.Length > 0) { destinationrouting.destinationUserLabelData = this._destinationuserlabeldata; } if (this._destinationstatus.Length > 0) { destinationrouting.destinationStatus = this._destinationstatus; } if (this._destinationopendate > DateTime.MinValue) { destinationrouting.destinationOpenDate = this._destinationopendate; } if (this._locallane.Length > 0) { destinationrouting.localLane = this._locallane; } if (this._osursacode.Length > 0) { destinationrouting.osURSACode = this._osursacode; } if (this._ossequence > 0) { destinationrouting.OSSequence = this._ossequence; } if (this._zonecode.Length > 0) { destinationrouting.zoneCode = this._zonecode; } if (this._zonetype.Length > 0) { destinationrouting.zoneCode = this._zonetype; } if (this._outboundlabeltype.Length > 0) { destinationrouting.outboundLabelType = this._outboundlabeltype; } destinationrouting.zoneLane = this._zonelane; destinationrouting.zoneLaneSmallSort = this._zonelanesmallsort; if (this._zonetl.Length > 0) { destinationrouting.zoneTL = this._zonetl; } if (this._zonetlDate.CompareTo(DateTime.MinValue) > 0) { destinationrouting.TLDate = this._zonetlDate; } if (this._zonetlCloseNumber.Length > 0) { destinationrouting.CloseNumber = this._zonetlCloseNumber; } if (this._clientnumber.Length > 0) { destinationrouting.ShiftDate = this._shiftdate; } destinationrouting.ShiftNumber = this._shiftnumber; destinationRoutingDS.DestinationRoutingTable.AddDestinationRoutingTableRow(destinationrouting); } catch (Exception) { } return(destinationRoutingDS); }