Esempio n. 1
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            if (CurrentUser.id == 0)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + Tag("已购买商品在已收货之后才可以发表评价") + "');window.location.href='" + URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "") + "';</script>");
                Response.End();
                //Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain())+ ""));
            }
            path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserComment", "1") + "\"><span>" + Tag("商品评价") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserCommentWrite", "") + "\"><span>" + Tag("发表评价") + "</span></a>";
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserCommentWrite'");

            id = Rint("id");
            int pid = Rint("pid");

            if (pid > 0)
            {
                List <Lebi_Order_Product> Order_Products = B_Lebi_Order_Product.GetList("Product_id=" + pid + " and IsCommented = 0 and User_id=" + CurrentUser.id + "", "id desc");
                if (Order_Products.Count > 0)
                {
                    order_product = Order_Products.FirstOrDefault();
                    id            = order_product.id;
                }
            }
            order_product = B_Lebi_Order_Product.GetModel("id = " + id + " and IsCommented = 0 and User_id=" + CurrentUser.id + "");
            if (order_product == null)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + Tag("已购买商品在已收货之后才可以发表评价") + "');location.href='" + URL("P_UserComment", "1", "") + "';</script>");
                Response.End();
            }
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!EX_Admin.Power("statis_sales", "销售报表"))
     {
         NewPageNoPower();
     }
     Pay_id       = RequestTool.RequestInt("Pay_id", 0);
     Transport_id = RequestTool.RequestInt("Transport_id", 0);
     dateFrom     = RequestTool.RequestString("dateFrom");
     dateTo       = RequestTool.RequestString("dateTo");
     //if (dateFrom == "")
     //    dateFrom = System.DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
     //if (dateTo == "")
     //    dateTo = System.DateTime.Now.AddDays(0).ToString("yyyy-MM-dd");
     string where = "Type_id_OrderType=211 and IsPaid = 1";
     where       += " and Time_Add>='" + dateFrom + "' and Time_Add<='" + dateTo + "'";
     if (Pay_id > 0)
     {
         where += " and Pay_id = " + Pay_id;
     }
     if (Transport_id > 0)
     {
         where += " and Transport_id = " + Transport_id;
     }
     pros = B_Lebi_Order_Product.GetList("Order_id in (select id from Lebi_Order where " + where + ")", "Time_Add desc");
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            torder = B_Lebi_Transport_Order.GetModel(id);
            if (torder == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            string where = "id = " + torder.Order_id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            order = B_Lebi_Order.GetModel(where);
            if (order == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            pros = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", "");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int    orderid = RequestTool.RequestInt("orderid", 0);
            int    id      = RequestTool.RequestInt("id", 0);
            string pnumber = RequestTool.RequestString("pnumber").Trim();

            order        = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + orderid);
            orderproduct = B_Lebi_Order_Product.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (orderproduct == null)
            {
                product      = B_Lebi_Product.GetModel("Number=lbsql{'" + pnumber + "'} order by id desc");
                orderproduct = new Lebi_Order_Product();
            }
            else
            {
                product = B_Lebi_Product.GetModel(orderproduct.Product_id);
            }
            if (order == null || product == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            //int pid = product.Product_id == 0 ? product.id : product.Product_id;
            if (product.Product_id > 0)
            {
                models = B_Lebi_Product.GetList("Product_id=" + product.Product_id + "", "");
            }
            else
            {
                models = new List <Lebi_Product>();
                models.Add(product);
            }
        }
Esempio n. 5
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     if (CurrentUser.id == 0)
     {
         Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
     }
     LoadTheme(themecode, siteid, languagecode, pcode);
     id          = Rint("id");
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserOrderDetails'");
     order       = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + "");
     if (order == null)
     {
         PageError();
     }
     if (order.User_id != CurrentUser.id)
     {
         PageError();
     }
     if (order.IsShipped == 0)
     {
         Response.Redirect(URL("P_UserReturnShip", id));
     }
     if (order.Type_id_OrderType == 211)
     {
         Response.Redirect(URL("P_UserOrderDetails", id));
     }
     path             = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturn", "") + "\"><span>" + Tag("退货订单") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturnDetails", id) + "\"><span>" + Tag("订单") + ":" + order.Code + "</span></a>";
     comments         = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + order.id, "id desc");
     transport_orders = B_Lebi_Transport_Order.GetList("Order_id=" + order.id, "id desc");
     bills            = B_Lebi_Bill.GetList("Order_id=" + order.id, "id desc");
     order_products   = B_Lebi_Order_Product.GetList("Order_id=" + order.id, "id desc");
 }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_edit", "编辑商品"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel(id);
            int          SonCount = B_Lebi_Product.Counts("Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "a.Product_id = " + pro.id;
            }
            else
            {
                sql = "a.Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where " + sql + " and (a.Count - a.Count_Shipped)!=0 and b.IsInvalid = 0 and b.IsCompleted = 0 and b.Type_id_OrderType = 211";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }
            //where += " and IsShipped=0";
            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Power("supplier_statis", "数据统计"))
     {
         NewPageNoPower();
     }
     Pay_id       = RequestTool.RequestInt("Pay_id", 0);
     Transport_id = RequestTool.RequestInt("Transport_id", 0);
     dateFrom     = RequestTool.RequestDate("dateFrom");
     dateTo       = RequestTool.RequestDate("dateTo");
     //dateFrom = RequestTool.RequestString("dateFrom");
     //if (dateFrom == "")
     //    dateFrom = System.DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
     //dateTo = RequestTool.RequestString("dateTo");
     //if (dateTo == "")
     //    dateTo = System.DateTime.Now.AddDays(0).ToString("yyyy-MM-dd");
     string where = "Supplier_id = " + CurrentSupplier.id + " and (Type_id_OrderType = 211 or Type_id_OrderType = 213) and IsPaid = 1";
     where       += " and (datediff(d,Time_Add,'" + dateFrom + "')<=0 and datediff(d,Time_Add,'" + dateTo + "')>=0)";
     if (Pay_id > 0)
     {
         where += " and Paid_id = " + Pay_id;
     }
     if (Transport_id > 0)
     {
         where += " and Transport_id = " + Transport_id;
     }
     pros = B_Lebi_Order_Product.GetList("Order_id in (select id from Lebi_Order where " + where + ")", "Time_Add desc");
 }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_shipping", "订单发货"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }

            pros            = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            transport_order = B_Lebi_Transport_Order.GetModel("Order_id = " + id);
            if (transport_order == null)
            {
                transport_order = new Lebi_Transport_Order();
            }
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            config = ShopCache.GetBaseConfig();
            pros   = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            comms  = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + " and User_id = " + model.User_id + " and Admin_id = 0", "id desc");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_product_list", "商品列表"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            int          SonCount = B_Lebi_Product.Counts("Supplier_id = " + CurrentSupplier.id + " and Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "Product_id = " + pro.id;
            }
            else
            {
                sql = "Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where b.Supplier_id = " + CurrentSupplier.id + " and " + sql + " and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }

            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Esempio n. 11
0
        /// <summary>
        /// 删除会员
        /// </summary>
        public void User_Del()
        {
            if (!EX_Admin.Power("user_del", "删除会员"))
            {
                AjaxNoPower();
                return;
            }
            string id = RequestTool.RequestString("ids");

            if (id == "")
            {
                Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}");
                return;
            }
            if (RequestTool.GetConfigKey("IsDelFalse").ToLower() == "true")
            {
                List <Lebi_User> users = B_Lebi_User.GetList("id in (lbsql{" + id + "})", "");
                foreach (var u in users)
                {
                    u.IsDel = 1;
                    B_Lebi_User.Update(u);
                }
            }
            else
            {
                List <Lebi_Order> modellist = B_Lebi_Order.GetList("User_id in (lbsql{" + id + "})", "");
                foreach (Lebi_Order model in modellist)
                {
                    B_Lebi_Order.Delete("id = " + model.id + "");
                    B_Lebi_Order_Log.Delete("Order_id = " + model.id + "");
                    B_Lebi_Order_Product.Delete("Order_id = " + model.id + "");
                }
                B_Lebi_User.Delete("id in (lbsql{" + id + "})");
                B_Lebi_Message.Delete("User_id_To in (lbsql{" + id + "})");
                B_Lebi_User_Answer.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Answer.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_BuyMoney.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Card.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Money.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Point.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Product.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_User_Address.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Supplier.Delete("User_id in (lbsql{" + id + "})");
                //B_Lebi_Supplier_ProductType.Delete("Supplier_id in (lbsql{" + id + "})");
                //B_Lebi_Supplier_Verified_Log.Delete("Supplier_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Area.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Money.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Product.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Product_request.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Agent_Product_User.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Bill.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Cash.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_Comment.Delete("User_id in (lbsql{" + id + "})");
                B_Lebi_weixin_qrcode.Delete("User_id in (lbsql{" + id + "})");
            }
            Log.Add("删除会员", "User", id.ToString(), CurrentAdmin, id.ToString());
            Response.Write("{\"msg\":\"OK\"}");
        }
