Esempio n. 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 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");
        }
Esempio n. 2
0
        public string onlinepaylist(int sid)
        {
            List <Lebi_OnlinePay> models = B_Lebi_OnlinePay.GetList("IsUsed=1", "Sort desc");
            string str = "";

            foreach (Lebi_OnlinePay 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);
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("onlinepay_list", "在线支付列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            PageSize     = RequestTool.getpageSize(25);
            lang         = RequestTool.RequestString("lang");
            key          = RequestTool.RequestString("key");
            show         = RequestTool.RequestInt("show", 2);
            pic          = RequestTool.RequestInt("pic", 2);
            string where = "IsUsed=1 and parentid=0 and Code!='weixinpay'";
            models       = B_Lebi_OnlinePay.GetList(where, "id asc", PageSize, page);
            int recordCount = B_Lebi_OnlinePay.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}&show=" + show + "&key=" + key + "&pic=" + pic, page, PageSize, recordCount);
        }
Esempio n. 4
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 and parentid=0 and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "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(where, "Time_add desc", PageSize, pageindex);
            CashCount    = B_Lebi_Cash.Counts(where);
            PageString   = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}", pageindex, PageSize, CashCount, CurrentLanguage);
            NextPage     = "?page=" + (pageindex + 1) + "";
            decimal TakeMoneyLimit = 0;

            decimal.TryParse(SYS.TakeMoneyLimit, out TakeMoneyLimit);
            if (TakeMoneyLimit > CurrentUser.Money)
            {
                SubmitShow = false;
            }
            else
            {
                SubmitShow = true;
            }
            user_bank = B_Lebi_User_Bank.GetList("User_id=" + CurrentUser.id + "", "id desc");
        }
Esempio n. 5
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");
            pagefrom = Rstring("pagefrom");
            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 Supplier_id=" + order.Supplier_id + " and ','+Language_ids+',' like '%," + order.Language_id + ",%'";
            string onpaywhere = "IsUsed=1 and parentid=0 and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'";

            //if (order.Supplier_id == 0)
            //    onpaywhere += " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%' and Supplier_id=0";
            //if (order.Supplier_id > 0)
            //{
            //    if (EX_Supplier.GetUser(order.Supplier_id).IsCash == 1)
            //    {
            //        onpaywhere += " and Supplier_id=" + order.Supplier_id + "";
            //    }
            //    else
            //    {
            //        onpaywhere += " and Supplier_id=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");
            string useragent = Request.UserAgent.ToString().ToLower();

            if (useragent.Contains("micromessenger"))
            {
                Isweixin = true;
            }
        }
Esempio n. 6
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;
                    }
                }
            }
        }
Esempio n. 7
0
 public List <Lebi_OnlinePay> GetPays(int id)
 {
     return(B_Lebi_OnlinePay.GetList("parentid=" + id, "IsUsed desc,Sort desc"));
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTool.RequestInt("id", 0);

            if (id == 0)
            {
                if (!EX_Admin.Power("onlinepay_add", "添加在线支付"))
                {
                    WindowNoPower();
                }
            }
            else
            {
                if (!EX_Admin.Power("onlinepay_edit", "编辑在线支付"))
                {
                    WindowNoPower();
                }
            }
            model = B_Lebi_OnlinePay.GetModel(id);
            if (model == null)
            {
                model = new Lebi_OnlinePay();
            }
            string where = "parentid=0";
            models       = B_Lebi_OnlinePay.GetList(where, "IsUsed desc,Sort desc", PageSize, page);
            switch (model.Code)
            {
            case "molpay":
                username = "******";
                key      = "Verify Key";
                email    = Tag("邮箱");
                break;

            case "wangyinzaixian":
                username = "******";
                key      = "MD5密钥";
                email    = Tag("邮箱");
                break;

            case "alipayJSDZ":
                username = "******";
                key      = "安全校验码(Key)";
                email    = "支付宝账号";
                break;

            case "alipayDBJY":
                username = "******";
                key      = "安全校验码(Key)";
                email    = "支付宝账号";
                break;

            case "alipaySJK":
                username = "******";
                key      = "安全校验码(Key)";
                email    = "支付宝账号";
                break;

            case "alipayWAP":
                username = "******";
                key      = "安全校验码(Key)";
                email    = "支付宝账号";
                break;

            case "alipaybatch":
                username = "******";
                key      = "安全校验码(Key)";
                email    = "支付宝账号";
                break;

            case "chinapnr":
                username = "******";
                key      = "公钥相对路径";
                email    = "私钥相对路径";
                break;

            default:
                username = Tag("帐号");
                key      = Tag("KEY");
                email    = Tag("邮箱");
                break;
            }
        }
Esempio n. 9
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");
            pagefrom = Rstring("pagefrom");
            order    = B_Lebi_Order.GetModel(order_id);
            if (order == null)
            {
                PageError();
            }
            if (order.User_id != CurrentUser.id)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            if (order.IsPaid == 1)
            {
                Response.Redirect(URL("P_UserOrderDetails", order.id));
            }
            if (order.IsInvalid == 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 Supplier_id=" + order.Supplier_id + " and ','+Language_ids+',' like '%," + order.Language_id + ",%'";
            string onpaywhere = "IsUsed=1 and parentid=0 and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'";

            //if (order.Supplier_id == 0)
            //    onpaywhere += " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%' and Supplier_id=0";
            //if (order.Supplier_id > 0)
            //{
            //    if (EX_Supplier.GetUser(order.Supplier_id).IsCash == 1)
            //    {
            //        onpaywhere += " and Supplier_id=" + order.Supplier_id + "";
            //    }
            //    else
            //    {
            //        onpaywhere += " and Supplier_id=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");
            string useragent = Request.UserAgent.ToString().ToLower();

            if (useragent.Contains("micromessenger"))
            {
                Isweixin = true;
            }
            //<-{支付快捷跳转 by lebi.kingdge 2018-07-05
            bool           IsRedirect = false;
            Lebi_OnlinePay op         = B_Lebi_OnlinePay.GetModel(order.OnlinePay_id);

            if (op == null)
            {
                op = new Lebi_OnlinePay();
            }
            Lebi_OnlinePay_Log log = B_Lebi_OnlinePay_Log.GetModel("Order_id = " + order.id + " and OnlinePay_id = " + order.OnlinePay_id + "");

            if (log == null)
            {
                IsRedirect       = true;
                log              = new Lebi_OnlinePay_Log();
                log.Order_id     = order.id;
                log.OnlinePay_id = order.OnlinePay_id;
                log.Time_add     = DateTime.Now;
                B_Lebi_OnlinePay_Log.Add(log);
            }
            else
            {
                B_Lebi_OnlinePay_Log.Delete(log.id);
            }
            if (!Isweixin && op.Code == "weixinpay")
            {
                IsRedirect = false;
            }
            if (IsRedirect)
            {
                if (op.Url.IndexOf("?") > -1)
                {
                    HttpContext.Current.Response.Redirect(WebPath.TrimEnd('/') + op.Url + "&order_id=" + order.id + "&opid=" + order.OnlinePay_id);
                }
                else
                {
                    HttpContext.Current.Response.Redirect(WebPath.TrimEnd('/') + op.Url + "?order_id=" + order.id + "&opid=" + order.OnlinePay_id);
                }
            }
            //}->
        }