예제 #1
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";

            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)
            {
                CurrentUser.OnlinePay_id = onlinepays.FirstOrDefault().id;
            }
        }
예제 #2
0
        /// <summary>
        /// 获得在线付款接口参数MODEL
        /// </summary>
        /// <param name="code"></param>
        /// <param name="order"></param>
        public static Lebi_OnlinePay GetOnlinePay(Lebi_Order order, string code)
        {
            if (order == null)
            {
                return(null);
            }
            string where = "Code='" + code + "'";
            if (string.IsNullOrEmpty(order.KeyCode))
            {
                if (order.IsSupplierCash == 0 && order.Language_id > 0)
                {
                    where += " and ','+Language_ids+',' like '%," + order.Language_id + ",%'";
                }
            }
            Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel(where);
            string         log = "";

            if (pay == null)
            {
                pay = B_Lebi_OnlinePay.GetModel("Code='" + code + "'");
            }
            if (pay == null)
            {
                log = "在线支付接口 " + code + " 配置错误";
                Log.Add(log);
            }
            else
            {
                if (order.IsSupplierCash == 1)
                {
                    Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id);
                    if (supplier == null)
                    {
                        supplier = new Lebi_Supplier();
                        log      = "在线支付接口 " + code + " 配置错误[供应商ID:" + order.Supplier_id + "]";
                        Log.Add(log);
                        return(pay);
                    }
                    Lebi_OnlinePay supplierpay = B_Lebi_OnlinePay.GetModel("Code='" + code + "' and Supplier_id=" + supplier.id + "");
                    if (supplierpay == null)
                    {
                        log = "在线支付接口 " + code + " 配置错误[供应商:" + supplier.SubName + ",ID:" + order.Supplier_id + "]";
                        Log.Add(log);
                        return(pay);
                    }
                    supplierpay.TypeName      = pay.TypeName;
                    supplierpay.Url           = pay.Url;
                    supplierpay.Code          = pay.Code;
                    supplierpay.Currency_Code = pay.Currency_Code;
                    supplierpay.Currency_id   = pay.Currency_id;
                    supplierpay.Currency_Name = pay.Currency_Name;
                    return(supplierpay);
                }
            }
            return(pay);
        }
예제 #3
0
        /// <summary>
        /// 获取一个支付方式的对于供应商设置或(默认设置)
        /// </summary>
        /// <param name="pay"></param>
        /// <returns></returns>
        public Lebi_OnlinePay Getpay(Lebi_OnlinePay pay)
        {
            if (order.IsSupplierCash == 0)
            {
                return(pay);
            }
            Lebi_OnlinePay p = B_Lebi_OnlinePay.GetModel("parentid=" + pay.id + " and Supplier_id=" + order.Supplier_id + " and IsUsed=1");

            return(p);
        }
예제 #4
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");
        }
예제 #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);
            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_UserCash", "") + "\"><span>" + Tag("提现") + "</span></a>";
            DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1");
            if (DefaultCurrency == null)
            {
                DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault();
            }
            onlinepays = B_Lebi_OnlinePay.GetList("IsUsed=1", "Sort desc");
            if (CurrentUser.OnlinePay_id == 0)
            {
                if (onlinepays.Count > 0)
                {
                    CurrentUser.OnlinePay_id = onlinepays.FirstOrDefault().id;
                }
                else
                {
                    CurrentUser.OnlinePay_id = 0;
                }
            }
            pageindex    = RequestTool.RequestInt("page", 1);
            string where = "User_id=" + CurrentUser.id + "";
            cashs        = B_Lebi_Cash.GetList("", "Time_add desc", PageSize, pageindex);
            CashCount    = B_Lebi_Cash.Counts(where);
            PageString   = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}", pageindex, PageSize, CashCount, CurrentLanguage);
            decimal TakeMoneyLimit = 0;

            decimal.TryParse(SYS.TakeMoneyLimit, out TakeMoneyLimit);
            if (TakeMoneyLimit > CurrentUser.Money)
            {
                SubmitShow = false;
            }
            else
            {
                SubmitShow = true;
            }
        }