Esempio n. 12
0
        protected string billstatus = "";//发票状态
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            if (domain3admin && CurrentAdmin.Site_ids != "")
            {
                if (!("," + CurrentAdmin.Site_ids + ",").Contains("," + model.Site_id + ","))
                {
                    PageError();
                    return;
                }
            }
            oldmodel = B_Lebi_Order.GetModel(model.Order_id);
            if (oldmodel == null)
            {
                oldmodel = new Lebi_Order();
            }
            //if (model.Type_id_OrderType == 212)
            //    str = "- ";
            //if (model.Type_id_OrderType == 212)
            //    Response.Redirect("Torder_view.aspx?id=" + id);
            pros    = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            Logs    = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc");
            torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc");
            comms   = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc");
            langs   = Language.Languages();
            Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + "");

            if (bill == null)
            {
                billstatus = Tag("不开发票");
            }
            else
            {
                billstatus = EX_Type.TypeName(bill.Type_id_BillStatus);
            }
        }
Esempio n. 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (model == null)
            {
                PageError();
                return;
            }
            else
            {
                shop = CurrentSupplier;
                if (shop == null)
                {
                    shop = new Lebi_Supplier();
                }

                if (CurrentSupplier.id != model.Supplier_id)
                {
                    PageError();
                    return;
                }
            }
            if (model.Type_id_OrderType == 212)
            {
                str = "- ";
            }
            //if (model.Type_id_OrderType == 212)
            //    Response.Redirect("Torder_view.aspx?id=" + id);
            pros    = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            Logs    = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc");
            torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc");
            comms   = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc");
            langs   = Language.Languages();
            Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + "");

            if (bill == null)
            {
                billstatus = Tag("不开发票");
            }
            else
            {
                billstatus = Tag(EX_Type.TypeName(bill.Type_id_BillStatus));
            }
            TransportCount = B_Lebi_Transport_Order.Counts("Order_id=" + model.id + "");
            CommentCount   = B_Lebi_Comment.Counts("TableName='Order' and Keyid=" + model.id + "");
            LogCount       = B_Lebi_Log.Counts("TableName='Order' and Keyid='" + model.id + "'");
            deliveries     = B_Lebi_Supplier_Delivery.GetList("Supplier_id = " + model.Supplier_id + "", "Sort desc");
            DeliveryCount  = B_Lebi_Supplier_Delivery.Counts("Supplier_id = " + model.Supplier_id + "");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            torder = B_Lebi_Transport_Order.GetModel(id);
            if (torder == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            order = B_Lebi_Order.GetModel(torder.Order_id);
            pros  = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", "");
        }
