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("(IsDel!=1 or IsDel is null) and 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 void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("statis_sales", "销售报表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            display      = RequestTool.RequestInt("display", 0);
            Pay_id       = RequestTool.RequestInt("Pay_id", 0);
            Transport_id = RequestTool.RequestInt("Transport_id", 0);
            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");
            }
            Y_dateFrom = Convert.ToDateTime(dateFrom).Year;
            M_dateFrom = Convert.ToDateTime(dateFrom).Month;
            D_dateFrom = Convert.ToDateTime(dateFrom).Day;
            Y_dateTo   = Convert.ToDateTime(dateTo).Year;
            M_dateTo   = Convert.ToDateTime(dateTo).Month;
            D_dateTo   = Convert.ToDateTime(dateTo).Day;
            pays       = B_Lebi_Pay.GetList("", "Sort desc");
            transports = B_Lebi_Transport.GetList("", "Sort desc");
        }
Example #3
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_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserMoney", "") + "\"><span>" + Tag("资金记录") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserChangePassword", "") + "\"><span>" + Tag("充值") + "</span></a>";
            DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1");
            if (DefaultCurrency == null)
            {
                DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault();
            }
            string onpaywhere = "IsUsed=1 and parentid=0 and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'";

            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");
            if (CurrentUser.OnlinePay_id == 0)
            {
                if (onlinepays.Count > 0)
                {
                    CurrentUser.OnlinePay_id = onlinepays.FirstOrDefault().id;
                }
            }
            pays = B_Lebi_Pay.GetList("Code!='OnlinePay ' and Code!='OfflinePay'", "Sort desc");
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("pay_list", "付款方式列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize     = RequestTool.getpageSize(25);
            string where = "1=1";
            models       = B_Lebi_Pay.GetList(where, "Sort desc", PageSize, page);
            int recordCount = B_Lebi_Pay.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}", page, PageSize, recordCount);
        }
Example #5
0
        public string paylist(int sid)
        {
            List <Lebi_Pay> models = B_Lebi_Pay.GetList("IsUsed=1", "Sort desc");
            string          str    = "";

            foreach (Lebi_Pay pay in models)
            {
                string sel = "";
                if (pay.id == sid)
                {
                    sel = "selected";
                }
                str += "<option  code=\"" + pay.Code + "\"  value=\"" + pay.id + "\" " + sel + ">" + Lang(pay.Name) + "</option>";
            }
            return(str);
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (id == 0)
            {
                if (!EX_Admin.Power("pay_add", "添加付款方式"))
                {
                    WindowNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("pay_edit", "编辑付款方式"))
                {
                    WindowNoPower();
                }
            }
            model = B_Lebi_Pay.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Pay();
            }
        }
Example #7
0
        /// <summary>
        /// 生成充值订单
        /// </summary>
        public void CreateMoneyOrder()
        {
            decimal money = RequestTool.RequestDecimal("RMoney", 0);

            if (money == 0)
            {
                Response.Write("{\"msg\":\"" + Tag("充值金额必须大于0") + "\"}");
                return;
            }
            Lebi_Currency DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1");

            if (DefaultCurrency == null)
            {
                DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault();
            }
            int onlinepay_id = RequestTool.RequestInt("onlinepay_id");
            int pay_id       = RequestTool.RequestInt("Pay_id");
            int paytype      = RequestTool.RequestInt("paytype");
            //Lebi_MoneyOrder order = new Lebi_MoneyOrder();
            //order.Code = "M" + Shop.Bussiness.Order.CreateOrderCode();
            //order.Money = money;
            //order.User_id = CurrentUser.id;
            //order.User_UserName = CurrentUser.UserName;
            //order.IsPaid = 0;
            //order.Currency_Code = DefaultCurrency.Code;
            //order.Currency_ExchangeRate = DefaultCurrency.ExchangeRate;
            //order.Currency_id = DefaultCurrency.id;
            //order.Currency_Msige = DefaultCurrency.Msige;
            //B_Lebi_MoneyOrder.Add(order);
            Lebi_Order order = new Lebi_Order();

            order.Code                  = "M" + Shop.Bussiness.Order.CreateOrderCode();
            order.Money_Order           = money;
            order.Money_Pay             = money;
            order.User_id               = CurrentUser.id;
            order.User_UserName         = CurrentUser.UserName;
            order.IsPaid                = 0;
            order.Currency_Code         = DefaultCurrency.Code;
            order.Currency_ExchangeRate = DefaultCurrency.ExchangeRate;
            order.Currency_id           = DefaultCurrency.id;
            order.Currency_Msige        = DefaultCurrency.Msige;
            order.Type_id_OrderType     = 214;
            Lebi_Pay pay = B_Lebi_Pay.GetModel(pay_id);

            if (paytype == 0)
            {
                Lebi_OnlinePay onlinepay = B_Lebi_OnlinePay.GetModel(onlinepay_id);
                if (onlinepay == null)
                {
                    onlinepay = new Lebi_OnlinePay();
                }
                order.OnlinePay_id = onlinepay.id;
                order.OnlinePay    = onlinepay.Name;
                pay = B_Lebi_Pay.GetModel("Code='OnlinePay'");
            }
            if (pay == null)
            {
                pay = new Lebi_Pay();
            }
            order.Pay_id = pay.id;
            order.Pay    = pay.Name;

            order.Site_id     = CurrentSite.id;
            order.Language_id = CurrentLanguage.id;
            B_Lebi_Order.Add(order);
            order.id = B_Lebi_Order.GetMaxId();
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + order.id + "\",\"code\":\"" + order.Code + "\",\"url\":\"" + URL("P_Pay", order.id + "," + order.Code) + "\"}");
        }
