Exemplo n.º 1
0
    public bool SendPODRequestConfirm(MembershipUser user, Argix.Enterprise.TrackingItem item)
    {
        //
        bool   retValue = false;
        string subject  = "POD Request Confirmation";
        string body     = getHTMLBody(HostingEnvironment.ApplicationPhysicalPath + HTML_POD_REQCONFIRM);

        body = body.Replace("*user*", user.UserName);
        body = body.Replace("*email*", user.Email);
        body = body.Replace("*store*", item.StoreNumber);
        body = body.Replace("*storename*", item.StoreName.Trim());
        body = body.Replace("*carton*", item.CartonNumber.Trim());
        body = body.Replace("*client*", item.Client.Trim() + "-" + item.ClientName.Trim());
        body = body.Replace("*vendor*", item.Vendor.Trim() + "-" + item.VendorName.Trim());
        body = body.Replace("*pickupdate*", item.PickupDate.Trim());
        body = body.Replace("*scheduleddelivery*", item.ActualStoreDeliveryDate);
        body = body.Replace("*shipment*", item.VendorKey.Trim());
        body = body.Replace("*bol*", item.BOLNumber.ToString());
        body = body.Replace("*tl*", item.TLNumber.Trim());
        body = body.Replace("*label*", item.LabelNumber.ToString());
        body = body.Replace("*po*", item.PONumber.Trim());
        body = body.Replace("*weight*", item.Weight.ToString());
        if (body.Length > 0)
        {
            SMTPGateway smtpGateway = new SMTPGateway();
            smtpGateway.SendMailMessage(this.mEmailFrom, user.Email, subject, true, body);
            retValue = true;
        }
        return(retValue);
    }
Exemplo n.º 2
0
    public bool SendPODRequest(MembershipUser user, Argix.Enterprise.TrackingItem item)
    {
        //
        bool   retValue = false;
        string subject  = "Argix Logistics POD Request";
        string body     = getHTMLBody(HostingEnvironment.ApplicationPhysicalPath + HTML_POD_REQUEST);

        body = body.Replace("*carton*", item.CartonNumber.Trim());
        body = body.Replace("*user*", user.UserName);
        body = body.Replace("*email*", user.Email);
        body = body.Replace("*client*", item.Client.Trim() + "-" + item.ClientName.Trim());
        body = body.Replace("*store*", item.StoreNumber.ToString());
        body = body.Replace("*substore*", item.StoreName);
        body = body.Replace("*storeaddress*", item.StoreAddress1.Trim() + " " + item.StoreAddress2.Trim() + " " + item.StoreCity.Trim() + ", " + item.StoreState.Trim() + " " + item.StoreZip);
        body = body.Replace("*pickupdate*", item.PickupDate.Trim());
        body = body.Replace("*scheduleddelivery*", item.ActualStoreDeliveryDate);
        string podScan = "";

        if (item.ScanType == 3)
        {
            if (item.PODScanDate.Trim().Length > 0)
            {
                podScan = item.PODScanDate.Trim();
            }
        }
        body = body.Replace("*actualdelivery*", podScan);
        body = body.Replace("*tl*", item.TLNumber.Trim());
        body = body.Replace("*cbol*", item.CBOL.Trim());
        body = body.Replace("*po*", item.PONumber.Trim());
        body = body.Replace("*pro*", "");
        body = body.Replace("*shipment*", item.VendorKey.Trim());
        body = body.Replace("*bol*", item.BOLNumber.ToString());
        body = body.Replace("*weight*", item.Weight.ToString());
        body = body.Replace("*label*", item.LabelNumber.ToString());
        if (body.Length > 0)
        {
            SMTPGateway smtpGateway = new SMTPGateway();
            smtpGateway.SendMailMessage(this.mEmailFrom, this.mEmailPODReq, subject, true, body);
            retValue = true;
        }
        return(retValue);
    }