Esempio n. 15
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     if (CurrentUser.id == 0)
     {
         Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
     }
     LoadTheme(themecode, siteid, languagecode, pcode);
     if (SYS.IsClosetuihuo == "1")
     {
         PageError();
     }
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'");
     path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturn", "" + id + "") + "\"><span>" + Tag("退货订单") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturnApply", "") + "\"><span>" + Tag("退货申请") + "</span></a>";
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'");
     id          = Rint_Para("0");
     order       = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + "");
     if (order == null)
     {
         PageError();
     }
     if (order.User_id != CurrentUser.id)
     {
         PageError();
     }
     where          = "Order_id=" + order.id + "";
     order_products = B_Lebi_Order_Product.GetList(where, "id desc");
     if (order.Supplier_id > 0)
     {
         Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id);
         if (supplier != null)
         {
             shouhuoren     = supplier.RealName;
             shouhuodizhi   = supplier.Address;
             shouhuodianhua = supplier.Phone;
             shouhuoyoubian = supplier.Postalcode;
         }
     }
     else
     {
         Lebi_Express_Shipper shipper = B_Lebi_Express_Shipper.GetList("", "Sort desc", 1, 1).FirstOrDefault();
         if (shipper != null)
         {
             shouhuoren     = shipper.UserName;
             shouhuodizhi   = shipper.Address;
             shouhuodianhua = shipper.Tel;
             shouhuoyoubian = shipper.ZipCode;
         }
     }
 }
Esempio n. 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_order_shipping", "订单发货"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            if (model == null)
            {
                model = new Lebi_Order();
            }

            pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
        }
Esempio n. 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_order_print", "打印订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Order.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            config = ShopCache.GetBaseConfig();
            pros   = B_Lebi_Order_Product.GetList("Supplier_id = " + CurrentSupplier.id + " and Order_id=" + model.id + "", "");
            comms  = B_Lebi_Comment.GetList("Supplier_id = " + CurrentSupplier.id + " and TableName='Order' and Keyid=" + model.id + " and User_id = " + model.User_id + " and Admin_id = 0", "id desc");
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            model = B_Lebi_Order.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Order();
            }

            pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_edit", "编辑商品"))
            {
                WindowNoPower();
            }
            Number = RequestTool.RequestString("Number");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel("Number = lbsql{'" + Number + "'}");
            int          SonCount = B_Lebi_Product.Counts("Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "Product_Number = lbsql{'" + Number + "'}";
            }
            else
            {
                sql = "Product_Number in (select Lebi_Product.Number from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            pros = B_Lebi_Order_Product.GetList("" + sql + " and Order_id in(select Lebi_Order.id from Lebi_Order where Lebi_Order_Product.Order_id = Lebi_Order.id and Lebi_Order.Type_id_OrderType=211 and Lebi_Order.IsCompleted = 1)", "");
        }
