Example #1
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        public void GetUsers()
        {
            int id   = RequestTool.RequestInt("user_id", 0);
            int size = RequestTool.RequestInt("size", 1);

            size = size < 0 ? 0 : size;
            size = size > 50 ? 50 : size;
            List <Lebi_User> users  = B_Lebi_User.GetList("id>=" + id, "id asc", size, 1);
            List <apiUser>   models = new List <apiUser>();
            apiUser          model;

            foreach (Lebi_User user in users)
            {
                model                  = new apiUser();
                model.Address          = user.Address;
                model.Password         = user.Password;
                model.Area             = EX_Area.GetAreaName(user.Area_id, 4);
                model.Birthday         = user.Birthday;
                model.CashAccount_Bank = user.CashAccount_Bank;
                model.CashAccount_Code = user.CashAccount_Code;
                model.CashAccount_Name = user.CashAccount_Name;
                model.City             = user.City;
                model.Count_Login      = user.Count_Login;
                model.Currency_Code    = user.Currency_Code;
                model.Email            = user.Email;
                model.Face             = user.Face;
                model.Fax              = user.Fax;
                model.id               = user.id;
                model.Introduce        = user.Introduce;
                model.IP_Last          = user.IP_Last;
                model.IP_This          = user.IP_This;
                model.Language         = user.Language;
                model.MobilePhone      = user.MobilePhone;
                model.Money            = user.Money;
                model.Money_xiaofei    = user.Money_xiaofei;
                model.Msn              = user.Msn;
                model.NickName         = user.NickName;
                model.Phone            = user.Phone;
                model.Point            = user.Point;
                model.Postalcode       = user.Postalcode;
                model.QQ               = user.QQ;
                model.RealName         = user.RealName;
                model.Sex              = user.Sex;
                model.Time_Last        = user.Time_Last;
                model.Time_lastorder   = user.Time_lastorder;
                model.Time_Reg         = user.Time_Reg;
                model.Time_This        = user.Time_This;
                model.UserName         = user.UserName;

                models.Add(model);
            }
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string json = jss.Serialize(models);
            LBAPI  api  = new LBAPI();

            api.data = json;
            api.msg  = "OK";
            json     = jss.Serialize(api);
            Response.Write(json);
        }
