private void addSummaryRow(string id, string displayNumber, TrackingDS.CartonDetailTableRow carton, TrackingDS summary) { //Create a summary row for the specified carton TrackingDS.CartonSummaryTableRow record = summary.CartonSummaryTable.NewCartonSummaryTableRow(); record.ID = id; record.DisplayNumber = displayNumber; record.CTNNumber = carton.CTN.Trim(); record.LBLNumber = carton.LBL.ToString().Trim(); record.CBOL = carton.IsCBOLNull() ? "" : carton.CBOL.Trim(); if (carton.SCNTP == 3 && !carton.IsSCDNull() && carton.SCD.Trim().Length > 0) { record.DateTime = carton.SCD.Trim() + " " + carton.SCTM.Trim(); if (carton.T.Trim().Length == 18 && carton.T.Trim().Substring(0, 2).ToLower() == "1z") { record.Status = "Rerouted: Tracking # " + carton.T.Trim(); } else { switch (carton.OM) { case "M": record.Status = carton.ISMN == 1 ? "Delivered (Scan N/A - Manual Entry)" : "Delivered"; break; case "S": record.Status = "Short At Delivery"; break; case "O": record.Status = "Over At Delivery"; break; case "A": record.Status = "MisRoute At Delivery"; break; } } record.Location = carton.SCT.Trim() + "/" + carton.SST.Trim(); } else { if (carton.SCNTP == 3 && !carton.IsACTSDDNull() && carton.ACTSDD.Trim().Length > 0) { record.DateTime = carton.ACTSDD.Trim(); record.Status = "Out For Delivery"; record.Location = carton.SCT.Trim() + "/" + carton.SST.Trim(); } else { if (!carton.IsAARDNull() && carton.AARD.Trim().Length > 0) { record.DateTime = carton.AARD.Trim() + " " + carton.AART.Trim(); if (carton.SCNTP == 1) { switch (carton.OM) { case "M": record.Status = "Scanned At Delivery Terminal"; break; case "S": record.Status = "Short At Delivery Terminal"; break; case "O": record.Status = "Over At Delivery Terminal"; break; case "A": record.Status = "MisRoute At Delivery Terminal"; break; } } else { record.Status = "Arrived At Delivery Terminal"; } if (!carton.IsSAGCTNull()) { record.Location = carton.SAGCT.Trim() + "/" + (carton.IsSAGSTNull() ? "" : carton.SAGST.Trim()); } else { record.Location = (carton.IsAGCTNull() ? "" : carton.AGCT.Trim()) + "/" + (carton.IsAGSTNull() ? "" : carton.AGST.Trim()); } } else { if (!carton.IsADPDNull() && carton.ADPD.Trim().Length > 0) { record.DateTime = carton.ADPD.Trim() + " " + carton.ADPT.Trim(); record.Status = "Departed Sort Facility"; record.Location = carton.SRTLOC.Trim(); } else { if (!carton.IsASFDNull() && carton.ASFD.Trim().Length > 0) { record.DateTime = carton.ASFD.Trim() + " " + carton.ASFT.Trim(); record.Status = "Arrived At Sort Facility"; record.Location = carton.SRTLOC.Trim(); } } } } } summary.CartonSummaryTable.AddCartonSummaryTableRow(record); }
private void showCarton(TrackingDS.CartonDetailTableRow carton) { //Display details for the specified carton this.CartonNumberValue.Text = carton.CTN.Trim(); this.ClientNameValue.Text = carton.CLNM.Trim(); string storeAddLine = carton.SA1.Trim(); if (!carton.IsSA2Null() && carton.SA2.Trim().Length > 0) { storeAddLine += ", " + carton.SA2.Trim() + ", "; } this.StoreNum.Text = (Session["SubStore"] != null ? Session["SubStore"].ToString() : carton.S.ToString().PadLeft(5, '0')); this.StoreName.Text = ": " + carton.SNM.Trim() + ", " + storeAddLine + carton.SCT.Trim() + ", " + carton.SST.Trim() + " " + carton.SZ.ToString(); this.VendorNameValue.Text = carton.IsVNMNull() ? "" : carton.VNM.Trim(); this.PickupDateValue.Text = carton.IsPUDNull() ? "" : carton.PUD.Trim(); //this.CarrierValue.Text = carton["CarrierName"].ToString(); this.BOLValue.Text = carton.IsBLNull() ? "" : carton.BL.ToString(); this.TLValue.Text = carton.IsTLNull() ? "" : carton.TL.Trim(); this.LabelSeqValue.Text = carton.LBL.ToString(); this.PONumberValue.Text = carton.IsPONull() ? "" : carton.PO.Trim(); this.WeightValue.Text = carton.IsWTNull() ? "" : carton.WT.ToString(); this.ShipmentNumber.Text = carton.IsShipmentNumberNull() ? "" : carton.ShipmentNumber.Trim(); this.DeliveryValue.Text = carton.IsACTSDDNull() ? "" : carton.ACTSDD.Trim(); //Sort facility this.TDSDate.Text = this.TDSStatus.Text = this.TDSLocation.Text = ""; if (!carton.IsASFDNull() && carton.ASFD.Trim().Length > 0) { this.TDSDate.Text = carton.ASFD.Trim() + " " + carton.ASFT.Trim(); this.TDSStatus.Text = "Arrived At Sort Facility"; this.TDSLocation.Text = carton.SRTLOC.Trim(); } this.DepartureDate.Text = this.DepartureStatus.Text = this.DepartureLocation.Text = ""; if (!carton.IsADPDNull() && carton.ADPD.Trim().Length > 0) { this.DepartureDate.Text = carton.ADPD.Trim() + " " + carton.ADPT.Trim(); this.DepartureStatus.Text = "Departed Sort Facility"; this.DepartureLocation.Text = carton.IsSHPRNull() ? "" : carton.SHPR.Trim(); } //Delivery terminal //1. BOL confirmed (trailer arrived in AS400): SCNTP=0, AARD!=null; //2. Agent scan: SCNTP=1, AARD!=null, OM=Over(O)||Short(S)||MisRoute(A)||Match(M) this.ArrivalDate.Text = this.ArrivalStatus.Text = this.ArrivalLocation.Text = ""; if (!carton.IsAARDNull() && carton.AARD.Trim().Length > 0) { this.ArrivalDate.Text = carton.AARD.Trim() + " " + carton.AART.Trim(); if (carton.SCNTP == 1) { switch (carton.OM) { case "M": this.ArrivalStatus.Text = "Scanned At Delivery Terminal"; break; case "S": this.ArrivalStatus.Text = "Short At Delivery Terminal"; break; case "O": this.ArrivalStatus.Text = "Over At Delivery Terminal"; break; case "A": this.ArrivalStatus.Text = "MisRoute At Delivery Terminal"; break; } } else { this.ArrivalStatus.Text = "Arrived At Delivery Terminal"; } if (!carton.IsSAGCTNull() && carton.SAGCT.Trim().Length > 0) { this.ArrivalLocation.Text = carton.SAGCT.Trim() + "/" + carton.SAGST.Trim(); } else { this.ArrivalLocation.Text = carton.IsAGCTNull() ? "" : carton.AGCT.Trim() + "/" + carton.AGST.Trim(); } } //Store delivery this.StoreDeliveryDate.Text = this.StoreDeliveryStatus.Text = this.StoreDeliveryLocation.Text = ""; if (carton.SCNTP == 3 && !carton.IsACTSDDNull() && carton.ACTSDD.Trim().Length > 0) { this.StoreDeliveryDate.Text = carton.ACTSDD.Trim();; this.StoreDeliveryStatus.Text = "Out For Delivery"; this.StoreDeliveryLocation.Text = carton.SCT.Trim() + "/" + carton.SST.Trim(); } //POD this.PODDate.Text = this.PODStatus.Text = this.PODLocation.Text = ""; this.lnkPODReq.Enabled = false; this.lnkPODReq.ToolTip = "POD only available after carton delivery"; if (carton.SCNTP == 3 && !carton.IsSCDNull() && carton.SCD.Trim().Length > 0) { //Check for mis-routed carton- podScan is estimated by UPS (or other agent) this.PODDate.Text = carton.SCD.Trim() + " " + carton.SCTM.Trim(); if (carton.T.Trim().Length == 18 && carton.T.Trim().Substring(0, 2).ToLower() == "1z") { this.PODStatus.Text = "Rerouted: Tracking # " + carton.T.Trim(); } else { switch (carton.OM) { case "M": this.PODStatus.Text = carton.ISMN == 1 ? "Delivered (Scan N/A - Manual Entry)" : "Delivered"; break; case "S": this.PODStatus.Text = "Short At Delivery"; break; case "O": this.PODStatus.Text = "Over At Delivery"; break; case "A": this.PODStatus.Text = "MisRoute At Delivery"; break; } } this.PODLocation.Text = carton.SCT.Trim() + "/" + carton.SST.Trim(); //POD Request link available if carton delivered this.lnkPODReq.Enabled = true; MembershipServices membership = new MembershipServices(); if (membership.IsAdmin || membership.IsArgix || membership.IsPODMember) { this.lnkPODReq.ToolTip = "Display POD image (if available; otherwise POD request will be submitted)"; } else { this.lnkPODReq.ToolTip = "Submit a POD request"; } } this.cartonPanel.Visible = true; }