Exemple #1
0
        /// <summary>
        /// 根据订单号查找订单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_query_order_Click(object sender, EventArgs e)
        {
            auto_no = txt_number.Text;

            if (auto_no.Contains("AU"))
            {
                pageNow      = 1;
                record_count = new AutoOrderListDAO().getRecordCount(auto_no);
                page_count   = new AutoOrderListDAO().getPageCount(record_count, pageSize);
                packages     = new AutoOrderListDAO().getAutoOrderListArray(auto_no, pageNow, pageSize);
            }
            else if (auto_no.Contains("WP"))
            {
                packages.Clear();

                pageNow      = 1;
                record_count = 1;
                page_count   = 1;
                AutoOrderList orderlist = new AutoOrderListDAO().getAutoOrderList(auto_no);
                packages.Add(orderlist);
            }
            else
            {
                alert("订单号有误!!");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                order_number = Request.QueryString["order_number"];
                first        = Request.QueryString["flag"];

                if (order_number == null || first == null)
                {
                    Response.Redirect("exception/error-page.aspx");
                }
                else if (order_number.Contains("WM"))
                {
                    // 界面下单
                    lb_which_first.Text = first;

                    Order order = new OrderDAO().getOrder(order_number);

                    if (order.Order_number == null || order.Name != Session["name"].ToString())
                    {
                        Response.Redirect("exception/order-number-error.aspx");
                    }
                    else
                    {
                        initInterfaceAddress(order);
                        has_addr_id.Visible     = true;
                        unpay_operation.Visible = true;
                        package_array           = new PackageDAO().getPackageCartInfo(order_number);
                    }
                }
                else if (order_number.Contains("WA"))
                {
                    lb_which_first.Text = first;
                    // Excel下单
                    AutoOrderList autolist = new AutoOrderListDAO().getAutoOrderList(order_number);

                    if (autolist.Order_no == null || autolist.Name != Session["name"].ToString())
                    {
                        Response.Redirect("exception/order-number-error.aspx");
                    }
                    else
                    {
                        initExcelAddress(autolist);
                        has_addr_id.Visible     = true;
                        unpay_operation.Visible = true;
                        package_array           = getCartPackageInfo(autolist);
                    }
                }
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["name"] == null)
                {
                    Response.Redirect("error-page.aspx");
                }
                else
                {
                    string step = Request.QueryString["step"];

                    if (Session["way"] == null)
                    {
                        part_one.Visible = true;
                        part_two.Visible = false;

                        local_postway.DataSource = createTable();
                        local_postway.DataBind();
                    }
                    else
                    {
                        part_one.Visible = false;
                        part_two.Visible = true;

                        autoorder_array.Clear();

                        ArrayList order_array = (ArrayList)Session["local_order"];

                        if (Session["local_order"] == null)
                        {
                            Response.Redirect("error.aspx");
                        }
                        else
                        {
                            AutoOrderList orderlist = new AutoOrderListDAO().getAutoOrderList(order_array[0].ToString());
                            initLocalPickUpAddr(orderlist);
                        }
                    }
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// 按时间查找
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_check_by_time_Click(object sender, EventArgs e)
        {
            start_time = txt_from.Text.ToString();
            end_time   = txt_to.Text.ToString();

            int i = end_time.CompareTo(start_time);

            if (start_time == "" || end_time == "")
            {
                alert("请选择所查询的时间段");
                return;
            }
            else if (end_time.CompareTo(start_time) != 1)
            {
                alert("起始时间不能大于等于终止时间!!");
                return;
            }
            else
            {
                pageNow = 1;
                DataTable temp = new AutoOrderListDAO().getInnerAutoOrderList(Session["name"].ToString(), start_time, end_time, pageNow, pageSize);

                if (temp.Rows.Count > 0)
                {
                    has_local_order.Visible   = true;
                    no_local_order.Visible    = false;
                    local_datalist.DataSource = createTable(temp);
                    local_datalist.DataBind();
                }
                else
                {
                    has_local_order.Visible = false;
                    no_local_order.Visible  = true;
                    message = "没有找到该时间段内的订单!!";
                }
            }
        }
        /// <summary>
        /// 根据订单号查找订单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_query_order_Click(object sender, EventArgs e)
        {
            string track_no = txt_number.Text;

            // 首先查找 Excel 下单的订单
            AutoOrderList autolist = new AutoOrderList();

            autolist = new AutoOrderListDAO().getAutoOrderListByTrackNo(track_no);

            if (autolist.Ea_track_no != track_no)
            {
                Package package = new PackageDAO().getPackageByTrackNo(track_no);

                if (package.Ea_track_no != track_no)
                {
                    alert("不存在该订单!!");
                }
                else
                {
                    Order order = new OrderDAO().getOrder(package.Order_number);
                    autolist.Order_no              = package.Wp_track_no;
                    autolist.Ea_track_no           = track_no;
                    autolist.CollectionContactName = order.CollectionContactName;
                    autolist.RecipientContactName  = order.RecipientContactName;
                    autolist.Weight             = package.Weight;
                    autolist.Pay_after_discount = package.Pay;
                    autolist.Pay_time           = order.Pay_time;

                    packages.Add(autolist);
                }
            }
            else
            {
                packages.Add(autolist);
            }
        }
Exemple #6
0
        //按订单号查找
        protected void btn_check_by_order_Click(object sender, EventArgs e)
        {
            string order_no = Request.Form["order_number"];

            if (order_no != null)
            {
                order_no = order_no.Trim();
            }
            DataTable temp = new AutoOrderListDAO().getInnerAutoOrderListTable(order_no);

            if (temp.Rows.Count > 0)
            {
                has_local_order.Visible   = true;
                no_local_order.Visible    = false;
                local_datalist.DataSource = createTable(temp);
                local_datalist.DataBind();
            }
            else
            {
                has_local_order.Visible = false;
                no_local_order.Visible  = true;
                message = "没有找到与该订单号对应的订单信息!!";
            }
        }
Exemple #7
0
        //按订单号查找
        protected void btn_check_by_order_Click(object sender, EventArgs e)
        {
            string order_no = Request.Form["order_number"];

            if (order_no != null)
            {
                order_no = order_no.Trim();
            }
            ArrayList temp = new AutoOrderListDAO().getPayAutoOrderList(order_no);

            if (temp.Count > 0)
            {
                has_orders.Visible  = true;
                no_orders.Visible   = false;
                bar_code.DataSource = createBarCodeTable(temp);
                bar_code.DataBind();
            }
            else
            {
                has_orders.Visible = false;
                no_orders.Visible  = true;
                message            = "没有找到与该订单号对应的订单信息!!";
            }
        }
        private DataTable createMyCartTable(string flag)
        {
            DataTable table = new DataTable();

            //订单号
            DataColumn dc = new DataColumn("order_number", typeof(string));

            table.Columns.Add(dc);

            //包裹个数
            dc = new DataColumn("quantity", typeof(float));
            table.Columns.Add(dc);

            //包裹个数
            dc = new DataColumn("weight", typeof(float));
            table.Columns.Add(dc);

            //发件人
            dc = new DataColumn("sender", typeof(string));
            table.Columns.Add(dc);

            //收件人
            dc = new DataColumn("receiver", typeof(string));
            table.Columns.Add(dc);

            //收件人电话
            dc = new DataColumn("phone", typeof(string));
            table.Columns.Add(dc);

            //服务方式
            dc = new DataColumn("postway", typeof(string));
            table.Columns.Add(dc);

            //付款金额
            dc = new DataColumn("pay", typeof(string));
            table.Columns.Add(dc);

            //下单时间
            dc = new DataColumn("time", typeof(string));
            table.Columns.Add(dc);

            if (flag == "excel")
            {
                ArrayList auto_orders = new AutoOrderListDAO().getAutoOrderListArray(Session["name"].ToString(), "unpay");

                for (int i = 0; i < auto_orders.Count; i++)
                {
                    AutoOrderList order = (AutoOrderList)auto_orders[i];

                    DataRow dr = table.NewRow();

                    dr["order_number"] = order.Order_no;
                    dr["quantity"]     = 1;
                    dr["weight"]       = order.Weight;
                    dr["sender"]       = order.CollectionContactName;
                    dr["receiver"]     = order.RecipientContactName;
                    dr["phone"]        = order.RecipientPhone;
                    dr["postway"]      = getPostWay(order.ServiceCode);
                    dr["pay"]          = order.Pay_after_discount;
                    dr["time"]         = order.Order_time;

                    table.Rows.Add(dr);
                }

                ArrayList orders = new OrderDAO().getOrders(Session["name"].ToString(), "unpay");

                for (int i = 0; i < orders.Count; i++)
                {
                    Order order = (Order)orders[i];

                    DataRow dr = table.NewRow();

                    dr["order_number"] = order.Order_number;
                    dr["quantity"]     = order.Quantity;
                    dr["weight"]       = order.Weight;
                    dr["sender"]       = order.CollectionContactName;
                    dr["receiver"]     = order.RecipientContactName;
                    dr["phone"]        = order.RecipientPhone;
                    dr["postway"]      = getPostWay(order.Post_way);
                    dr["pay"]          = order.Pay_after_discount;
                    dr["time"]         = order.Order_time.ToString("yyyy-MM-dd hh:mm");

                    table.Rows.Add(dr);
                }
            }
            else if (flag == "interface")
            {
                ArrayList orders = new OrderDAO().getOrders(Session["name"].ToString(), "unpay");

                for (int i = 0; i < orders.Count; i++)
                {
                    Order order = (Order)orders[i];

                    DataRow dr = table.NewRow();

                    dr["order_number"] = order.Order_number;
                    dr["quantity"]     = order.Quantity;
                    dr["weight"]       = order.Weight;
                    dr["sender"]       = order.CollectionContactName;
                    dr["receiver"]     = order.RecipientContactName;
                    dr["phone"]        = order.RecipientPhone;
                    dr["postway"]      = getPostWay(order.Post_way);
                    dr["pay"]          = order.Pay_after_discount;
                    dr["time"]         = order.Order_time.ToString("yyyy-MM-dd hh:mm");

                    table.Rows.Add(dr);
                }

                ArrayList auro_orders = new AutoOrderListDAO().getAutoOrderListArray(Session["name"].ToString(), "unpay");

                for (int i = 0; i < auro_orders.Count; i++)
                {
                    AutoOrderList order = (AutoOrderList)auro_orders[i];

                    DataRow dr = table.NewRow();

                    dr["order_number"] = order.Order_no;
                    dr["quantity"]     = 1;
                    dr["weight"]       = order.Weight;
                    dr["sender"]       = order.CollectionContactName;
                    dr["receiver"]     = order.RecipientContactName;
                    dr["phone"]        = order.RecipientPhone;
                    dr["postway"]      = getPostWay(order.ServiceCode);
                    dr["pay"]          = order.Pay_after_discount;
                    dr["time"]         = order.Order_time;

                    table.Rows.Add(dr);
                }
            }



            return(table);
        }
        private DataTable createBarCodeTable(ArrayList order_numbers)
        {
            DataTable table = new DataTable();

            un_download = 0;

            down_orders.Clear();
            //订单号
            DataColumn dc = new DataColumn("order_number", typeof(string));

            table.Columns.Add(dc);

            dc = new DataColumn("local_order", typeof(string));
            table.Columns.Add(dc);


            dc = new DataColumn("order_track", typeof(string));
            table.Columns.Add(dc);
            //包裹个数
            dc = new DataColumn("weight", typeof(float));
            table.Columns.Add(dc);

            //发件人
            dc = new DataColumn("sender", typeof(string));
            table.Columns.Add(dc);

            //收件人
            dc = new DataColumn("receiver", typeof(string));
            table.Columns.Add(dc);

            //收件人
            dc = new DataColumn("phone", typeof(string));
            table.Columns.Add(dc);

            //服务方式
            dc = new DataColumn("postway", typeof(string));
            table.Columns.Add(dc);

            //付款金额
            dc = new DataColumn("pay", typeof(string));
            table.Columns.Add(dc);


            for (int i = 0; i < order_numbers.Count; i++)
            {
                string        order_number = order_numbers[i].ToString();
                AutoOrderList order        = new AutoOrderList();

                if (order_number.Contains("WA"))
                {
                    order = new AutoOrderListDAO().getAutoOrderList(order_number);
                    if (order.Ea_track_no == "")
                    {
                        un_download++;
                    }
                    else
                    {
                        DataRow dr = table.NewRow();

                        down_orders.Add(order.Ea_track_no);

                        dr["order_number"] = order.Order_no;
                        dr["order_track"]  = order.Ea_track_no;
                        dr["local_order"]  = "无";
                        dr["weight"]       = order.Weight;
                        dr["sender"]       = order.CollectionContactName;
                        dr["receiver"]     = order.RecipientContactName;
                        dr["phone"]        = order.RecipientPhone;
                        dr["postway"]      = order.ServiceCode;
                        dr["pay"]          = order.Pay_after_discount;


                        table.Rows.Add(dr);
                    }
                }
                else if (order_number.Contains("WM"))
                {
                    Order     temporder    = new OrderDAO().getOrder(order_number);
                    ArrayList packageArray = new PackageDAO().getPackage(temporder.Order_number);

                    for (int j = 0; j < packageArray.Count; j++)
                    {
                        Package temp_package = (Package)packageArray[j];

                        DataRow dr = table.NewRow();

                        down_orders.Add(temp_package.Ea_track_no);

                        dr["order_number"] = temp_package.Order_number;
                        dr["order_track"]  = temp_package.Ea_track_no;

                        if (temp_package.Local_track_no == "")
                        {
                            dr["local_order"] = "无";
                        }
                        else
                        {
                            dr["local_order"] = temp_package.Local_track_no;
                        }

                        dr["weight"]   = temp_package.Weight;
                        dr["sender"]   = temporder.CollectionContactName;
                        dr["receiver"] = temporder.RecipientContactName;
                        dr["phone"]    = temporder.RecipientPhone;

                        if (temporder.Delivery_way == "CollectionPlus")
                        {
                            dr["postway"] = getPostWay(temporder.Post_way) + "—Collection +";
                        }
                        else if (temporder.Delivery_way == "UKMail")
                        {
                            dr["postway"] = getPostWay(temporder.Post_way) + "—UKMail";
                        }
                        else
                        {
                            dr["postway"] = getPostWay(temporder.Post_way);
                        }
                        dr["pay"] = temp_package.Pay;

                        table.Rows.Add(dr);
                    }
                }

                Session["all_orders"] = down_orders;
            }

            return(table);
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                name = Request.QueryString["username"];
                string code    = Request.QueryString["code"];
                string pay_way = Request.QueryString["paymethod"];

                if (Session["name"].ToString() != null && code != null)
                {
                    if (new UserDAO().isCodeRight(Session["name"].ToString(), code))
                    {
                        //生成支付成功码
                        string success_code1 = (new Random().Next(100000000, 1000000000)).ToString();
                        string success_code2 = (new Random().Next(1000000, 10000000)).ToString();
                        string success_code3 = (new Random().Next(10000000, 100000000)).ToString();
                        string success_code  = success_code1 + success_code2 + success_code3;
                        //将成功码插入到用户表中,支付成功是进行验证
                        new UserDAO().updateSuccessCode(Session["name"].ToString(), success_code);
                        //确实付款成功
                        //更新数据库信息
                        order_number_array.Clear();
                        ArrayList excel_payorders     = new AutoOrderListDAO().getAutoOrderListArray(Session["name"].ToString(), "unpay");
                        ArrayList interface_payorders = new OrderDAO().getOrders(Session["name"].ToString(), "unpay");

                        for (int i = 0; i < excel_payorders.Count; i++)
                        {
                            AutoOrderList aulist = (AutoOrderList)excel_payorders[i];
                            new AutoOrderListDAO().updatePayStatus(aulist.Order_no);
                            order_number_array.Add(aulist.Order_no);
                        }
                        new AutoOrderDAO().updateAutoOrderPayStatus(Session["name"].ToString(), pay_way);

                        for (int i = 0; i < interface_payorders.Count; i++)
                        {
                            Order interface_order = (Order)interface_payorders[i];
                            //跟新付款状态
                            new OrderDAO().updatePayStatue(interface_order.Order_number, pay_way);

                            order_number_array.Add(interface_order.Order_number);
                        }

                        Session["AllOrderMsg"] = order_number_array;
                        for (int i = 0; i < order_number_array.Count; i++)
                        {
                            Order order = new OrderDAO().getOrder(order_number_array[i].ToString());
                            if (order.Delivery_way.ToLower() == "collectionplus")
                            {
                                ArrayList package_array = new PackageDAO().getPackage(order_number_array[i].ToString());
                                for (int j = 0; j < package_array.Count; j++)
                                {
                                    Package package = (Package)package_array[j];
                                    LocalTrackNumber++;
                                    CollectionPlusLabel collectionplus = new CollectionPlusLabel(order.CollectionContactName, LocalTrackNumber.ToString(), "", DateTime.Parse(order.Delivery_date).ToString("dd/MM/yyyy"));
                                    trackNumber = "8M6W" + LocalTrackNumber + "A025";
                                    collectionplus.makeCollectionPlusLabel(Server.MapPath("~\\views\\pdf\\local\\" + trackNumber + ".pdf"));
                                    package.Local_track_no = trackNumber;

                                    new PackageDAO().updateLocalTrackNo(package);
                                }
                            }
                        }

                        total_count = order_number_array.Count;
                    }
                    else
                    {
                        Response.Redirect("error-page.aspx");
                    }
                }
                else
                {
                    Response.Redirect("error-page.aspx");
                }
            }
        }
        /// <summary>
        /// 跟新按钮的响应事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_update_Click(object sender, EventArgs e)
        {
            string order_number = Request.Form["order_number"];

            first = lb_which_first.Text;

            string package_id = Request.Form["package_id"];
            string weight     = Request.Form["weight"];
            string length     = Request.Form["length"];
            string width      = Request.Form["width"];
            string height     = Request.Form["height"];
            string descrition = Request.Form["description"];
            string value      = Request.Form["value"];

            string[] package_id_array  = package_id.Split(',');
            string[] weight_array      = weight.Split(',');
            string[] length_array      = length.Split(',');
            string[] width_array       = width.Split(',');
            string[] height_array      = height.Split(',');
            string[] description_array = descrition.Split(',');
            string[] value_array       = value.Split(',');

            if (order_number.Contains("WM"))
            {
                // 先跟新订单信息
                Order order = new OrderDAO().getOrder(order_number);

                order.CollectionContactName = txt_send_addr_contact.Text;
                order.CollectionCompanyName = txt_send_addr_company.Text;
                order.CollectionAddressLine = txt_send_addr_line1.Text + " " + txt_send_addr_line2.Text + " " + txt_send_addr_line3;
                order.CollectionTown        = txt_send_addr_city.Text;
                order.CollectionPostCode    = txt_send_addr_postcode.Text;
                order.CollectionCountry     = txt_send_addr_country.Text;
                order.CollectionPhone       = txt_send_addr_phone.Text;

                order.RecipientContactName = txt_receive_addr_contact.Text;
                order.RecipientCompanyName = txt_receive_addr_company.Text;
                order.RecipientAddressLine = txt_receive_addr_line1.Text + " " + txt_receive_addr_line2.Text + " " + txt_receive_addr_line3.Text;
                order.RecipientTown        = txt_receive_addr_city.Text;
                order.RecipientPostCode    = txt_receive_addr_postcode.Text;
                order.RecipientCountry     = txt_receive_addr_country.Text;
                order.RecipientPhone       = txt_receive_addr_phone.Text;


                // 跟新该订单对应的包裹信息
                for (int i = 0; i < weight_array.Length; i++)
                {
                    Package package = new PackageDAO().getPackage(Convert.ToInt32(package_id_array[i]));

                    package.Weight        = Convert.ToSingle(weight_array[i]);
                    package.Length        = Convert.ToSingle(length_array[i]);
                    package.Width         = Convert.ToSingle(width_array[i]);
                    package.Height        = Convert.ToSingle(height_array[i]);
                    package.Pay           = new Quote().getQuote(package.Departure, package.Destination, package.Weight, package.Length, package.Width, package.Height, package.Post_way);
                    package.Description   = description_array[i];
                    package.Package_value = Convert.ToSingle(value_array[i]);

                    if (order.Post_way == "PF-IPE-Collection" || order.Post_way == "PF-IPE-Depot" || order.Post_way == "China-IPE-Pol" || order.Post_way == "PF-IPE-Trailer" || order.Post_way == "PF-GPR-Collection" || order.Post_way == "PF-GPR-Delivery")
                    {
                        package.Volumetric = (float)(package.Length * package.Width * package.Height / 5000.0f);
                        package.Chargeable = package.Weight > package.Volumetric ? package.Weight : package.Volumetric;
                    }
                    else if (order.Post_way == "PostNL")
                    {
                        if (package.Description.Contains("推车") || package.Description.Contains("座椅"))
                        {
                            package.Volumetric = package.Length * package.Width * package.Height / 6000.0f;
                        }
                        else
                        {
                            package.Volumetric = 0;
                        }

                        package.Chargeable = package.Weight > package.Volumetric ? package.Weight : package.Volumetric;
                    }
                    else if (order.Post_way == "EMS")
                    {
                        package.Volumetric = (float)((package.Length * package.Width * package.Height) / 5000.0);
                        package.Chargeable = package.Weight > package.Volumetric ? package.Weight : package.Volumetric;
                    }

                    package.Pay = new BatchQuoteDAO().getQuote(Session["name"].ToString(), order.Post_way, package.Weight, package.Chargeable);
                    order.Pay_before_discount += package.Pay;


                    //跟新package表
                    updatePackage(package);
                }

                order.Pay_after_discount = order.Pay_before_discount;

                updateOrder(order);
            }
            else if (order_number.Contains("WA"))
            {
                AutoOrderList autolist = new AutoOrderListDAO().getAutoOrderList(order_number);

                autolist.CollectionContactName = txt_send_addr_contact.Text;
                autolist.CollectionCompanyName = txt_send_addr_company.Text;
                autolist.CollectionAddressLine = txt_send_addr_line1.Text + " " + txt_send_addr_line2.Text + " " + txt_send_addr_line3.Text;
                autolist.CollectionTown        = txt_send_addr_city.Text;
                autolist.CollectionPostCode    = txt_send_addr_postcode.Text;
                autolist.CollectionCountry     = txt_send_addr_country.Text;
                autolist.CollectionPhone       = txt_send_addr_phone.Text;

                autolist.RecipientContactName = txt_receive_addr_contact.Text;
                autolist.RecipientCompanyName = txt_receive_addr_company.Text;
                autolist.RecipientAddressLine = txt_receive_addr_line1.Text + " " + txt_receive_addr_line2.Text + " " + txt_receive_addr_line3.Text;
                autolist.RecipientTown        = txt_receive_addr_city.Text;
                autolist.RecipeintPostCode    = txt_receive_addr_postcode.Text;
                autolist.RecipientCountry     = txt_receive_addr_country.Text;
                autolist.RecipientPhone       = txt_receive_addr_phone.Text;

                autolist.Weight             = Convert.ToSingle(weight_array[0]);
                autolist.Length             = Convert.ToSingle(length_array[0]);
                autolist.Width              = Convert.ToSingle(width_array[0]);
                autolist.Height             = Convert.ToSingle(height_array[0]);
                autolist.PackageDescription = description_array[0];
                autolist.PackageValue       = Convert.ToSingle(value_array[0]);

                if (autolist.ServiceCode == "PF-IPE-Collection" || autolist.ServiceCode == "PF-IPE-Depot" || autolist.ServiceCode == "PF-IPE-Pol" || autolist.ServiceCode == "PF-IPE-Trailery" || autolist.ServiceCode == "PF-GPR-Collection" || autolist.ServiceCode == "PF-GPR-Delivery")
                {
                    autolist.Volumetric = (float)(autolist.Length * autolist.Width * autolist.Height / 5000.0f);
                    autolist.Chargeable = autolist.Weight > autolist.Volumetric ? autolist.Weight : autolist.Volumetric;
                }
                else if (autolist.ServiceCode == "PostNL")
                {
                    if (autolist.PackageDescription.Contains("推车") || autolist.PackageDescription.Contains("座椅"))
                    {
                        autolist.Volumetric = autolist.Length * autolist.Width * autolist.Height / 6000.0f;
                    }
                    else
                    {
                        autolist.Volumetric = 0;
                    }

                    autolist.Chargeable = autolist.Weight > autolist.Volumetric ? autolist.Weight : autolist.Volumetric;
                }
                else if (autolist.ServiceCode == "EMS")
                {
                    autolist.Volumetric = (float)((autolist.Length * autolist.Width * autolist.Height) / 5000.0);
                    autolist.Chargeable = autolist.Weight > autolist.Volumetric ? autolist.Weight : autolist.Volumetric;
                }

                autolist.Pay_before_discount = new BatchQuoteDAO().getQuote(Session["name"].ToString(), autolist.ServiceCode, autolist.Weight, autolist.Chargeable);
                autolist.Pay_after_discount  = autolist.Pay_before_discount;
                //跟新订单
                new AutoOrderListDAO().updateAutoOrderList(autolist);
            }

            Response.Redirect("my-shopping-cart.aspx?flag=" + first);
        }
Exemple #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string order_number = Request.QueryString["order_number"];
            string info         = Request.QueryString["type"];

            if (order_number != null)
            {
                AutoOrder autoorder            = new AutoOrderDAO().getAutoOrder(order_number);
                ArrayList auto_orderlist_array = new AutoOrderListDAO().getAutoOrderListArray(autoorder.Auto_no);
                int       ordercount           = autoorder.Order_count;
                string[]  pdflist = new string[ordercount];
                for (int ii = 0; ii < ordercount; ii++)
                {
                    AutoOrderList autoorderlist = (AutoOrderList)auto_orderlist_array[ii];
                    string        tracknumber   = autoorderlist.Order_no;
                    pdflist[ii] = Server.MapPath("\\views\\pdf\\" + tracknumber + "2.pdf");
                }
                mergePDFFiles(pdflist, Server.MapPath("\\views\\pdf\\" + order_number + "2.pdf"));
                string filename = Server.MapPath("\\views\\pdf\\" + order_number + "2.pdf");
                HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + order_number + ".pdf");

                HttpContext.Current.Response.WriteFile(filename);
                HttpContext.Current.Response.Flush();
                HttpContext.Current.Response.Close();
            }
            if (info != null)
            {
                if (order_number != null)
                {
                    Order order = new OrderDAO().getOrder(order_number);

                    string parentPath = Server.MapPath("");
                    string filename   = order.Order_number + ".pdf";
                    string path       = parentPath + "/pdf/" + filename;

                    generatePDF(order, path);

                    HttpContext.Current.Response.ClearContent();
                    HttpContext.Current.Response.ClearHeaders();
                    //如果是在网页中显示
                    if (info == "detail")
                    {
                        //在网页中显示
                        HttpContext.Current.Response.ContentType = "application/PDF";
                        HttpContext.Current.Response.AddHeader("content-disposition", "filename=" + filename);
                    }
                    else
                    {
                        //以下载的形式展现
                        HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + filename);
                    }

                    HttpContext.Current.Response.WriteFile(path);
                    HttpContext.Current.Response.Flush();
                    HttpContext.Current.Response.Close();
                }
            }
            else
            {
                if (Session["orders"] != null)
                {
                    ArrayList orders = (ArrayList)Session["orders"];

                    string parentPath = Server.MapPath("");
                    string filename   = "all_orders.pdf";
                    string path       = parentPath + "/pdf/" + filename;

                    generatePDF(orders, path);

                    HttpContext.Current.Response.ClearContent();
                    HttpContext.Current.Response.ClearHeaders();
                    //如果是在网页中显示


                    //以下载的形式展现
                    HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + filename);

                    HttpContext.Current.Response.WriteFile(path);
                    HttpContext.Current.Response.Flush();
                    HttpContext.Current.Response.Close();
                }
            }
        }
