Ejemplo n.º 1
0
    public bool SendPODRequestConfirm(MembershipUser user, TrackingDS.CartonDetailTableRow carton, string substore)
    {
        //
        bool        retValue = false;
        MailMessage email    = new MailMessage(this.mEmailFrom, user.Email);

        email.Subject      = "POD Request Confirmation";
        email.BodyEncoding = System.Text.Encoding.UTF8;
        email.IsBodyHtml   = true;
        string body = getHTMLBody(HostingEnvironment.ApplicationPhysicalPath + HTML_POD_REQCONFIRM);

        body       = body.Replace("*user*", user.UserName);
        body       = body.Replace("*email*", user.Email);
        body       = body.Replace("*store*", substore.Length > 0 ? substore : carton.S.ToString());
        body       = body.Replace("*storename*", carton.SNM.Trim());
        body       = body.Replace("*carton*", carton.CTN.Trim());
        body       = body.Replace("*client*", carton.CL.Trim() + "-" + carton.CLNM.Trim());
        body       = body.Replace("*vendor*", carton.V.Trim() + "-" + carton.VNM.Trim());
        body       = body.Replace("*pickupdate*", carton.PUD.Trim());
        body       = body.Replace("*scheduleddelivery*", carton.SCD.Trim());
        body       = body.Replace("*shipment*", carton.VK.Trim());
        body       = body.Replace("*bol*", carton.BL.ToString());
        body       = body.Replace("*tl*", carton.TL.Trim());
        body       = body.Replace("*label*", carton.LBL.ToString());
        body       = body.Replace("*po*", carton.PO.Trim());
        body       = body.Replace("*weight*", carton.WT.ToString());
        email.Body = body;
        if (email.Body.Length > 0)
        {
            SmtpClient smtpClient = new SmtpClient(this.mSMTPServer);
            smtpClient.Send(email);
            retValue = true;
        }
        return(retValue);
    }