Example #2
0
        /// <summary>
        /// 确认收货
        /// </summary>
        public void Received()
        {
            int id  = RequestTool.RequestInt("id", 0);
            int tid = RequestTool.RequestInt("tid", 0);
            Lebi_Transport_Order torder = B_Lebi_Transport_Order.GetModel("User_id=" + CurrentUser.id + " and id = " + tid);

            if (torder == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (torder.Type_id_TransportOrderStatus != 220)
            {
                Response.Write("{\"msg\":\"" + Tag("当前状态不可收货") + "\"}");
                return;
            }
            if (torder.User_id != CurrentUser.id)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            torder.Type_id_TransportOrderStatus = 223;
            torder.Time_Received = System.DateTime.Now;
            B_Lebi_Transport_Order.Update(torder);
            EX_Area.UpdateShouHuoCount(torder);
            //发送短信
            SMS.SendSMS_orderrecive(CurrentUser, torder);
            Response.Write("{\"msg\":\"OK\"}");
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_shipping", "订单发货"))
            {
                WindowNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            torder = B_Lebi_Transport_Order.GetModel(id);
            if (torder == null)
            {
                Response.Write(Tag("参数错误"));
                Response.End();
                return;
            }
            log = EX_Area.GetKuaiDi100(torder);
        }
Example #4
0
        public decimal GetYunFei(Lebi_Transport_Price price, BasketShop shop)
        {
            if (shop.IsTransportPriceOne)
            {
                return(shop.Money_Transport_One);
            }
            //Lebi_Transport_Price price = B_Lebi_Transport_Price.GetModel("Supplier_id in (" + CurrentUser.Transport_Price_id + ") and Supplier_id=" + shop.Shop.id + "");
            List <Lebi_User_Product> pros = shop.Products;

            try
            {
                return(EX_Area.GetYunFei(pros, price, shop.Money_Product));
            }
            catch
            {
                return(0);
            }
        }
Example #5
0
        /// <summary>
        /// 生成新订单
        /// </summary>
        public void order_save()
        {
            if (CurrentUserLevel.BuyRight != 1)
            {
                Response.Write("{\"msg\":\"" + Tag("您所在的分组不允许下单") + "\"}");
                return;
            }
            int         pay_id        = RequestTool.RequestInt("pay_id", 0);
            int         sid           = RequestTool.RequestInt("sid", 0);//结算供应商ID
            int         onlinepay_id  = RequestTool.RequestInt("onlinepay_id", 0);
            decimal     Money_UserCut = RequestTool.RequestDecimal("Money_UserCut", 0);
            int         usermoneytype = RequestTool.RequestInt("usermoneytype", 0);
            string      Pay_Password  = RequestTool.RequestSafeString("Pay_Password");
            Lebi_PickUp pick          = null;
            DateTime    pickdate      = System.DateTime.Now;

            if (usermoneytype == 3)
            {
                if (Pay_Password == "")
                {
                    Response.Write("{\"msg\":\"" + Tag("请输入支付密码") + "\"}");
                    return;
                }
                else
                {
                    if (EX_User.MD5(Pay_Password) != CurrentUser.Pay_Password)
                    {
                        Response.Write("{\"msg\":\"" + Tag("支付密码不正确") + "\"}");
                        return;
                    }
                }
                if (Money_UserCut > 0 && Money_UserCut > CurrentUser.Money)
                {
                    Response.Write("{\"msg\":\"" + Tag("余额不足") + "\"}");
                    return;
                }
            }
            Lebi_Pay pay = B_Lebi_Pay.GetModel(pay_id);

            if (pay == null)
            {
                Response.Write("{\"msg\":\"" + Tag("请设置付款方式") + "\"}");
                return;
            }
            Basket  basket             = new Basket(sid);
            int     CustomOfflineMoney = RequestTool.RequestInt("CustomOfflineMoney" + pay.id, 0);
            decimal OfflineMoney       = RequestTool.RequestDecimal("OfflineMoney" + pay.id, 0);

            if (CustomOfflineMoney == 1)
            {
                if (pay.Code != "OfflinePay" && pay.Code != "OnlinePay")
                {
                    //订单如果选择了线下支付,并且非货到付款
                    if (OfflineMoney < basket.Money_Product)
                    {
                        Response.Write("{\"msg\":\"" + Tag("打款金额不能少于订单金额") + "\"}");
                        return;
                    }
                }
            }
            if (pay.Code == "OnlinePay")
            {
                Lebi_OnlinePay onpay = B_Lebi_OnlinePay.GetModel(onlinepay_id);
                if (onpay == null)
                {
                    Response.Write("{\"msg\":\"" + Tag("请设置付款方式") + "\"}");
                    return;
                }
            }

            if (basket.Products.Count == 0)
            {
                Response.Write("{\"msg\":\"" + Tag("购物车为空") + "\"}");
                return;
            }
            foreach (Lebi_User_Product up in basket.Products)
            {
                if (up.count < 1)
                {
                    Response.Write("{\"msg\":\"" + Tag("购物车异常") + "\"}");
                    return;
                }
            }
            if (basket.Point_Buy > 0 && (basket.Point_Buy > CurrentUser.Point))
            {
                Response.Write("{\"msg\":\"" + Tag("积分不足") + "\"}");
                return;
            }
            int ProductCount = 0;

            foreach (Lebi_User_Product up in basket.Products)
            {
                Lebi_Product pro = B_Lebi_Product.GetModel(up.Product_id);
                if (pro.Type_id_ProductType != 323)
                {
                    ProductCount += up.count;
                }
                //<-{ 判断是否上架状态 by lebi.kingdge 2015-02-10
                if (pro.Type_id_ProductStatus != 101)
                {
                    Response.Write("{\"msg\":\"" + Lang(pro.Name) + " " + Tag("该商品已经下架") + "\"}");
                    return;
                }
                //}->
                if (pro.Type_id_ProductType != 324)
                {
                    int levelcount = ProductLevelCount(pro);
                    if (up.count < levelcount)
                    {
                        Response.Write("{\"msg\":\"" + Lang(pro.Name) + " " + Tag("起订量") + " " + levelcount + "\"}");
                        return;
                    }
                }
                if (pro.Type_id_ProductType != 320 && pro.Time_Expired > System.DateTime.Now)
                {
                    if (pro.Count_Limit < up.count && pro.Count_Limit > 0)
                    {
                        Response.Write("{\"msg\":\"" + Tag("购买数量大于限购数量") + "\"}");
                        return;
                    }
                }
                if (SYS.IsNullStockSale != "1")
                {
                    if (pro.Count_Stock - pro.Count_Freeze < up.count && pro.Type_id_ProductType != 324)
                    {
                        Response.Write("{\"msg\":\"" + Lang(pro.Name) + "" + Tag("库存不足") + "\"}");
                        return;
                    }
                }
            }
            //验证当前分组允许的最低订单提交金额
            if (CurrentUserLevel.OrderSubmit > 0)
            {
                if (basket.Money_Product < CurrentUserLevel.OrderSubmit)
                {
                    Response.Write("{\"msg\":\"" + Tag("单笔订单最低金额为:") + FormatMoney(CurrentUserLevel.OrderSubmit) + "\"}");
                    return;
                }
            }
            //验证当前分组允许的最低订单提交数量
            if (CurrentUserLevel.OrderSubmitCount > 0 && ProductCount > 0)
            {
                if (ProductCount < CurrentUserLevel.OrderSubmitCount)
                {
                    Response.Write("{\"msg\":\"" + Tag("单笔订单最低数量为:") + CurrentUserLevel.OrderSubmitCount + "\"}");
                    return;
                }
            }
            Lebi_User_Address shouhuo = B_Lebi_User_Address.GetModel(CurrentUser.User_Address_id);

            if (shouhuo == null)
            {
                Response.Write("{\"msg\":\"" + Tag("未设置收获地址") + "\"}");
                return;
            }
            if (CurrentUser.Transport_Price_id == "")
            {
                Response.Write("{\"msg\":\"" + Tag("运费设置错误") + "\"}");
                return;
            }

            foreach (BasketShop shop in basket.Shops)
            {
                Lebi_Transport_Price tprice = B_Lebi_Transport_Price.GetModel("id in (lbsql{" + CurrentUser.Transport_Price_id + "}) and Supplier_id=" + shop.Shop.id + "");
                if (tprice == null)
                {
                    Response.Write("{\"msg\":\"" + Tag("运费设置错误") + "\"}");
                    return;
                }
                Lebi_Transport transport = B_Lebi_Transport.GetModel(tprice.Transport_id);
                if (tprice == null)
                {
                    Response.Write("{\"msg\":\"" + Tag("运费设置错误") + "\"}");
                    return;
                }
                //检查运费设置是否正确
                if (!EX_Area.CheckAreaPrice(tprice, shouhuo.Area_id))
                {
                    Response.Write("{\"msg\":\"" + Tag("运费设置错误") + "\"}");
                    return;
                }
                if (transport.Type_id_TransportType == 332)//自提检查
                {
                    int    pickup_id = RequestTool.RequestInt("pickup_id" + shop.Shop.id);
                    string pickdate_ = RequestTool.RequestString("pickupdate_" + pickup_id);

                    try
                    {
                        pickdate = Convert.ToDateTime(pickdate_);
                    }
                    catch
                    {
                        Response.Write("{\"msg\":\"" + Tag("配送方式设置错误") + "\"}");
                        return;
                    }

                    pick = B_Lebi_PickUp.GetModel(pickup_id);
                    if (pick == null)
                    {
                        Response.Write("{\"msg\":\"" + Tag("配送方式设置错误") + "\"}");
                        return;
                    }
                    if (pick.IsCanWeekend == 0 && (pickdate.DayOfWeek == DayOfWeek.Saturday || pickdate.DayOfWeek == DayOfWeek.Sunday))
                    {
                        Response.Write("{\"msg\":\"" + Tag("配送方式设置错误") + "\"}");
                        return;
                    }
                    if (System.DateTime.Now.Date.AddDays(pick.BeginDays) > pickdate)
                    {
                        Response.Write("{\"msg\":\"" + Tag("配送方式设置错误") + "\"}");
                        return;
                    }
                    string NoServiceDays = pick.NoServiceDays.TrimStart('0').Replace(".0", ".");
                    string nowday        = pickdate.ToString("M.d");
                    if (("," + NoServiceDays + ",").Contains("," + nowday + ","))
                    {
                        Response.Write("{\"msg\":\"" + Tag("配送方式设置错误") + "\"}");
                        return;
                    }
                }
            }
            //检查代金券
            string pay312 = RequestTool.RequestSafeString("pay312");

            if (pay312 != "")
            {
                List <Lebi_Card> cs = B_Lebi_Card.GetList("User_id=" + CurrentUser.id + " and id in (lbsql{" + pay312 + "})", "id asc");
                int flag            = cs.FirstOrDefault().IsCanOtherUse;
                if (flag == 0 && cs.Count > 1)
                {
                    Response.Write("{\"msg\":\"" + Tag("代金券异常") + "\"}");
                    return;
                }
                foreach (Lebi_Card c in cs)
                {
                    if (flag != c.IsCanOtherUse)
                    {
                        Response.Write("{\"msg\":\"" + Tag("代金券异常") + "\"}");
                        return;
                    }
                    if (!Basket.CheckCard(basket, c))
                    {
                        Response.Write("{\"msg\":\"" + Tag("代金券异常") + "\"}");
                        return;
                    }
                }
            }
            //检查代金券结束
            //检查发票信息
            int           billtype_id = RequestTool.RequestInt("billtype_id", 0);
            Lebi_BillType billtype    = B_Lebi_BillType.GetModel(billtype_id);

            if (ShopCache.GetBaseConfig().BillFlag == "1")
            {
                if (billtype == null)
                {
                    Response.Write("{\"msg\":\"" + Tag("请设置发票内容") + "\"}");
                    return;
                }
            }
            CurrentUser.Pay_id       = pay.id;
            CurrentUser.OnlinePay_id = onlinepay_id;
            Lebi_Order        ordergroup;
            List <Lebi_Order> orders = Shop.Bussiness.Order.CreateOrder(CurrentUser, basket, shouhuo, billtype, CurrentCurrency, CurrentSite, CurrentLanguage, out ordergroup);

            CurrentUser.Count_Order = CurrentUser.Count_Order + orders.Count;
            B_Lebi_User.Update(CurrentUser);
            List <Lebi_Order> ordermodel = B_Lebi_Order.GetList("User_id=" + CurrentUser.id + "", "id desc");

            ordergroup = ordermodel.FirstOrDefault();
            if (OfflineMoney == 0)
            {
                OfflineMoney = ordergroup.Money_Order;
            }
            string remark = RequestTool.RequestSafeString("remark");

            ordergroup.Remark_User = remark;
            bool needupdate = false;

            if (remark != "")
            {
                Lebi_Comment model = new Lebi_Comment();
                model.Content       = remark;
                model.Keyid         = ordergroup.id;
                model.TableName     = "Order";
                model.User_id       = CurrentUser.id;
                model.User_UserName = CurrentUser.UserName;
                B_Lebi_Comment.Add(model);
                needupdate = true;
            }

            if (pick != null)
            {
                ordergroup.PickUp_Date = pickdate;
                ordergroup.PickUp_id   = pick.id;
                ordergroup.PickUp_Name = pick.Name;
                needupdate             = true;
            }
            if (needupdate)
            {
                B_Lebi_Order.Update(ordergroup);
            }

            if (pay.Code != "OfflinePay" && pay.Code != "OnlinePay")
            {
                //订单如果选择了线下支付,并且非货到付款
                //生成一笔充值单
                //OfflineMoney

                Lebi_Currency DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1");
                if (DefaultCurrency == null)
                {
                    DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault();
                }
                Lebi_Order order = new Lebi_Order();
                order.Code                  = "M" + Shop.Bussiness.Order.CreateOrderCode();
                order.Money_Order           = OfflineMoney;
                order.Money_Pay             = OfflineMoney;
                order.User_id               = CurrentUser.id;
                order.User_UserName         = CurrentUser.UserName;
                order.IsPaid                = 0;
                order.Currency_Code         = ordergroup.Currency_Code;
                order.Currency_ExchangeRate = ordergroup.Currency_ExchangeRate;
                order.Currency_id           = ordergroup.Currency_id;
                order.Currency_Msige        = ordergroup.Currency_Msige;
                order.Type_id_OrderType     = 214;
                order.Pay_id                = pay.id;
                order.Pay          = pay.Name;
                order.Site_id      = CurrentSite.id;
                order.Language_id  = CurrentLanguage.id;
                order.Remark_Admin = "";
                order.Order_id     = ordergroup.id;
                B_Lebi_Order.Add(order);
            }
            //if (orders.Count == 1)
            //    ordergroup = orders.FirstOrDefault();
            //Shop.Bussiness.Order.SupplierOrder(order);//根据商品供应商分单
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + ordergroup.id + "\"}");
            return;
        }
        /// <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());
        }