Exemple #13
0
        /// <summary>
        /// 去购物车结算的实现  将要本地区间的订单信息添加到本地取件订单表中
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_goto_cart_Click(object sender, EventArgs e)
        {
            string c_companyname = txt_send_addr_company.Text;
            string c_contactname = txt_send_addr_contact.Text;
            string c_town        = txt_send_addr_city.Text;
            string c_addressline = txt_send_addr_line1.Text + " " + txt_send_addr_line2.Text + " " + txt_send_addr_line3.Text;
            string c_phone       = txt_send_addr_phone.Text;
            string c_postcode    = txt_send_addr_postcode.Text;
            string c_shipdate    = txt_shipdate.Text;

            ArrayList order_array = (ArrayList)Session["local_order"];

            for (int i = 0; i < order_array.Count; i++)
            {
                AutoOrderList orderlist = new AutoOrderListDAO().getAutoOrderList(order_array[i].ToString());
                autoorder_array.Add(orderlist);
            }

            LocalOrder local_order = new LocalOrder();

            Application.Lock();
            string orderNo = Application["orderNo"].ToString();

            Application["orderNo"] = (int)Application["orderNo"] + 1;
            Application.UnLock();

            local_order.Order_no = "WL" + DateTime.Now.ToString("yyMMddHHmm") + orderNo.PadLeft(8, '0');
            local_order.Collectioncompanyname = c_companyname;
            local_order.Collectioncontactname = c_contactname;
            local_order.Collectionaddressline = c_addressline;
            local_order.Collectionpostcode    = c_postcode;
            local_order.Collectiontown        = c_town;
            local_order.Collectionphone       = c_phone;
            local_order.Collectioncountry     = "UK";

            local_order.Recipientcompanyname = "华盟快递";
            local_order.Recipientcontactname = "华盟";
            local_order.Recipientaddressline = "华盟";
            local_order.Recipientpostcode    = "br sdf";
            local_order.Recipienttown        = "Birmihan";
            local_order.Recipientcountry     = "UK";
            local_order.Recipientphone       = "2384sdf";
            local_order.Name          = Session["name"].ToString();
            local_order.Delivery_date = c_shipdate;
            local_order.Servicecode   = Session["way"].ToString();
            local_order.Order_time    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            local_order.Quantity      = autoorder_array.Count;
            local_order.Is_pay        = "unpay";


            for (int i = 0; i < autoorder_array.Count; i++)
            {
                AutoOrderList orderlist     = (AutoOrderList)autoorder_array[i];
                LocalPackage  local_package = new LocalPackage();
                local_package.Name                = Session["name"].ToString();
                local_package.Order_number        = local_order.Order_no;
                local_package.Wm_track_no         = orderlist.Order_no;
                local_package.Cd_track_no         = orderlist.Cd_track_no;
                local_package.Ea_track_no         = orderlist.Ea_track_no;
                local_package.S_track_no          = orderlist.S_track_no;
                local_package.Shipmentpurpose     = orderlist.Shippingpurpose;
                local_package.Packagedescription  = orderlist.PackageDescription;
                local_package.Packagevalue        = orderlist.PackageValue;
                local_package.Weight              = orderlist.Weight;
                local_package.Servicecode         = local_order.Servicecode;
                local_package.Is_pay              = "unpay";
                local_package.Insurance           = orderlist.Insurance;
                local_package.Pay_before_discount = 100;
                local_package.Discount            = 0;
                local_package.Pay_after_discount  = local_package.Pay_before_discount;
                local_package.Less_pay            = 0;
                local_package.True_weight         = 0;

                local_order.Pay_before_discount += local_package.Pay_before_discount;
                if (local_order.Wm_track_no != "")
                {
                    local_order.Wm_track_no = local_order.Wm_track_no + "," + local_package.Wm_track_no;
                }
                else
                {
                    local_order.Wm_track_no += local_package.Wm_track_no;
                }

                new LocalPackageDAO().addLocalPackage(local_package);
            }

            local_order.Pay_after_discount = local_order.Pay_before_discount;
            local_order.Discount           = 0;

            new LocalOrderDAO().addLocalOrder(local_order);

            Response.Redirect("my-local-pick-up-cart.aspx");
        }