Example #8
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;
        }
Example #9
0
        protected int sid = 0;//结算供应商ID
        public void LoadPage()
        {
            sid    = RequestTool.RequestInt("sid", 0);
            basket = new Basket(sid);
            bool offlinepay = false;

            if (CurrentUser.Transport_Price_id == "")
            {
                CurrentUser.Transport_Price_id = "0";
            }
            List <Lebi_Transport_Price> prices = B_Lebi_Transport_Price.GetList("id in (" + CurrentUser.Transport_Price_id + ")", "");

            if (prices.Count == 0)
            {
                Response.Write(Tag("请先选择配送方式"));
                Response.End();
                return;
            }
            Lebi_Transport_Price currenttranprice = new Lebi_Transport_Price();
            Lebi_Transport       currenttran      = new Lebi_Transport();

            foreach (Lebi_Transport_Price price in prices)
            {
                currenttran = B_Lebi_Transport.GetModel(price.Transport_id);
                if (currenttran == null)
                {
                    Response.Write(Tag("请先选择配送方式"));
                    Response.End();
                    return;
                }
                if (basket.cashsupplierid == price.Supplier_id)//商城收款,供应商发货的情况必须用在线支付,所以下永远匹配不上。
                {
                    currenttranprice = price;
                }
            }
            string where = "IsUsed=1";
            //if (prices.Count > 1 || currenttranprice.Supplier_id > 0 || basket.cashsupplierid > 0)
            //{
            //    where += " and Code='OnlinePay'";
            //}
            //else
            //{
            if (currenttran.IsCanofflinePay == 1 && currenttranprice.IsCanofflinePay == 1)
            {
                offlinepay = true;
            }
            if (offlinepay == false)
            {
                where += " and Code!='OfflinePay'";
            }
            //}
            string onpaywhere = "IsUsed=1 and parentid=0 and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'";

            //string useragent=Request.UserAgent.ToString().ToLower();
            //if (!useragent.Contains("micromessenger"))
            //{
            //    onpaywhere += " and Code!='weixinpay'";
            //}
            if (CurrentSite.IsMobile == 1)
            {
                onpaywhere += " and (showtype='' or showtype like '%wap%')";
            }
            else
            {
                onpaywhere += " and (showtype='' or showtype like '%web%')";
            }
            SystemLog.Add(onpaywhere);
            pays = B_Lebi_Pay.GetList(where, "Sort desc");
            if ((CurrentUser.Pay_id == 0 || pays.Count == 1) && pays.Count > 0)
            {
                CurrentUser.Pay_id = pays.FirstOrDefault().id;
            }
            onpays = B_Lebi_OnlinePay.GetList(onpaywhere, "Sort desc");
            if (onpays.Count == 0)
            {
                CurrentUser.OnlinePay_id = 0;
            }
            else
            {
                if (CurrentUser.OnlinePay_id == 0 || onpays.Count == 1)
                {
                    CurrentUser.OnlinePay_id = onpays.FirstOrDefault().id;
                }
                else
                {
                    bool flag = false;
                    foreach (Lebi_OnlinePay p in onpays)
                    {
                        if (p.id == CurrentUser.OnlinePay_id)
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag == false)
                    {
                        CurrentUser.OnlinePay_id = onpays.FirstOrDefault().id;
                    }
                }
            }
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("statis_orderproduct", "订单报表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            key          = RequestTool.RequestString("key");
            peisongdian  = RequestTool.RequestString("peisongdian");
            IsPay        = RequestTool.RequestInt("IsPay", -1);
            Pay_id       = RequestTool.RequestInt("Pay_id", 0);
            Transport_id = RequestTool.RequestInt("Transport_id", 0);
            supplier_id  = RequestTool.RequestString("supplier_id");
            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");
            }

            suppliers = B_Lebi_Supplier.GetList("", "");
            where     = "1=1";

            if (IsPay != -1)
            {
                where += " and IsPaid = " + IsPay;
            }
            if (Pay_id != 0)
            {
                where += " and Pay_id = " + Pay_id;
            }
            if (Transport_id != 0)
            {
                where += " and Transport_id = " + Transport_id;
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_Add>='" + dateFrom + "' and Time_Add<='" + dateTo + " 23:59:59'";
            }
            if (supplier_id != "")
            {
                try
                {
                    supplier_id = Convert.ToInt32(supplier_id).ToString();
                }
                catch
                {
                    supplier_id = "0";
                }
                where += " and Supplier_id = " + supplier_id;
            }
            if (peisongdian != "")
            {
                where += " and  Supplier_Delivery_id  in (select w.id from [Lebi_Supplier_Delivery] as w where w.Name like '%" + peisongdian + "%')";
            }

            if (key != "")
            {
                where += " and (Code like lbsql{'%" + key + "%'} or T_Name like lbsql{'%" + key + "%'}))";
            }
            PageSize = RequestTool.getpageSize(25);
            page     = RequestTool.RequestInt("page");
            orders   = B_Lebi_Order.GetList(where, "id desc", PageSize, page);
            int recordCount = B_Lebi_Order.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&key=" + key + "&peisongdian=" + peisongdian + "&supplier_id=" + supplier_id + "&dateTo=" + dateTo + "&dateFrom=" + dateFrom + "&IsPay=" + IsPay + "&Pay_id=" + Pay_id + "&Transport_id=" + Transport_id, page, PageSize, recordCount);
            where      = Server.UrlEncode(where);
            pays       = B_Lebi_Pay.GetList("", "Sort desc");
            transports = B_Lebi_Transport.GetList("", "Sort desc");
            //Response.Write(where);
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("statis_orderproduct", "订单报表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            key          = RequestTool.RequestString("key");
            orderkey     = RequestTool.RequestString("orderkey");
            IsPay        = RequestTool.RequestInt("IsPay", -1);
            Pay_id       = RequestTool.RequestInt("Pay_id", 0);
            Transport_id = RequestTool.RequestInt("Transport_id", 0);
            supplier_id  = RequestTool.RequestString("supplier_id");
            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");
            }

            suppliers = B_Lebi_Supplier.GetList("", "");
            where     = "1=1";

            if (IsPay != -1)
            {
                where += " and w.IsPaid = " + IsPay;
            }
            if (Pay_id != 0)
            {
                where += " and w.Pay_id = " + Pay_id;
            }
            if (Transport_id != 0)
            {
                where += " and w.Transport_id = " + Transport_id;
            }
            where += " and (datediff(d,w.Time_Add,'" + dateFrom + "')<=0 and datediff(d,w.Time_Add,'" + dateTo + "')>=0)";
            if (supplier_id != "")
            {
                try
                {
                    supplier_id = Convert.ToInt32(supplier_id).ToString();
                }
                catch
                {
                    supplier_id = "0";
                }
                where += " and w.Supplier_id = " + supplier_id;
            }
            if (orderkey != "")
            {
                where += " and  w.Code like '%" + orderkey + "%'";
            }
            where = "Order_id in (select w.id from Lebi_Order as w where " + where + ")";
            if (key != "")
            {
                where += " and (Product_Name like lbsql{'%" + key + "%'} or Product_Number like lbsql{'%" + key + "%'})";
            }
            PageSize = RequestTool.getpageSize(25);
            //PageSize = 100;
            page = RequestTool.RequestInt("page");
            pros = B_Lebi_Order_Product.GetList(where, "id desc", PageSize, page);
            int recordCount = B_Lebi_Order_Product.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&key=" + key + "&orderkey=" + orderkey + "&supplier_id=" + supplier_id + "&dateTo=" + dateTo + "&dateFrom=" + dateFrom + "&IsPay=" + IsPay + "&Pay_id=" + Pay_id + "&Transport_id=" + Transport_id, page, PageSize, recordCount);
            where      = Server.UrlEncode(where);
            pays       = B_Lebi_Pay.GetList("", "Sort desc");
            transports = B_Lebi_Transport.GetList("", "Sort desc");
            //Response.Write(where);
        }