Example #7
0
        /// <summary>
        /// 获取订单
        /// </summary>
        public void GetOrders()
        {
            int id   = RequestTool.RequestInt("order_id", 0);
            int size = RequestTool.RequestInt("size", 1);

            size = size < 0 ? 0 : size;
            size = size > 50 ? 50 : size;
            List <Lebi_Order> orders = B_Lebi_Order.GetList("id>=" + id, "id asc", size, 1);
            List <apiOrder>   models = new List <apiOrder>();
            apiOrder          model;
            string            domain = "http://" + RequestTool.GetRequestDomain();
            int port = RequestTool.GetRequestPort();

            if (port != 80)
            {
                domain = domain + ":" + port;
            }
            foreach (Lebi_Order order in orders)
            {
                model                       = new apiOrder();
                model.Code                  = order.Code;
                model.Currency_Code         = order.Code;
                model.Currency_ExchangeRate = order.Currency_ExchangeRate;
                model.Currency_Msige        = order.Currency_Msige;
                model.id                    = order.id;
                model.IsCompleted           = order.IsCompleted;

                model.IsInvalid       = order.IsInvalid;
                model.IsPaid          = order.IsPaid;
                model.IsReceived      = order.IsReceived;
                model.IsReceived_All  = order.IsReceived_All;
                model.IsShipped       = order.IsShipped;
                model.IsShipped_All   = order.IsShipped_All;
                model.IsVerified      = order.IsVerified;
                model.Money_Bill      = order.Money_Bill;
                model.Money_Market    = order.Money_Market;
                model.Money_Order     = order.Money_Order;
                model.Money_Product   = order.Money_Product;
                model.Money_Transport = order.Money_Transport;
                model.OnlinePay       = order.OnlinePay;
                model.OnlinePay_Code  = order.OnlinePay_Code;
                model.Pay             = order.Pay;
                model.Point           = order.Point;
                model.Point_Buy       = order.Point_Buy;
                model.Remark_Admin    = order.Remark_Admin;
                model.Remark_User     = order.Remark_User;
                model.T_Address       = order.T_Address;
                model.T_Area          = EX_Area.GetAreaName(order.T_Area_id, 4);
                model.T_Email         = order.T_Email;
                model.T_MobilePhone   = order.T_MobilePhone;
                model.T_Name          = order.T_Name;
                model.T_Phone         = order.T_Phone;
                model.T_Postalcode    = order.T_Postalcode;
                model.Time_Add        = order.Time_Add;
                model.Time_Completed  = order.Time_Completed;
                model.Time_Paid       = order.Time_Paid;
                model.Time_Received   = order.Time_Received;
                model.Time_Shipped    = order.Time_Shipped;
                model.Time_Verified   = order.Time_Verified;
                model.Transport_Code  = order.Transport_Code;
                model.Transport_Mark  = order.Transport_Mark;
                model.Transport_Name  = order.Transport_Name;
                model.OrderType       = EX_Type.TypeName(order.Type_id_OrderType);
                model.User_id         = order.User_id;
                model.User_UserName   = order.User_UserName;
                model.Volume          = order.Volume;
                model.Weight          = order.Weight;
                List <apiOrderProduct>    products = new List <apiOrderProduct>();
                List <Lebi_Order_Product> pros     = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", "");
                apiOrderProduct           product;
                foreach (Lebi_Order_Product pro in pros)
                {
                    product            = new apiOrderProduct();
                    product.Count      = pro.Count;
                    product.Guige      = "";
                    product.ImageBig   = domain + pro.ImageBig;
                    product.ImageSmall = domain + pro.ImageSmall;
                    product.Name       = Language.Content(pro.Product_Name, "CN");
                    product.Number     = pro.Product_Number;
                    product.Price      = pro.Price;
                    product.URL        = domain + URL("P_Product", pro.Product_id);
                    products.Add(product);
                }
                model.Products = products;
                models.Add(model);
            }
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string json = jss.Serialize(models);
            LBAPI  api  = new LBAPI();

            api.data = json;
            api.msg  = "OK";
            json     = jss.Serialize(api);
            Response.Write(json);
        }