Ejemplo n.º 2
0
    //Members

    //Interface
    protected void Page_Load(object sender, EventArgs e)
    {
        //Event handler for form load event
        if (!Page.IsPostBack)
        {
            //Prepopulate from carton detail
            string cartonNumber = Request.QueryString["ID"] == null ? "" : Request.QueryString["ID"].ToString();
            if (cartonNumber.Length > 0)
            {
                TrackingDS summary = (TrackingDS)Session["TrackingSummary"];
                if (summary != null && summary.CartonSummaryTable.Rows.Count > 0)
                {
                    //Find the summary info for cartonNumber
                    TrackingDS.CartonSummaryTableRow summaryRow = summary.CartonSummaryTable.FindByID(cartonNumber);
                    if (summaryRow != null)
                    {
                        //Get all detail rows for this carton
                        string     filter     = "[LBL]=" + summaryRow.LBLNumber;
                        TrackingDS cartons    = (TrackingDS)Session["TrackingDetail"];
                        DataRow[]  detailRows = cartons.CartonDetailTable.Select(filter);
                        if (detailRows != null && detailRows.Length > 0)
                        {
                            //Show tracking detail for the carton
                            TrackingDS.CartonDetailTableRow carton = (TrackingDS.CartonDetailTableRow)detailRows[0];
                            this.lblName.Text     = "ATTN: Claims Department";
                            this.lblCarrier.Text  = "Argix Direct, Inc.";
                            this.lblDate.Text     = DateTime.Today.ToShortDateString();
                            this.lblAddress.Text  = "100 Middlesex Center Blvd, Jamesburg, NJ 08831";
                            this.lblClaimant.Text = carton.CLNM.Trim(); //Client name
                            if (carton.CTN.Trim().Length > 0)
                            {
                                this.lblDescription.Text = "Carton# " + carton.CTN.Trim();    //Carton#
                            }
                            else
                            {
                                this.lblDescription.Text = "Label# " + carton.LBL.ToString().Trim();                          //LabelSeq#
                            }
                            this.lblConsignor.Text  = carton.CLNM.Trim();                                                     //Client name, city, state
                            this.lblShipFrom.Text   = carton.VNM.Trim() + " " + carton.VCT.Trim() + ", " + carton.VST.Trim(); //Vendor name, city, state
                            this.lblFinalDest.Text  = carton.SNM.Trim() + " " + carton.SCT.Trim() + ", " + carton.SST.Trim(); //Store name, city, state
                            this.lblRoutedVia.Text  = "Argix Direct, Inc.";
                            this.lblBOLBy.Text      = carton.VNM.Trim();                                                      //Vendor name
                            this.lblBOLDate.Text    = carton.PUD.Trim();                                                      //Pickup date
                            this.lblPRONum.Text     = carton.VK.Trim();                                                       //PRO#
                            this.lblTrailerNum.Text = "";                                                                     //Vendor trailer#
                            this.lblConsignee.Text  = carton.SNM.Trim() + " " + carton.SCT.Trim() + ", " + carton.SST.Trim(); //Store name, city, state
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 3
0
    public bool SendPODRequest(MembershipUser user, TrackingDS.CartonDetailTableRow carton, string substore)
    {
        //
        bool        retValue = false;
        MailMessage email    = new MailMessage(this.mEmailFrom, this.mEmailPODReq);

        email.Subject      = "Argix Direct POD Request";
        email.BodyEncoding = System.Text.Encoding.UTF8;
        email.IsBodyHtml   = true;
        string body = getHTMLBody(HostingEnvironment.ApplicationPhysicalPath + HTML_POD_REQUEST);

        body = body.Replace("*carton*", carton.CTN.Trim());
        body = body.Replace("*user*", user.UserName);
        body = body.Replace("*email*", user.Email);
        body = body.Replace("*client*", carton.CL.Trim() + "-" + carton.CLNM.Trim());
        body = body.Replace("*store*", carton.S.ToString());
        body = body.Replace("*substore*", substore);
        body = body.Replace("*storeaddress*", carton.SA1.Trim() + " " + carton.SA2.Trim() + " " + carton.SCT.Trim() + ", " + carton.SST.Trim() + " " + carton.SZ.ToString());
        body = body.Replace("*pickupdate*", carton.PUD.Trim());
        body = body.Replace("*scheduleddelivery*", carton.SCD.Trim());
        string podScan = "";

        if (Convert.ToInt32(carton.SCNTP) == 3)
        {
            if (carton.SCD.Trim().Length > 0)
            {
                podScan = carton.SCD.Trim() + " " + carton.SCTM.Trim();
            }
        }
        body       = body.Replace("*actualdelivery*", podScan);
        body       = body.Replace("*tl*", carton.TL.Trim());
        body       = body.Replace("*cbol*", carton.CBOL.Trim());
        body       = body.Replace("*po*", carton.PO.Trim());
        body       = body.Replace("*pro*", "");
        body       = body.Replace("*shipment*", carton.VK.Trim());
        body       = body.Replace("*bol*", carton.BL.ToString());
        body       = body.Replace("*weight*", carton.WT.ToString());
        body       = body.Replace("*label*", carton.LBL.ToString());
        email.Body = body;
        if (email.Body.Length > 0)
        {
            SmtpClient smtpClient = new SmtpClient(this.mSMTPServer);
            smtpClient.Send(email);
            retValue = true;
        }
        return(retValue);
    }
Ejemplo n.º 4
0
    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);
    }
Ejemplo n.º 5
0
    protected void OnPODRequest(object sender, EventArgs e)
    {
        //Send request to Customer Service and confirmation to user
        TrackingDS.CartonDetailTableRow carton = null;
        string             cbol       = "";
        bool               imageFound = false;
        MembershipServices membership = new MembershipServices();
        TrackingDS         summary    = (TrackingDS)Session["TrackingSummary"];

        TrackingDS.CartonSummaryTableRow summaryRow = summary.CartonSummaryTable.FindByID(this.CartonNumberValue.Text);
        if (summaryRow == null)
        {
            summaryRow = summary.CartonSummaryTable.FindByID(this.LabelSeqValue.Text);
        }
        if (summaryRow != null)
        {
            //Get all detail rows for this carton
            string     filter     = "[LBL]=" + summaryRow.LBLNumber;
            TrackingDS cartons    = (TrackingDS)Session["TrackingDetail"];
            DataRow[]  detailRows = cartons.CartonDetailTable.Select(filter);
            if (detailRows != null && detailRows.Length > 0)
            {
                //Get carton data
                carton = (TrackingDS.CartonDetailTableRow)detailRows[0];
                if (membership.IsAdmin || membership.IsArgix || membership.IsPODMember)
                {
                    //Check for a POD image for this CBOL
                    cbol = carton.IsCBOLNull() ? "" : carton.CBOL.Trim();
                    if (cbol.Length > 0)
                    {
                        string cl  = carton.CL.Trim().PadLeft(3, '0');
                        string div = "%";
                        string st  = carton.S.ToString().PadLeft(5, '0');
                        Imaging.ImageService isvc = new Imaging.ImageService();
                        isvc.Url = Application["ImageService"].ToString();
                        isvc.UseDefaultCredentials = true;
                        DataSet ds = isvc.SearchSharePointImageStore("TBill", "TBBarCode", cbol + cl + div + st + "%");
                        imageFound = (ds != null && ds.Tables[0].Rows.Count > 0);
                    }
                }
            }
        }

        if (imageFound)
        {
            //Image available- open image into another browser instance
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script language=javascript>");
            sb.Append("window.open('PODImage.aspx?doc=TBill&prop=TBBarCode&search=" + cbol + "%', '_blank', 'width=480,height=576,menubar=yes,location=no,toolbar=no,status=yes,resizable=yes');");
            sb.Append("</script>");
            Page.ClientScript.RegisterStartupScript(typeof(Page), "POD Image", sb.ToString());
        }
        else
        {
            //No image; request a POD from Argix
            EmailServices  svcs     = new EmailServices();
            MembershipUser user     = Membership.GetUser();
            string         substore = Session["SubStore"] != null ? Session["SubStore"].ToString() : "";
            svcs.SendPODRequest(user, carton, substore);
            svcs.SendPODRequestConfirm(user, carton, substore);

            //Disply confirmation to user
            Response.Redirect("PODConfirmation.aspx");
        }
    }
Ejemplo n.º 6
0
    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;
    }