Example #1
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);
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserOrderDetails'");
     id          = Rint("id");
     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.Type_id_OrderType == 212)
     {
         Response.Redirect(URL("P_UserReturnDetails", 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_UserOrders", "") + "\"><span>" + Tag("我的订单") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserOrderDetails", id) + "\"><span>" + Tag("订单") + ":" + order.Code + "</span></a>";
     CurrentPage      = B_Lebi_Theme_Page.GetModel("Code='P_UserOrderDetails'");
     id               = Rint_Para("0");
     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");
     pay              = B_Lebi_Pay.GetModel(order.Pay_id);
     if (pay == null)
     {
         pay = new Lebi_Pay();
     }
 }
Example #2
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            if (CurrentUser.id == 0)
            {
                //Response.Redirect("login.aspx");
                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_Basket", "") + "\"><span>" + Tag("购物车") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_Cashier", "") + "\"><span>" + Tag("订单已提交") + "</span></a>";

            order_id = Rint("order_id");
            order    = B_Lebi_Order.GetModel(order_id);
            if (order == null)
            {
                PageError();
            }
            if (order.User_id != CurrentUser.id || order.IsVerified != 0)
            {
                PageError();
            }
            else
            {
                if (order.Type_id_OrderType == 215)
                {
                    List <Lebi_Order> ors   = B_Lebi_Order.GetList("Order_id=" + order.id + "", "");
                    decimal           moeny = 0;
                    foreach (Lebi_Order or in ors)
                    {
                        moeny += or.Money_Pay;
                    }
                    order.Money_Pay = moeny;
                    B_Lebi_Order.Update(order);
                }
            }
        }
Example #3
0
        /// <summary>
        /// 收货确认后,更新订单产品的收货数量
        /// </summary>
        /// <param name="torder"></param>
        public static void UpdateShouHuoCount(Lebi_Transport_Order torder)
        {
            if (torder.Type_id_TransportOrderStatus != 223)
            {
                return;
            }
            Lebi_Order order = B_Lebi_Order.GetModel(torder.Order_id);

            if (order == null)
            {
                return;
            }
            List <Lebi_Order_Product>   ops     = B_Lebi_Order_Product.GetList("Order_id=" + torder.Order_id + "", "");
            List <Lebi_Transport_Order> torders = B_Lebi_Transport_Order.GetList("Order_id=" + torder.Order_id + " and Type_id_TransportOrderStatus=223", "");

            //bool shouhuoall = true;
            foreach (Lebi_Order_Product op in ops)
            {
                //op.Count_Received = 0;
                foreach (Lebi_Transport_Order to in torders)
                {
                    foreach (TransportProduct p in GetTransportProduct(to))
                    {
                        if (p.Product_id == op.Product_id)
                        {
                            op.Count_Received = op.Count_Received + p.Count;
                            if (op.Count_Shipped < op.Count_Received)
                            {
                                op.Count_Received = op.Count_Shipped;
                            }
                            break;
                        }
                    }
                }
                //if (op.Count_Received < op.Count_Shipped)
                //    shouhuoall = false;
                B_Lebi_Order_Product.Update(op);//更新收货数量
            }
            order.IsReceived     = 1;
            order.IsReceived_All = 1;
            ops = B_Lebi_Order_Product.GetList("Order_id=" + torder.Order_id + "", "");
            foreach (Lebi_Order_Product op in ops)
            {
                if (op.Count_Received < op.Count_Shipped)
                {
                    order.IsReceived_All = 0;
                }
            }
            order.Time_Received = System.DateTime.Now;
            B_Lebi_Order.Update(order);
            if (order.IsReceived_All == 1)//全部收货完成
            {
                Order.Received(order);
            }
        }
Example #4
0
        /// <summary>
        /// 订单留言
        /// </summary>
        /// <param name="user"></param>
        public static void SendSMS_ordercomment(Lebi_User user, Lebi_Comment model)
        {
            BaseConfig conf          = ShopCache.GetBaseConfig();
            int        IsAdminSms    = 0;
            int        IsSupplierSms = 0;

            if (conf.SMS_sendmode.Contains("SMSTPL_Admin_ordercomment"))
            {
                IsAdminSms = 1;
            }
            Lebi_Order order = B_Lebi_Order.GetModel(model.Keyid);

            if (order == null)
            {
                order = new Lebi_Order();
            }
            if (order.Supplier_id > 0)
            {
                Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id);
                if (supplier.IsSupplierTransport == 0)  //商家发货
                {
                    if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_ordercomment"))
                    {
                        IsSupplierSms = 1;
                    }
                }
            }
            if (IsAdminSms == 0 && IsSupplierSms == 0)
            {
                return;
            }
            if (user.Language == "")
            {
                user.Language = Language.Languages().FirstOrDefault().Code;
            }
            string Admin_content = Language.Content(conf.SMSTPL_Admin_ordercomment, user.Language);

            Admin_content = ReplaceSMSTag(Admin_content, user, conf);
            Admin_content = Admin_content.Replace("{$Content}", model.Content);
            Admin_content = Admin_content.Replace("{$OrderNO}", order.Code);
            if (IsAdminSms == 1)
            {
                Send(conf.SMS_reciveno, Admin_content);
            }
            if (IsSupplierSms == 1)
            {
                BaseConfig_Supplier config_supplier = ShopCache.GetBaseConfig_Supplier(order.Supplier_id);
                Send(config_supplier.SMS_reciveno, Admin_content);
            }
        }
Example #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);
     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;
         }
     }
 }