Esempio n. 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_shipping", "订单发货"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Order.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Order();
            }

            pros            = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            transport_order = B_Lebi_Transport_Order.GetModel("Order_id = " + id);
            if (transport_order == null)
            {
                transport_order = new Lebi_Transport_Order();
            }
        }
Esempio n. 21
0
        /// <summary>
        /// 删除商家
        /// </summary>
        public void User_Del()
        {
            if (!EX_Admin.Power("supplier_user_del", "删除商家"))
            {
                AjaxNoPower();
                return;
            }
            string id = RequestTool.RequestString("ids");

            if (id == "")
            {
                Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}");
                return;
            }
            B_Lebi_Supplier.Delete("id in (lbsql{" + id + "})");
            List <Lebi_Order> modellist = B_Lebi_Order.GetList("Supplier_id in (lbsql{" + id + "})", "");

            foreach (Lebi_Order model in modellist)
            {
                B_Lebi_Order.Delete("id = " + model.id + "");
                B_Lebi_Order_Log.Delete("Order_id = " + model.id + "");
                B_Lebi_Order_Product.Delete("Order_id = " + model.id + "");
            }
            B_Lebi_Brand.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_ProPerty.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_ProPerty_Tag.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Cash.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Message.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Supplier_Money.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Supplier_Bank.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Supplier_BillType.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Supplier_ProductType.Delete("Supplier_id in (lbsql{" + id + "})");
            //B_Lebi_Supplier_Verified.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Supplier_Verified_Log.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_Log.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_ServicePanel.Delete("Supplier_id in (lbsql{" + id + "})");
            B_Lebi_ServicePanel_Group.Delete("Supplier_id in (lbsql{" + id + "})");
            Log.Add("删除商家", "Supplier_User", id.ToString(), CurrentAdmin, id.ToString());
            Response.Write("{\"msg\":\"OK\"}");
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_list", "订单列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            type         = RequestTool.RequestString("type");
            string where = "Type_id_OrderProductType=256 and IsPaidReserve=1";
            switch (type.ToLower())
            {
            case "1":
                where += " and IsStockOK=0";
                break;

            case "2":
                where += " and IsStockOK = 1";
                break;

            case "3":
                where += " and IsPaid = 0";
                break;

            case "4":
                where += " and IsPaid = 1";
                break;

            case "5":
                where += " and Count_Shipped=0";
                break;

            case "6":
                where += " and Count_Shipped>0";
                break;
            }
            PageSize = RequestTool.getpageSize(25);
            models   = B_Lebi_Order_Product.GetList(where, "id desc", PageSize, page);
            int recordCount = B_Lebi_Order_Product.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&type=" + type, page, PageSize, recordCount);
        }
Esempio n. 23
0
        protected string billstatus = "";//发票状态
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Order.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            if (model.Type_id_OrderType == 212)
            {
                str = "- ";
            }
            if (model.Type_id_OrderType == 212)
            {
                Response.Redirect("Torder_view.aspx?id=" + id);
            }
            pros    = B_Lebi_Order_Product.GetList("Order_id=" + model.id + " and Supplier_id = " + CurrentSupplier.id + "", "");
            Logs    = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc");
            torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + " and Supplier_id = " + CurrentSupplier.id + "", "id desc");
            comms   = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc");
            langs   = Language.Languages();
            Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + "");

            if (bill == null)
            {
                billstatus = Tag("不开发票");
            }
            else
            {
                billstatus = Tag(EX_Type.TypeName(bill.Type_id_BillStatus));
            }
        }
Esempio n. 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_order_edit", "编辑订单"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            torder = B_Lebi_Transport_Order.GetModel(id);
            if (torder == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            order = B_Lebi_Order.GetModel(torder.Order_id);
            if (order.Supplier_id != CurrentSupplier.id)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            pros = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", "");
        }
Esempio n. 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
        }
