Ejemplo n.º 1
0
 protected void btnDelivered_Click(object sender, System.EventArgs e)
 {
     if (hdnSelectedIDs.Value != "")
     {
         string[] arIDs = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
         if (arIDs.Length > 0)
         {
             objSubOrder = new tblSubOrder();
             //objSubOrder.SetOrderMoveToDelivered(Convert.ToInt32(Enums.Enums_OrderStatus.Shipped), Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString());
             objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.Shipped).ToString());
             objSubOrder = null;
             for (int i = 0; i < arIDs.Length; i++)
             {
                 if (arIDs[i].ToString() != "")
                 {
                     SendMail(Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), arIDs[i].ToString());
                 }
             }
             DInfo.ShowMessage("Order status has been Change.", Enums.MessageType.Successfull);
             hdnSelectedIDs.Value = "";
             UcOrderStratus.SetOrderCount();
             LoadDataGrid(true, false);
         }
         else
         {
             DInfo.ShowMessage("Select any one Order for Delivered.", Enums.MessageType.Error);
         }
     }
     else
     {
         DInfo.ShowMessage("Select any one Order for Delivered.", Enums.MessageType.Error);
     }
 }
Ejemplo n.º 2
0
    protected void btnShipped_Click(object sender, System.EventArgs e)
    {
        String strID = "";

        if (hdnSelectedIDs.Value != "")
        {
            if (ddlCourierCompany.SelectedValue != "0")
            {
                string[] arIDs = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(',');
                if (arIDs.Length > 0)
                {
                    //objSubOrder = new tblSubOrder();
                    //objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.Shipped), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.ReadyToShip).ToString());
                    for (int i = 0; i < arIDs.Length; i++)
                    {
                        if (arIDs[i].ToString() != "")
                        {
                            //objSubOrder.Where.AppOrderID.Value = arIDs[i].ToString();
                            //objSubOrder.Query.Load();
                            //if (objSubOrder.RowCount > 0)
                            //{
                            // SendMail(Convert.ToInt32(Enums.Enums_OrderStatus.Shipped), arIDs[i].ToString());
                            if (ddlCourierCompany.SelectedItem.ToString() == Enums.Enum_CourierCompany.AraMax.ToString())
                            {
                                PickupCreationRequest _Request = new PickupCreationRequest();

                                //ClientInfo
                                _Request.ClientInfo = new ClientInfo();
                                _Request.ClientInfo.AccountCountryCode = "IN";
                                _Request.ClientInfo.AccountEntity      = "BOM";
                                _Request.ClientInfo.AccountNumber      = "36669982";
                                _Request.ClientInfo.AccountPin         = "443543";
                                _Request.ClientInfo.UserName           = "******";
                                _Request.ClientInfo.Password           = "******";
                                _Request.ClientInfo.Version            = "v1.0";

                                //Transaction
                                _Request.Transaction            = new Transaction();
                                _Request.Transaction.Reference1 = "";
                                _Request.Transaction.Reference2 = "";
                                _Request.Transaction.Reference3 = "";
                                _Request.Transaction.Reference4 = "";
                                _Request.Transaction.Reference5 = "";

                                //Pickup
                                _Request.Pickup = new Pickup();

                                //PickupContact
                                _Request.Pickup.PickupContact                 = new Contact();
                                _Request.Pickup.PickupContact.Department      = "";
                                _Request.Pickup.PickupContact.PersonName      = "Sadiq";
                                _Request.Pickup.PickupContact.Title           = "";
                                _Request.Pickup.PickupContact.CompanyName     = "Aramex";
                                _Request.Pickup.PickupContact.PhoneNumber1    = "1111111";
                                _Request.Pickup.PickupContact.PhoneNumber1Ext = "";
                                _Request.Pickup.PickupContact.PhoneNumber2    = "";
                                _Request.Pickup.PickupContact.PhoneNumber2Ext = "";
                                _Request.Pickup.PickupContact.FaxNumber       = "";
                                _Request.Pickup.PickupContact.CellPhone       = "1111111";
                                _Request.Pickup.PickupContact.EmailAddress    = "*****@*****.**";
                                _Request.Pickup.PickupContact.Type            = "";

                                //PickupAddress
                                _Request.Pickup.PickupAddress       = new Address();
                                _Request.Pickup.PickupAddress.Line1 = "Testing address";
                                _Request.Pickup.PickupAddress.Line2 = "";
                                _Request.Pickup.PickupAddress.Line3 = "";
                                _Request.Pickup.PickupAddress.City  = "";
                                _Request.Pickup.PickupAddress.StateOrProvinceCode = "";
                                _Request.Pickup.PickupAddress.PostCode            = "400093";
                                _Request.Pickup.PickupAddress.CountryCode         = "IN";

                                //ClosingTime
                                _Request.Pickup.ClosingTime = DateTime.Now.AddDays(1);

                                //Comments
                                _Request.Pickup.Comments = "";

                                //LastPickupTime
                                _Request.Pickup.LastPickupTime = DateTime.Now.AddDays(1);

                                //PickupDate
                                _Request.Pickup.PickupDate = DateTime.Now.AddDays(1);

                                //PickupLocation
                                _Request.Pickup.PickupLocation = "Reception";

                                //ReadyTime
                                _Request.Pickup.ReadyTime = DateTime.Now.AddDays(1);

                                //Reference1
                                _Request.Pickup.Reference1 = "test";

                                //Reference2
                                _Request.Pickup.Reference2 = "";

                                //Vehicle
                                _Request.Pickup.Vehicle = "Car";

                                //Status
                                _Request.Pickup.Status = "Ready";

                                //Items


                                //List<PickupItemDetail> lstPickupItemDetail = new List<PickupItemDetail>();
                                PickupItemDetail objPickupItemDetail = new PickupItemDetail();
                                //objPickupItemDetail.CashAmount = "";
                                //objPickupItemDetail.Comments = "";
                                //objPickupItemDetail.ExtensionData = "";
                                //objPickupItemDetail.ExtraCharges = "";
                                objPickupItemDetail.NumberOfPieces    = arIDs.Length;
                                objPickupItemDetail.NumberOfShipments = 1;
                                objPickupItemDetail.PackageType       = "BOX";
                                objPickupItemDetail.Payment           = "P";
                                objPickupItemDetail.ProductGroup      = "DOM";
                                objPickupItemDetail.ProductType       = "ONP";
                                //objPickupItemDetail.ShipmentDimensions = "";
                                //objPickupItemDetail.ShipmentVolume = "";
                                //objPickupItemDetail.ShipmentWeight = "";


                                _PickupItems.Add(objPickupItemDetail);
                                _Request.Pickup.PickupItems = _PickupItems.ToArray();

                                //Shipments
                                _Request.Pickup.Shipments = (_Shipments == null) ? null : _Shipments.ToArray();

                                _Request.LabelInfo = null;

                                _Request.LabelInfo          = new LabelInfo();
                                _Request.LabelInfo.ReportID = 9201;

                                _Request.LabelInfo.ReportType = "URL";

                                //_Request.LabelInfo.ReportType = "RPT";

                                PickupCreationResponse _Response = null;
                                Service_1_0Client      _Client   = new Service_1_0Client();

                                _Client.Open();
                                _Response = _Client.CreatePickup(_Request);
                                _Client.Close();

                                strID = Convert.ToString(_Response.ProcessedPickup.GUID);
                            }
                            // objSubOrder.AppDocketNo = strID;
                            //objSubOrder.s_AppCourierCompanyID = ddlCourierCompany.SelectedValue;
                            //objSubOrder.Save();
                            strID = "";

                            //}
                        }
                    }
                    //objSubOrder = null;
                    DInfo.ShowMessage("Order status has been Change.", Enums.MessageType.Successfull);
                    hdnSelectedIDs.Value = "";
                    UcOrderStratus.SetOrderCount();
                    LoadDataGrid(true, false);
                }
                else
                {
                    DInfo.ShowMessage("Select any one Order for Shipped.", Enums.MessageType.Error);
                }
            }
            else
            {
                DInfo.ShowMessage("Select any Courier Company for Shipped.", Enums.MessageType.Error);
            }
        }
        else
        {
            DInfo.ShowMessage("Select any one Order for Shipped.", Enums.MessageType.Error);
        }
    }