Example #1
0
    protected void OnCommand(object sender, CommandEventArgs e)
    {
        //
        try {
            switch (e.CommandName)
            {
            case "Submit":
                //Prepare the pickup request
                Argix.Freight.Client.PickupRequest request = new Argix.Freight.Client.PickupRequest();
                request.RequestID      = 0;
                request.Created        = DateTime.Now;
                request.CreateUserID   = Membership.GetUser().UserName;
                request.ScheduleDate   = DateTime.Parse(this.txtPickupDate.Text);
                request.CallerName     = Membership.GetUser().UserName;
                request.ClientNumber   = Profile.GetProfile(Membership.GetUser().UserName).ClientID;
                request.Client         = " ";
                request.ShipperNumber  = "";
                request.Shipper        = this.txtShipperName.Text;
                request.ShipperAddress = this.txtShipperStreet.Text + "\r\n" + this.txtShipperCity.Text + ", " + this.txtShipperState.Text + " " + this.txtShipperZip.Text;
                request.ShipperPhone   = this.txtShipperPhone.Text;
                request.WindowOpen     = int.Parse(this.txtWindowOpen.Text);
                request.WindowClose    = int.Parse(this.txtWindowClose.Text);
                request.TerminalNumber = "";
                request.Terminal       = "";
                request.DriverName     = "";
                request.OrderType      = "P";
                request.Amount         = int.Parse(this.txtQuantity.Text);
                request.AmountType     = "Pallets";
                request.FreightType    = "Tsort";
                request.Weight         = int.Parse(this.txtWeight.Text);
                request.Comments       = this.txtComments.Text;
                request.IsTemplate     = false;
                request.UserID         = Membership.GetUser().UserName;
                request.LastUpdated    = DateTime.Now;

                //Request a pickup
                int pickupID = new Argix.Freight.Client.FreightClientGateway().RequestPickup(request);

                //Send confirmation message to client
                new NotifyService().NotifyPickupConfirmation(Membership.GetUser().Email, pickupID.ToString());

                //Notify client
                Master.ShowMessageBox("New pickup request " + pickupID.ToString() + " has been created.");

                this.btnSubmit.Enabled = false;
                this.btnCancel.Text    = "Close";
                break;

            case "Cancel":
                Response.Redirect("~/Client/PickupLog.aspx", false);
                break;
            }
        }
        catch (Exception ex) { Master.ReportError(ex, 4); }
    }
Example #2
0
 public void NotifyPickupCancelled(string email, string pickupID, Argix.Freight.Client.PickupRequest pickup)
 {
     try {
         //Notify client of pickup cancelled
         if (email.Trim().Length > 0)
         {
             string body = getHTMLBody(System.Web.Hosting.HostingEnvironment.MapPath(HTML_CANCEL));
             body = body.Replace("lblPickupID", pickupID);
             body = body.Replace("txtPickupDate", pickup.ScheduleDate.ToString("MM/dd/yyyy"));
             body = body.Replace("txtShipperName", pickup.Shipper);
             body = body.Replace("txtShipperAddress", pickup.ShipperAddress);
             body = body.Replace("txtShipperPhone", pickup.ShipperPhone);
             body = body.Replace("txtWindowOpen", pickup.WindowOpen.ToString());
             body = body.Replace("txtWindowClose", pickup.WindowClose.ToString());
             body = body.Replace("txtQuantity", pickup.Amount.ToString());
             body = body.Replace("txtWeight", pickup.Weight.ToString());
             body = body.Replace("txtComments", pickup.Comments);
             new Argix.Enterprise.SMTPGateway().SendMailMessage(this.mEmailAdmin, email, "Pallet Shipment Cancellation", true, body);
         }
     }
     catch (Exception ex) { throw new ApplicationException(ex.Message); }
 }