Esempio n. 26
0
        /// <summary>
        /// 退货单发货
        /// </summary>
        public void torder_shipping()
        {
            int        order_id = RequestTool.RequestInt("order_id", 0);
            Lebi_Order model    = B_Lebi_Order.GetModel("User_id=" + CurrentUser.id + " and id = " + order_id);

            if (model == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (model.IsVerified != 1)
            {
                Response.Write("{\"msg\":\"" + Tag("请等待客服人员确认") + "\"}");
                return;
            }
            Lebi_Transport_Order torder = B_Lebi_Transport_Order.GetModel("Order_id=" + model.id + "");

            if (torder != null)
            {
                torder.Code           = RequestTool.RequestSafeString("Code");
                torder.Transport_Name = RequestTool.RequestSafeString("Transport_Name");
                B_Lebi_Transport_Order.Update(torder);
            }
            else
            {
                Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(model.Supplier_id);
                if (supplier == null)
                {
                    supplier = new Lebi_Supplier();
                }
                torder          = new Lebi_Transport_Order();
                torder.Code     = RequestTool.RequestSafeString("Code");
                torder.Order_id = model.id;

                torder.T_Address     = model.T_Address;
                torder.T_Email       = model.T_Email;
                torder.T_MobilePhone = model.T_MobilePhone;
                torder.T_Name        = model.T_Name;
                torder.T_Phone       = model.T_Phone;
                //torder.Transport_Code = model.Transport_Code;
                //torder.Transport_id = model.Transport_id;
                torder.Transport_Name   = RequestTool.RequestSafeString("Transport_Name");
                torder.User_id          = model.User_id;
                torder.Supplier_id      = supplier.id;
                torder.Supplier_SubName = supplier.SubName;
                List <TransportProduct>   tps = new List <TransportProduct>();
                TransportProduct          tp;
                List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");

                foreach (Lebi_Order_Product pro in pros)
                {
                    tp                = new TransportProduct();
                    tp.Count          = pro.Count;
                    tp.ImageBig       = pro.ImageBig;
                    tp.ImageMedium    = pro.ImageMedium;
                    tp.ImageOriginal  = pro.ImageOriginal;
                    tp.ImageSmall     = pro.ImageSmall;
                    tp.Product_Number = pro.Product_Number;
                    tp.Product_id     = pro.Product_id;
                    tp.Product_Name   = pro.Product_Name;
                    tps.Add(tp);

                    pro.Count_Shipped = pro.Count;

                    B_Lebi_Order_Product.Update(pro);
                }

                JavaScriptSerializer jss = new JavaScriptSerializer();
                torder.Product = jss.Serialize(tps);
                torder.Type_id_TransportOrderStatus = 220;//默认状态:在途
                B_Lebi_Transport_Order.Add(torder);
                model.IsShipped     = 1;
                model.IsShipped_All = 1;

                B_Lebi_Order.Update(model);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Esempio n. 27
0
        /// <summary>
        /// 生成退货单
        /// </summary>
        public void torder_save()
        {
            int    order_id = RequestTool.RequestInt("order_id", 0);
            string opid     = RequestTool.RequestSafeString("opid");

            if (opid == "")
            {
                Response.Write("{\"msg\":\"" + Tag("未选择任何商品") + "\"}");
                return;
            }
            int        count = 0;
            Lebi_Order order = B_Lebi_Order.GetModel(order_id);

            if (order == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (order.User_id != CurrentUser.id)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            List <Lebi_Order_Product> ops = B_Lebi_Order_Product.GetList("id in (lbsql{" + opid + "}) and Order_id=" + order.id + "", "");

            foreach (Lebi_Order_Product op in ops)
            {
                int rcount = RequestTool.RequestInt("product_" + op.id, 0);
                if (rcount > (op.Count_Received - op.Count_Return))
                {
                    Response.Write("{\"msg\":\"" + Tag("退货数量不能大于收货数量") + "\"}");
                    return;
                }
                if (rcount < 1)
                {
                    Response.Write("{\"msg\":\"" + Tag("退货数量不能小于1") + "\"}");
                    return;
                }
                count = count + rcount;
            }
            if (count == 0)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            //CurrentUser.Count_Order = CurrentUser.Count_Order + 1;
            //B_Lebi_User.Update(CurrentUser);
            //foreach (Lebi_Order_Product op in ops)
            //{
            //    op.Count_Return = op.Count_Return + RequestTool.RequestInt("product_" + op.id, 0);
            //    B_Lebi_Order_Product.Update(op);
            //}
            Lebi_Order model = new Lebi_Order();

            model.Order_id          = order.id;
            model.User_id           = CurrentUser.id;
            model.User_UserName     = CurrentUser.UserName;
            model.T_Name            = order.T_Name;
            model.T_Address         = order.T_Address;
            model.T_Area_id         = order.T_Area_id;
            model.T_MobilePhone     = order.T_MobilePhone;
            model.T_Phone           = order.T_Phone;
            model.T_Postalcode      = order.T_Postalcode;
            model.Weight            = 0;
            model.Money_Product     = 0;
            model.Type_id_OrderType = 212;
            model.Code        = Shop.Bussiness.Order.CreateOrderCode();
            model.Supplier_id = order.Supplier_id;
            model.Site_id     = CurrentSite.id;
            model.Language_id = CurrentLanguage.id;
            B_Lebi_Order.Add(model);
            model.id = B_Lebi_Order.GetMaxId();

            foreach (Lebi_Order_Product op in ops)
            {
                count           = RequestTool.RequestInt("product_" + op.id, 0);
                op.Count_Return = op.Count_Return + count;
                B_Lebi_Order_Product.Update(op);

                op.Count          = count;
                op.Count_Shipped  = 0;
                op.Count_Received = 0;
                op.Order_Code     = model.Code;
                op.Order_id       = model.id;
                op.Money          = op.Price * op.Count;

                B_Lebi_Order_Product.Add(op);
                model.Money_Product = model.Money_Product + (op.Price - op.Money_Give_one - op.Money_Card312_one) * count;
                model.Weight        = model.Weight + op.Weight * count;
                model.Volume        = model.Weight + op.Volume * count;
                model.Point         = model.Point + op.Point_Give_one;
            }
            model.Money_Product = 0 - model.Money_Product;
            model.Money_Order   = model.Money_Product;
            model.Money_Pay     = model.Money_Product;
            model.Money_Give    = 0 - model.Money_Order;
            model.Point         = 0 - model.Point;
            B_Lebi_Order.Update(model);
            //处理留言
            Lebi_Comment com = new Lebi_Comment();

            com.Content       = RequestTool.RequestSafeString("say");
            com.Keyid         = model.id;
            com.TableName     = "Order";
            com.User_id       = CurrentUser.id;
            com.User_UserName = CurrentUser.UserName;
            B_Lebi_Comment.Add(com);
            Lebi_User  user       = B_Lebi_User.GetModel(CurrentUser.id);
            Lebi_Order ordermodel = B_Lebi_Order.GetModel("Order_id=" + order_id + "");

            //发送邮件
            if (ShopCache.GetBaseConfig().MailSign.ToLower().Contains("dingdantijiao") || ShopCache.GetBaseConfig().AdminMailSign.ToLower().Contains("ordersubmit"))
            {
                Email.SendEmail_ordersubmit(user, ordermodel);
            }
            //发送短信
            if (ShopCache.GetBaseConfig().SMS_sendmode.Contains("SMSTPL_ordersubmit") || ShopCache.GetBaseConfig().SMS_sendmode.Contains("SMSTPL_Admin_ordersubmit"))
            {
                SMS.SendSMS_ordersubmit(user, order);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Esempio n. 28
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            LoadTheme(themecode, siteid, languagecode, pcode);
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserComment", "") + "\"><span>" + Tag("商品评价") + "</span></a>";
            //key={0}&type={1}&status={2}&dateFrom={3}&dateTo={4}
            key      = Rstring("key");
            type     = Rint("type");
            status   = Rint("status");
            dateFrom = Rstring("dateFrom");
            dateTo   = Rstring("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            pageindex = RequestTool.RequestInt("page", 1);
            types     = B_Lebi_Type.GetList("Class='CommentStatus'", "sort desc");
            if (type == 0)
            {
                where = "Parentid = 0 and TableName = 'Product' and User_id=" + CurrentUser.id + "";
                if (key != "")
                {
                    where += " and (Content like lbsql{'%" + key + "%'})";
                }
                if (dateFrom != "" && dateTo != "")
                {
                    where += " and Time_Add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
                }
                if (status > 0)
                {
                    where += " and (Status = " + status + ")";
                }
                comments = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
                foreach (Lebi_Comment c in comments)
                {
                    c.IsRead = 1;
                    B_Lebi_Comment.Update(c);
                }
                int recordCount = B_Lebi_Comment.Counts(where);
                //string url = URL("P_UserComment", key + "," + type + "," + status + "," + dateFrom + "," + dateTo + ",{0}");
                //PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, page, PageSize, recordCount, CurrentLanguage);
                PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&type=" + type + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
            }
            else
            {
                //待评价商品
                where = "IsCommented = 0 and User_id=" + CurrentUser.id + " and id in(select id from [Lebi_Order_Product] where Order_id in(select id from [Lebi_Order] where User_id=" + CurrentUser.id + " and IsReceived = 1))";
                if (key != "")
                {
                    where += " and (Product_Name like lbsql{'%" + key + "%'})";
                }
                if (dateFrom != "" && dateTo != "")
                {
                    where += " and Time_Add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
                }
                order_products = B_Lebi_Order_Product.GetList(where, "id desc", PageSize, pageindex);
                int    recordCount = B_Lebi_Order_Product.Counts(where);
                string url         = URL("P_UserComment", key + "," + type + "," + status + "," + dateFrom + "," + dateTo + ",{0}");
                PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&type=" + type + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
            }
            NextPage = "?page=" + (pageindex + 1) + "&key=" + key + "&type=" + type + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "";
        }
Esempio n. 29
0
        /// <summary>
        /// 订单发货通知-不更新库存
        /// </summary>
        public void mSndGoods()
        {
            //OrderID	订单编号
            //OrderNO	原始订单编号
            //CustomerID	客户网名
            //SndStyle	发货方式
            //BillID	货运单号
            //SndDate	发货时间
            string             OrderID    = RequestTool.RequestString("OrderID");
            string             OrderNO    = RequestTool.RequestString("OrderNO");
            string             CustomerID = RequestTool.RequestString("CustomerID");
            string             SndStyle   = RequestTool.RequestString("SndStyle");
            string             BillID     = RequestTool.RequestString("BillID");
            string             SndDate    = RequestTool.RequestString("SndDate");
            Lebi_Order         model      = B_Lebi_Order.GetModel("Code=lbsql{'" + OrderNO + "'}");
            Lebi_Language_Code lang       = Language.DefaultLanguage();
            string             res        = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";

            if (model == null)
            {
                res += "<rsp><result>0</result><cause>无此单号</cause></rsp>";
                Response.Write(res);
                return;
            }

            Lebi_Transport tran = B_Lebi_Transport.GetModel("[Name]=lbsql{'" + SndStyle + "'}");

            if (tran == null)
            {
                tran = new Lebi_Transport();
            }
            Lebi_Transport_Order torder = new Lebi_Transport_Order();

            torder.Code     = BillID;
            torder.Order_id = model.id;

            torder.T_Address      = model.T_Address;
            torder.T_Email        = model.T_Email;
            torder.T_MobilePhone  = model.T_MobilePhone;
            torder.T_Name         = model.T_Name;
            torder.T_Phone        = model.T_Phone;
            torder.Transport_Code = tran == null ? model.Transport_Code : tran.Code;
            torder.Transport_id   = tran == null ? model.Transport_id : tran.id;
            torder.Transport_Name = tran == null ? model.Transport_Name : tran.Name;
            torder.User_id        = model.User_id;
            List <TransportProduct>   tps = new List <TransportProduct>();
            TransportProduct          tp;
            List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            bool isfahuo_all = true;

            foreach (Lebi_Order_Product pro in pros)
            {
                tp                = new TransportProduct();
                tp.Count          = pro.Count;
                tp.ImageBig       = pro.ImageBig;
                tp.ImageMedium    = pro.ImageMedium;
                tp.ImageOriginal  = pro.ImageOriginal;
                tp.ImageSmall     = pro.ImageSmall;
                tp.Product_Number = pro.Product_Number;
                tp.Product_id     = pro.Product_id;
                tp.Product_Name   = pro.Product_Name;
                tps.Add(tp);

                pro.Count_Shipped = pro.Count;

                B_Lebi_Order_Product.Update(pro);
                //更新库存
                Lebi_Product product = B_Lebi_Product.GetModel(pro.Product_id);
                EX_Product.ProductStock_Change(product, (0 - pro.Count), 302, model);
            }

            JavaScriptSerializer jss = new JavaScriptSerializer();

            torder.Product = jss.Serialize(tps);
            torder.Type_id_TransportOrderStatus = 220;//默认状态:在途
            B_Lebi_Transport_Order.Add(torder);
            model.IsShipped     = 1;
            model.IsShipped_All = isfahuo_all ? 1 : 0;
            model.Time_Shipped  = System.DateTime.Now;;
            B_Lebi_Order.Update(model);
            Log.Add("订单发货-网站管家", "Order", model.id.ToString());
            //发送邮件
            if (ShopCache.GetBaseConfig().MailSign.ToLower().Contains("dingdanfahuo"))
            {
                Lebi_User user = B_Lebi_User.GetModel(model.User_id);
                Email.SendEmail_ordershipping(user, model, torder);
            }
            res += "<rsp><result>1</result></rsp>";
            Response.Write(res);
            Log.Add("订单编号:" + OrderNO + "--" + res, "网店管家同步发货", "");
        }
Esempio n. 30
0
        /// <summary>
        /// 订单下载,获得一个订单的详细信息
        /// </summary>
        public void mGetOrder()
        {
            string             OrderNO = RequestTool.RequestString("OrderNO");
            Lebi_Order         model   = B_Lebi_Order.GetModel("Code=lbsql{'" + OrderNO + "'}");
            Lebi_Language_Code lang    = Language.DefaultLanguage();

            if (model == null)
            {
                Response.Write("无此单号");
                return;
            }
            List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            StringBuilder             sb   = new System.Text.StringBuilder();

            sb.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
            sb.Append("<Order>\r\n");
            sb.Append("<Ver>2.0</Ver>\r\n");
            //OrderNO	订单号
            sb.Append("<OrderNO>" + model.Code + "</OrderNO>\r\n");
            //DateTime	成交日期
            sb.Append("<DateTime>" + model.Time_Add.ToString("yyyy-MM-dd HH:mm:ss") + "</DateTime>\r\n");
            //BuyerID	买家用户名
            sb.Append("<BuyerID>" + FormatXMLStr(model.User_UserName) + "</BuyerID>\r\n");
            //BuyerName	买家姓名
            sb.Append("<BuyerName>" + FormatXMLStr(model.T_Name) + "</BuyerName>\r\n");
            //Country	国家
            sb.Append("<Country>" + FormatXMLStr(EX_Area.GetAreaNameNoPath(model.T_Area_id, 4)) + "</Country>\r\n");
            //Province	省/州
            sb.Append("<Province>" + FormatXMLStr(EX_Area.GetAreaNameNoPath(model.T_Area_id, 3)) + "</Province>\r\n");
            //City	市/县
            sb.Append("<City>" + FormatXMLStr(EX_Area.GetAreaNameNoPath(model.T_Area_id, 2)) + "</City>\r\n");
            //Town	区/镇
            sb.Append("<Town>" + FormatXMLStr(EX_Area.GetAreaNameNoPath(model.T_Area_id, 1)) + "</Town>\r\n");
            //Adr	地址
            sb.Append("<Adr>" + FormatXMLStr(model.T_Address) + "</Adr>\r\n");
            //Zip	邮编
            sb.Append("<Zip>" + FormatXMLStr(model.T_Postalcode) + "</Zip>\r\n");
            //Email	Email
            sb.Append("<Email>" + FormatXMLStr(model.T_Email) + "</Email>\r\n");
            //Phone	联系电话
            sb.Append("<Phone>" + FormatXMLStr(model.T_MobilePhone) + "</Phone>\r\n");
            //Total	货款总额
            sb.Append("<Total>" + model.Money_Product + "</Total>\r\n");
            //Postage	货运费用
            sb.Append("<Postage>" + model.Money_Transport + "</Postage>\r\n");
            //PayAccount	支付方式
            sb.Append("<PayAccount>" + FormatXMLStr(Language.Content(model.Pay, lang.Code)) + "</PayAccount>\r\n");
            //PayID	支付编号
            sb.Append("<PayID></PayID>\r\n");
            //LogisticsName	发货方式
            sb.Append("<LogisticsName>" + FormatXMLStr(model.Transport_Name) + "</LogisticsName>\r\n");
            //Chargetype	结算方式
            sb.Append("<Chargetype>" + FormatXMLStr(Language.Content(model.OnlinePay, lang.Code)) + "</Chargetype>\r\n");
            //CustomerRemark	客户备注
            //发票信息

            sb.Append("<CustomerRemark>" + FormatXMLStr(model.Remark_User) + "</CustomerRemark>\r\n");
            //Remark	客服备注
            sb.Append("<Remark>" + FormatXMLStr(model.Remark_Admin) + "</Remark>\r\n");

            foreach (Lebi_Order_Product pro in pros)
            {
                Lebi_Product p = B_Lebi_Product.GetModel(pro.Product_id);
                if (p == null)
                {
                    continue;
                }
                sb.Append(" <Item>\r\n");
                //GoodsID	库存编码
                sb.Append(" <GoodsID>" + FormatXMLStr(pro.Product_Number) + "</GoodsID>\r\n");
                //GoodsName	货品名称
                sb.Append(" <GoodsName>" + FormatXMLStr(Language.Content(pro.Product_Name, lang.Code)) + "</GoodsName>\r\n");
                //GoodsSpec	货品规格
                //sb.Append(" <GoodsSpec>" + FormatXMLStr(EX_Product.ProPertyNameStr(p.ProPerty131, lang)) + "</GoodsSpec>\r\n");
                sb.Append(" <GoodsSpec></GoodsSpec>\r\n");//书生定制
                //Count	数量
                sb.Append(" <Count>" + pro.Count + "</Count>\r\n");
                //Price	单价
                sb.Append(" <Price>" + pro.Price + "</Price>\r\n");
                sb.Append(" </Item>\r\n");
            }


            sb.Append("</Order>\r\n");
            Log.Add(sb.ToString(), "网店管家下载订单", "");
            Response.Write(sb.ToString());
        }