Example #8
0
        /// <summary>
        /// 可选运输方式
        /// </summary>
        /// <param name="shop"></param>
        /// <param name="areaid"></param>
        /// <returns></returns>
        public List <Lebi_Transport_Price> GetTPrices(int areaid, int supid)
        {
            List <Lebi_Transport_Price> TPrices = EX_Area.TransportPrices_Get(areaid, supid);

            return(TPrices);
        }
Example #9
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_ShopSearch'");
            keyword     = RequestTool.RequestSafeString("keyword");
            string key = RequestTool.RequestSafeString("key");

            if (keyword == "" && key != "")
            {
                keyword = key;
            }
            sort    = Rstring_Para("1");
            area_id = RequestTool.RequestInt("area_id", 0);
            id      = 0;
            where   = "Supplier_Group_id in (select w.id from [Lebi_Supplier_Group] as w where w.type='supplier' or w.type='')";
            path    = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a class=\"text\"><span>" + Tag("µêÆÌËÑË÷") + "</span></a><em>&raquo;</em><a class=\"text\"><span>¡°" + keyword + "¡±</span></a>";

            if (keyword != "")
            {
                string wherekeyword = "";
                if (keyword.IndexOf(" ") > -1)
                {
                    string[] keywordsArr;
                    keywordsArr = keyword.Split(new char[1] {
                        ' '
                    });
                    foreach (string keywords in keywordsArr)
                    {
                        if (keywords != "")
                        {
                            if (wherekeyword == "")
                            {
                                wherekeyword = "(Name like lbsql{'%" + keywords + "%'} or SubName like lbsql{'%" + keywords + "%'})";
                            }
                            else
                            {
                                wherekeyword += " and (Name like lbsql{'%" + keywords + "%'} or SubName like lbsql{'%" + keywords + "%'})";
                            }
                        }
                    }
                }
                else
                {
                    wherekeyword = "(Name like lbsql{'%" + keyword + "%'} or SubName like lbsql{'%" + keyword + "%'})";
                }
                where = wherekeyword;
            }
            if (area_id > 0)
            {
                where += " and area_id in (" + EX_Area.Area_ids(area_id) + ")";
            }

            //SQLDataAccess.SQLPara sp = new SQLDataAccess.SQLPara(where, "id desc", "*");
            shops       = B_Lebi_Supplier.GetList(where, "id desc", PageSize, pageindex);
            recordCount = B_Lebi_Supplier.Counts(where);
            string url = URL("P_ShopSearch", keyword + "," + sort + ",{0}");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage = URL("P_ShopSearch", keyword + "," + sort + "," + (pageindex + 1) + "");
        }