Exemplo n.º 3
0
    protected void OnPODRequest(object sender, EventArgs e)
    {
        //
        DataSet ds          = null;
        bool    imagesFound = false;

        try {
            if (this.lnkPODReq.Text == "Request POD")
            {
                sendPODRequest();
            }
            else
            {
                //Get all detail rows for this carton
                Argix.Enterprise.TrackingItem item = null;
                if (this.mLabelNumber.Length > 0)
                {
                    TrackingItems items = (TrackingItems)Session["TrackData"];
                    if (items != null)
                    {
                        //Find the items info for labelNumber
                        foreach (TrackingItem _item in items)
                        {
                            if (_item.LabelNumber == this.mLabelNumber)
                            {
                                //Get carton data and check for a POD image for this CBOL
                                item = _item;
                                string cl = item.Client.Trim().PadLeft(3, '0');
                                //string div = "01";      Can't wildcard div in KQL
                                string st   = item.StoreNumber.Trim().PadLeft(5, '0');
                                string cbol = item.CBOL.Trim();
                                if (cbol.Length > 0)
                                {
                                    ds          = new Argix.Enterprise.ImagingGateway().SearchSharePointImageStore(Application["ImagingDocClass"].ToString(), Application["ImagingPropertyName"].ToString(), cbol + cl + "*");
                                    imagesFound = (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Select("Store=" + st).Length > 0);
                                }
                                break;
                            }
                        }
                    }
                }
                else
                {
                    Master.ShowMessageBox("Could not find tracking information. Please return to tracking page and try again.");
                }

                if (imagesFound)
                {
                    //Images available- open images into other browser instances
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        if (ds.Tables[0].Rows[i]["Store"].ToString() == item.StoreNumber.Trim().PadLeft(5, '0'))
                        {
                            string uri = ds.Tables[0].Rows[i]["Path"].ToString();
                            sb.Append("window.open('PODImage.aspx?uri=" + uri + "', '_blank', 'width=480,height=576,menubar=yes,location=no,toolbar=no,status=yes,resizable=yes');");
                        }
                    }
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "POD Image", sb.ToString(), true);
                }
                else
                {
                    //Image(s) unavailable
                    ViewState.Add("PODRequestItem", item);
                    this.lnkPODReq.Text    = "Request POD";
                    this.lnkPODReq.ToolTip = "Request POD image(s) from Customer Service";
                    Master.ShowMessageBox("The POD was not be found. Click the Request POD link to request the POD from Customer Service.");
                }
            }
        }
        catch (Exception ex) { Master.ReportError(ex, 3); }
    }
Exemplo n.º 4
0
    private void showItem(TrackingItem item)
    {
        //Display summary
        this.lblCartonNumber.Text = item.CartonNumber;
        this.lblClientName.Text   = item.ClientName;
        //this.lblStoreNumber.Text = "Store# " + item.StoreNumber.PadLeft(5,'0');
        this.lblStore.Text          = item.StoreName + ", " + item.StoreAddress1 + (item.StoreAddress2.Length > 0 ? ", " + item.StoreAddress2 + ", " : " ") + item.StoreCity + ", " + item.StoreState + " " + item.StoreZip;
        this.lblVendorName.Text     = item.VendorName.Trim();
        this.lblPickupDate.Text     = item.PickupDate.Trim();
        this.lblBOLNumber.Text      = item.BOLNumber.ToString();
        this.lblTLNumber.Text       = item.TLNumber.Trim();
        this.lblLabelNumber.Text    = item.LabelNumber.ToString();
        this.lblPONumber.Text       = item.PONumber.Trim();
        this.lblWeight.Text         = item.Weight.ToString();
        this.lblShipmentNumber.Text = item.ShipmentNumber.Trim();
        this.lblSchDelivery.Text    = item.ActualStoreDeliveryDate.Trim();

        //Display detail
        Argix.Enterprise.TrackingItems detail = new Argix.Enterprise.TrackingItems();
        Argix.Enterprise.TrackingItem  row    = null;
        if (item.SortFacilityArrivalDate.Trim().Length > 0)
        {
            row            = new Argix.Enterprise.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.SortFacilityArrivalDate;
            row.Status     = item.SortFacilityArrivalStatus;
            row.Location   = item.SortFacilityLocation;
            detail.Add(row);
        }
        if (item.ActualDepartureDate.Trim().Length > 0)
        {
            row            = new Argix.Enterprise.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.ActualDepartureDate;
            row.Status     = item.ActualDepartureStatus;
            row.Location   = item.ActualDepartureLocation;
            detail.Add(row);
        }
        if (item.ActualArrivalDate.Trim().Length > 0)
        {
            row            = new Argix.Enterprise.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.ActualArrivalDate;
            row.Status     = item.ActualArrivalStatus;
            row.Location   = item.ActualArrivalLocation;
            detail.Add(row);
        }
        if (item.ActualStoreDeliveryDate.Trim().Length > 0)
        {
            row            = new Argix.Enterprise.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.ActualStoreDeliveryDate;
            row.Status     = item.ActualStoreDeliveryStatus;
            row.Location   = item.ActualStoreDeliveryLocation;
            detail.Add(row);
        }
        if (item.PODScanDate.Trim().Length > 0)
        {
            row            = new Argix.Enterprise.TrackingItem();
            row.ItemNumber = item.ItemNumber;
            row.DateTime   = item.PODScanDate;
            row.Status     = item.PODScanStatus;
            row.Location   = item.PODScanLocation;
            detail.Add(row);
        }
        this.grdDetail.DataSource = detail;
        this.grdDetail.DataBind();

        //POD Request link available if carton delivered
        this.lnkPODReq.Enabled = (item.ScanType == 3 && item.PODScanStatus.ToLower().Contains("delivered") == true);
        this.lnkPODReq.ToolTip = (item.ScanType == 3 && item.PODScanStatus.ToLower().Contains("delivered") == true) ? "Display POD image (if image available)" : "POD only available after carton delivery";
    }