Example #6
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            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_Pay", "") + "\"><span>" + Tag("在线付款") + "</span></a>";

            order_id = Rint("order_id");
            order    = B_Lebi_Order.GetModel(order_id);
            if (order == null)
            {
                PageError();
            }
            if (order.User_id != CurrentUser.id || order.IsInvalid == 1 || order.IsPaid == 1)
            {
                PageError();
            }
            else
            {
                if (order.Type_id_OrderType == 215)
                {
                    List <Lebi_Order> ors   = B_Lebi_Order.GetList("Order_id=" + order.id + "", "");
                    decimal           moeny = 0;
                    foreach (Lebi_Order or in ors)
                    {
                        moeny += or.Money_Pay;
                    }
                    order.Money_Pay = moeny;
                    B_Lebi_Order.Update(order);
                }
            }
            string onpaywhere = "IsUsed=1 and parentid=0";

            if (CurrentSite.IsMobile == 1)
            {
                onpaywhere += " and (showtype='' or showtype like '%wap%')";
            }
            else
            {
                onpaywhere += " and (showtype='' or showtype like '%web%')";
            }
            onlinepays     = B_Lebi_OnlinePay.GetList(onpaywhere, "Sort desc");
            order_products = B_Lebi_Order_Product.GetList("Order_id = " + order.id, "id desc");
        }
Example #7
0
        /// <summary>
        /// 订单收货
        /// </summary>
        /// <param name="user"></param>
        /// <param name="torder"></param>
        public static void SendSMS_orderrecive(Lebi_User user, Lebi_Transport_Order torder)
        {
            BaseConfig conf          = ShopCache.GetBaseConfig();
            int        IsAdminSms    = 0;
            int        IsSupplierSms = 0;

            if (conf.SMS_sendmode.Contains("SMSTPL_Admin_orderrecive"))
            {
                IsAdminSms = 1;
            }
            Lebi_Order order = B_Lebi_Order.GetModel("id=" + torder.Order_id + "");

            if (order.Supplier_id > 0)
            {
                if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_orderrecive"))
                {
                    IsSupplierSms = 1;
                }
            }
            if (IsAdminSms == 0 && IsSupplierSms == 0)
            {
                return;
            }
            if (user.Language == "")
            {
                user.Language = Language.Languages().FirstOrDefault().Code;
            }
            string Admin_content = Language.Content(conf.SMSTPL_Admin_orderrecive, user.Language);

            Admin_content = ReplaceSMSTag(Admin_content, user, conf);
            Admin_content = Admin_content.Replace("{$OrderNO}", order.Code);
            if (IsAdminSms == 1)
            {
                Send(conf.SMS_reciveno, Admin_content);
            }
            if (IsSupplierSms == 1)
            {
                BaseConfig_Supplier config_supplier = ShopCache.GetBaseConfig_Supplier(order.Supplier_id);
                Send(config_supplier.SMS_reciveno, Admin_content);
            }
        }
Example #8
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);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnShip'");
            id          = Rint("id");
            tid         = Rint("id");
            order       = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + "");
            if (order == null)
            {
                PageError();
            }
            if (order.User_id != CurrentUser.id)
            {
                PageError();
            }
            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_UserReturnDetails", "" + id + "") + "\"><span>" + Tag("订单") + ":" + order.Code + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturnShip", "") + "\"><span>" + Tag("发货") + "</span></a>";

            where          = "Order_id=" + order.id + "";
            order_products = B_Lebi_Order_Product.GetList(where, "id desc");
        }
Example #9
0
        public static Lebi_OnlinePay GetOnlinePay(string ordercode, string paycode)
        {
            Lebi_Order order = B_Lebi_Order.GetModel("Code=lbsql{'" + ordercode + "'}");

            return(GetOnlinePay(order, paycode));
        }