/// <summary> /// 增加一条数据 /// </summary> public int Add(Lebi_Currency model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Lebi_Currency]("); strSql.Append("ExchangeRate,Msige,Name,Code,Sort,IsDefault,DecimalLength)"); strSql.Append(" values ("); strSql.Append("@ExchangeRate,@Msige,@Name,@Code,@Sort,@IsDefault,@DecimalLength)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@ExchangeRate", model.ExchangeRate), new SqlParameter("@Msige", model.Msige), new SqlParameter("@Name", model.Name), new SqlParameter("@Code", model.Code), new SqlParameter("@Sort", model.Sort), new SqlParameter("@IsDefault", model.IsDefault), new SqlParameter("@DecimalLength", model.DecimalLength) }; object obj = SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters); if (obj == null) { return(1); } else { return(Convert.ToInt32(obj)); } }
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\">»</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>»</em><a href=\"" + URL("P_UserMoney", "") + "\"><span>" + Tag("资金记录") + "</span></a><em>»</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"); }
protected void Page_Load(object sender, EventArgs e) { Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel("Code='95epay'"); if (pay == null) { Log.Add("在线支付接口 95epay 配置错误"); Response.End(); return; } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); int order_id = RequestTool.RequestInt("order_id", 0); Lebi_Order order = B_Lebi_Order.GetModel(order_id); if (order == null) { Response.Write("订单错误"); Response.End(); return; } sorder.ord_no = order.Code; //订单编号 sorder.ord_amt = order.Money_Pay * currendy.ExchangeRate; //订单金额 sorder.ord_date = DateTime.Now.ToString("yyyyMMdd"); //交易日期时间 sorder.ver = "01"; sorder.mrch_no = pay.UserName; }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Lebi_Currency model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update [Lebi_Currency] set "); strSql.Append("[ExchangeRate]=@ExchangeRate,"); strSql.Append("[Msige]=@Msige,"); strSql.Append("[Name]=@Name,"); strSql.Append("[Code]=@Code,"); strSql.Append("[Sort]=@Sort,"); strSql.Append("[IsDefault]=@IsDefault,"); strSql.Append("[DecimalLength]=@DecimalLength"); strSql.Append(" where id=" + model.id); OleDbParameter[] parameters = { new OleDbParameter("@ExchangeRate", model.ExchangeRate), new OleDbParameter("@Msige", model.Msige), new OleDbParameter("@Name", model.Name), new OleDbParameter("@Code", model.Code), new OleDbParameter("@Sort", model.Sort), new OleDbParameter("@IsDefault", model.IsDefault), new OleDbParameter("@DecimalLength", model.DecimalLength) }; AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters); }
/// <summary> /// 安全方式绑定对象表单 /// </summary> public Lebi_Currency SafeBindForm(Lebi_Currency model) { if (HttpContext.Current.Request["ExchangeRate"] != null) { model.ExchangeRate = Shop.Tools.RequestTool.RequestDecimal("ExchangeRate", 0); } if (HttpContext.Current.Request["Msige"] != null) { model.Msige = Shop.Tools.RequestTool.RequestSafeString("Msige"); } if (HttpContext.Current.Request["Name"] != null) { model.Name = Shop.Tools.RequestTool.RequestSafeString("Name"); } if (HttpContext.Current.Request["Code"] != null) { model.Code = Shop.Tools.RequestTool.RequestSafeString("Code"); } if (HttpContext.Current.Request["Sort"] != null) { model.Sort = Shop.Tools.RequestTool.RequestInt("Sort", 0); } if (HttpContext.Current.Request["IsDefault"] != null) { model.IsDefault = Shop.Tools.RequestTool.RequestInt("IsDefault", 0); } if (HttpContext.Current.Request["DecimalLength"] != null) { model.DecimalLength = Shop.Tools.RequestTool.RequestInt("DecimalLength", 0); } return(model); }
/// <summary> /// 对象实体绑定数据 /// </summary> public Lebi_Currency ReaderBind(IDataReader dataReader) { Lebi_Currency model = new Lebi_Currency(); object ojb; ojb = dataReader["id"]; if (ojb != null && ojb != DBNull.Value) { model.id = (int)ojb; } ojb = dataReader["ExchangeRate"]; if (ojb != null && ojb != DBNull.Value) { model.ExchangeRate = (decimal)ojb; } model.Msige = dataReader["Msige"].ToString(); model.Name = dataReader["Name"].ToString(); model.Code = dataReader["Code"].ToString(); ojb = dataReader["Sort"]; if (ojb != null && ojb != DBNull.Value) { model.Sort = (int)ojb; } ojb = dataReader["IsDefault"]; if (ojb != null && ojb != DBNull.Value) { model.IsDefault = (int)ojb; } ojb = dataReader["DecimalLength"]; if (ojb != null && ojb != DBNull.Value) { model.DecimalLength = (int)ojb; } return(model); }
public AdminBase() { if (("," + SYS.PluginUsed + ",").Contains(",Lebi.ERP,")) { IsEditStock = false; } config = ShopCache.GetBaseConfig(); site = new Site(); CurrentLanguage = Language.AdminCurrentLanguage(); CurrentAdminLanguage = Language.AdminCurrentLanguage(); DefaultCurrency = Language.DefaultCurrency(); //page = RequestTool.RequestInt("page", 1); langs = Language.AdminLanguages(); if (CurrentAdminGroup == null) { CurrentAdminGroup = new Lebi_Admin_Group(); } if (site.SiteCount > 1) { //if (Shop.LebiAPI.Service.Instanse.Check("domain3admin")) //{ domain3admin = true; //} } }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Lebi_Currency model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update [Lebi_Currency] set "); strSql.Append("ExchangeRate= @ExchangeRate,"); strSql.Append("Msige= @Msige,"); strSql.Append("Name= @Name,"); strSql.Append("Code= @Code,"); strSql.Append("Sort= @Sort,"); strSql.Append("IsDefault= @IsDefault,"); strSql.Append("DecimalLength= @DecimalLength"); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@ExchangeRate", SqlDbType.Decimal, 9), new SqlParameter("@Msige", SqlDbType.NVarChar, 50), new SqlParameter("@Name", SqlDbType.NVarChar, 500), new SqlParameter("@Code", SqlDbType.NVarChar, 50), new SqlParameter("@Sort", SqlDbType.Int, 4), new SqlParameter("@IsDefault", SqlDbType.Int, 4), new SqlParameter("@DecimalLength", SqlDbType.Int, 4) }; parameters[0].Value = model.id; parameters[1].Value = model.ExchangeRate; parameters[2].Value = model.Msige; parameters[3].Value = model.Name; parameters[4].Value = model.Code; parameters[5].Value = model.Sort; parameters[6].Value = model.IsDefault; parameters[7].Value = model.DecimalLength; SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters); }
protected void Page_Load(object sender, EventArgs e) { Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel("Code='weixinpay'"); if (pay == null) { Log.Add("在线支付接口 weixinpay 配置错误"); return; } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); int order_id = RequestTool.RequestInt("order_id", 0); Lebi_Order order = B_Lebi_Order.GetModel(order_id); if (order == null) { Response.Write("订单错误"); Response.End(); return; } TenpayUtil tu = new TenpayUtil(); string sp_billno = order.Code; //当前时间 yyyyMMdd string date = DateTime.Now.ToString("yyyyMMdd"); //if (null == sp_billno) //{ // //生成订单10位序列号,此处用时间和随机数生成,商户根据自己调整,保证唯一 // sp_billno = DateTime.Now.ToString("HHmmss") + TenpayUtil.BuildRandomStr(4); //} //else //{ // sp_billno = Request["order_no"].ToString(); //} sp_billno = TenpayUtil.partner + sp_billno; RequestHandler outParams = new RequestHandler(Context); outParams.init(); string productid = sp_billno; string timeStamp = TenpayUtil.getTimestamp(); string nonceStr = TenpayUtil.getNoncestr(); RequestHandler Params = new RequestHandler(Context); Params.setParameter("appid", TenpayUtil.appid); Params.setParameter("appkey", TenpayUtil.appkey); Params.setParameter("noncestr", nonceStr); Params.setParameter("timestamp", timeStamp); Params.setParameter("productid", productid); string sign = Params.createSHA1Sign(); Params.setParameter("sign", sign); parm = "weixin://wxpay/bizpayurl?sign=" + sign + "&appid=" + TenpayUtil.appid + "&productid=" + productid + "&timeStamp=" + timeStamp + "&nonceStr=" + nonceStr; Response.Write(parm); parm = QRfromGoogle(parm); }
public int pages = 0;//1手机页面 protected void Page_Load(object sender, EventArgs e) { int order_id = RequestTool.RequestInt("order_id", 0); Lebi_Order order = B_Lebi_Order.GetModel(order_id); if (order == null) { Response.Write("订单错误"); Response.End(); return; } Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order, "qianhai"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } if (pay.FeeRate > 0) { order.Money_OnlinepayFee = order.Money_Pay * pay.FeeRate / 100; } order.Site_id_pay = CurrentSite.id; B_Lebi_Order.Update(order); Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); business = pay.UserName; OrderCode = order.Code; Pid = order.Code; currency = pay.Currency_Code; terminal = pay.terminal; Money = (order.Money_Pay * currendy.ExchangeRate * (1 + (pay.FeeRate / 100))).ToString("0.00"); Shop.Bussiness.Site site = new Shop.Bussiness.Site(); ReturnUrl = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/qianhai/ReturnUrl.aspx"; billing_firstName = RequestTool.RequestSafeString("billing_firstName"); billing_lastName = RequestTool.RequestSafeString("billing_lastName"); billing_email = RequestTool.RequestSafeString("billing_email"); billing_phone = RequestTool.RequestSafeString("billing_phone"); billing_country = RequestTool.RequestSafeString("billing_country"); billing_city = RequestTool.RequestSafeString("billing_city"); billing_address = RequestTool.RequestSafeString("billing_address"); billing_zip = RequestTool.RequestSafeString("billing_zip"); //account+terminal+backUrl+order_number+order_currency+order_amount+billing_firstName+billing_lastName+billing_email+secureCode scode = pay.UserName + pay.terminal + ReturnUrl + order.Code + currency + Money + billing_firstName + billing_lastName + billing_email + pay.UserKey; scode = GetSHA256(scode).ToUpper(); if (CurrentSite != null) { if (CurrentSite.IsMobile == 1) { pages = 1;//1手机端 } } }
/// <summary> /// 格式化货币 /// </summary> /// <param name="money"></param> /// <param name="cur"></param> /// <returns></returns> public static string FormatMoney(decimal money, Lebi_Currency Currency) { if (Currency == null) { Currency = DefaultCurrency(); } return(FormatMoney(money, Currency.ExchangeRate, Currency.Msige, Currency.DecimalLength)); }
protected void Page_Load(object sender, EventArgs e) { int order_id = RequestTool.RequestInt("order_id", 0); order = B_Lebi_Order.GetModel(order_id); if (order == null) { Response.Write("ERROR"); Response.End(); return; } Lebi_Language language = B_Lebi_Language.GetModel(order.Language_id); if (order.IsPaid == 1) { Response.Write(Language.Tag("已付款", language.Code)); Response.End(); return; } order.Site_id_pay = CurrentSite.id; order.Language_id = CurrentLanguage.id; Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order, "qianhai"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } if (pay.FreeFeeRate == 1) { pay.FeeRate = 0; } if (pay.FeeRate > 0) { order.Money_OnlinepayFee = order.Money_Pay * pay.FeeRate / 100; } if (order.OnlinePay_id != pay.id) { order.OnlinePay_id = pay.id; order.OnlinePay_Code = pay.Code; order.OnlinePay = pay.Name; } B_Lebi_Order.Update(order); Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); business = pay.UserName; currency = pay.Currency_Code; Money = (order.Money_Pay * currendy.ExchangeRate * (1 + (pay.FeeRate / 100))).ToString("f" + currendy.DecimalLength + ""); Shop.Bussiness.Site site = new Shop.Bussiness.Site(); ReturnUrl = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/qianhai/ReturnUrl.aspx"; //account+terminal+backUrl+order_number+order_currency+order_amount+billing_firstName+billing_lastName+billing_email+secureCode //scode = pay.UserName + "" + ReturnUrl + order.Code + pay.Currency_Code + Money + "" + "" + "" + pay.UserKey; }
public decimal FormatMoneyValue(decimal money, string cnycode) { Lebi_Currency cny = B_Lebi_Currency.GetModel("Code='" + cnycode + "'"); if (cny == null) { return(money); } return(money * cny.ExchangeRate); }
protected void Page_Load(object sender, EventArgs e) { try { string ppTx = RequestTool.RequestSafeString("txn_id"); string ppStatus = RequestTool.RequestSafeString("payment_status"); string ppDate = RequestTool.RequestSafeString("payment_date"); string ppItem = RequestTool.RequestSafeString("item_name"); string ppPrice = RequestTool.RequestSafeString("mc_gross"); string ppitem_number = RequestTool.RequestSafeString("item_number");//存储站内订单号 Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(ppitem_number, "paypal"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); string Content = ""; Content += "txn_id:" + ppTx + "<br>"; Content += "payment_status:" + ppStatus + "<br>"; Content += "payment_date:" + ppDate + "<br>"; Content += "item_name:" + ppItem + "<br>"; Content += "mc_gross:" + ppPrice + "<br>"; Content += "ppitem_number:" + ppitem_number + "<br>"; string txToken = Request.QueryString["tx"]; //paypal流水号 if (VerifyIPN()) //验证成功 { Response.Write("OK"); Order.OnlinePaySuccess(ppitem_number); } else { if (VerifyPDT(pay)) { Response.Write("OK"); Order.OnlinePaySuccess(ppitem_number); } else { Response.Write("False"); //SystemLog.Add("paypal验证失败"); } } } catch (Exception ex) { //Response.Write("False"); SystemLog.Add("paypal验证异常" + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { int order_id = RequestTool.RequestInt("order_id", 0); order = B_Lebi_Order.GetModel(order_id); if (order == null) { Response.Write("ERROR"); Response.End(); return; } Lebi_Language language = B_Lebi_Language.GetModel(order.Language_id); if (order.IsPaid == 1) { Response.Write(Language.Tag("已付款", language.Code)); Response.End(); return; } order.Site_id_pay = CurrentSite.id; order.Language_id = CurrentLanguage.id; Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order, "molpay"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } if (pay.FreeFeeRate == 1) { pay.FeeRate = 0; } if (pay.FeeRate > 0) { order.Money_OnlinepayFee = order.Money_Pay * pay.FeeRate / 100; } if (order.OnlinePay_id != pay.id) { order.OnlinePay_id = pay.id; order.OnlinePay_Code = pay.Code; order.OnlinePay = pay.Name; } B_Lebi_Order.Update(order); business = pay.UserName; Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); OrderCode = order.Code; mid = pay.UserName; Money = (order.Money_Pay * currendy.ExchangeRate * (1 + (pay.FeeRate / 100))).ToString("f" + currendy.DecimalLength + ""); Shop.Bussiness.Site site = new Shop.Bussiness.Site(); ReturnUrl = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/paypal/ReturnUrl.aspx"; vcode = MOLMD5.Sign(Money + pay.UserName + order.Code + pay.UserKey); }
/** * 生成直接支付url,支付url有效期为2小时,模式二 * @param productId 商品ID * @return 模式二URL */ public static string GetPayUrl(string productId) { //Log.Info(this.GetType().ToString(), "Native pay mode 2 url is producing..."); Lebi_Order order = B_Lebi_Order.GetModel("id=" + productId); if (order == null) { return(""); } Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order, "weixinpay"); if (pay == null) { Log.Add("在线支付接口 weixinpay 配置错误"); return(""); } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); if (pay.FreeFeeRate == 1) { pay.FeeRate = 0; } if (pay.FeeRate > 0) { order.Money_OnlinepayFee = order.Money_Pay * pay.FeeRate / 100; } string order_price = (order.Money_Pay * currendy.ExchangeRate * 100 * (1 + (pay.FeeRate / 100))).ToString("0"); SystemLog.Add("weixinpay-GetPayUrl" + "productId : " + productId); WxPayData data = new WxPayData(); data.SetValue("body", "订单号:" + order.Code); //商品描述 data.SetValue("attach", ""); //附加数据 data.SetValue("out_trade_no", order.Code); data.SetValue("total_fee", order_price); //总金额 data.SetValue("time_start", DateTime.Now.ToString("yyyyMMddHHmmss")); //交易起始时间 data.SetValue("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss")); //交易结束时间 data.SetValue("goods_tag", "订单号:" + order.Code); //商品标记 data.SetValue("trade_type", "NATIVE"); //交易类型 data.SetValue("product_id", productId); //商品ID try { WxPayData result = WxPayApi.UnifiedOrder(data); //调用统一下单接口 SystemLog.Add("weixinpay-GetPayUrl" + "result : " + result); string url = result.GetValue("code_url").ToString(); //获得统一下单接口返回的二维码链接 //Log.Info(this.GetType().ToString(), "Get native pay mode 2 url : " + url); return(url); } catch (System.NullReferenceException ex) { SystemLog.Add("weixinpay-GetPayUrl" + "result : " + ex.ToString()); return(ex.ToString()); } }
/// <summary> /// 返回默认币种 /// </summary> /// <returns></returns> public static Lebi_Currency DefaultCurrency() { List <Lebi_Currency> models = B_Lebi_Currency.GetList("", "IsDefault desc,Sort desc", 1, 1); Lebi_Currency model = models.FirstOrDefault(); if (model == null) { model = new Lebi_Currency(); } return(model); }
/// <summary> /// 格式化金额,加上当前货币符号 /// </summary> /// <param name="money"></param> /// <returns></returns> public string FormatMoney(decimal money, Lebi_Currency currency) { StringBuilder sb = new StringBuilder(); sb.Append("<span class=\"lebimoney\">"); sb.Append("<font class=\"msige\">" + currency.Msige + "</font>"); sb.Append("<font class=\"money_1\">" + (money * currency.ExchangeRate).ToString("0.00") + "</font>"); sb.Append("<font class=\"money_0\" style=\"display:none;\">" + money + "</font>"); sb.Append("</span>"); return(sb.ToString()); //return CurrentCurrency. + "" + money.ToString("0.00"); }
public static string FormatMoney(decimal money, string CurrencyCode) { if (CurrencyCode == "Number") { return((money * DefaultCurrency().ExchangeRate).ToString("f" + DefaultCurrency().DecimalLength)); } else { Lebi_Currency model = B_Lebi_Currency.GetModel("Code='" + CurrencyCode + "'"); return(FormatMoney(money, model)); } }
/// <summary> /// 返回当前币种 /// 前台使用 /// </summary> /// <returns></returns> public static Lebi_Currency CurrentCurrency(Lebi_Language lang) { string code = CookieTool.GetCookieString("Currency"); Lebi_Currency model = B_Lebi_Currency.GetModel("Code=lbsql{'" + code + "'}"); if (model == null) { model = B_Lebi_Currency.GetModel(lang.Currency_id); } if (model == null) { return(DefaultCurrency()); } return(model); }
public string FormatMoney(decimal money, int id) { Lebi_Currency currency = B_Lebi_Currency.GetModel(id); if (currency == null) { currency = new Lebi_Currency(); } StringBuilder sb = new StringBuilder(); sb.Append("<font class=\"msige\">" + currency.Msige + "</font>"); sb.Append("<font class=\"money_1\">" + (money * currency.ExchangeRate).ToString("0.00") + "</font>"); return(sb.ToString()); //return CurrentCurrency. + "" + money.ToString("0.00"); }
public void LoadPage() { if (CurrentUser.id == 0) { Response.Write("{\"msg\":\"" + Tag("请先登陆") + "\",\"url\":\"" + URL("P_Login", "") + "\"}"); return; } money = RequestTool.RequestDecimal("money"); DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1"); if (DefaultCurrency == null) { DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault(); } keyid = RequestTool.RequestInt("keyid"); tablename = RequestTool.RequestString("tablename"); }
/// <summary> /// 得到一个对象实体 by id /// </summary> public Lebi_Currency GetModel(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 * from [Lebi_Currency] "); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4) }; parameters[0].Value = id; Lebi_Currency model = new Lebi_Currency(); DataSet ds = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } if (ds.Tables[0].Rows[0]["ExchangeRate"].ToString() != "") { model.ExchangeRate = decimal.Parse(ds.Tables[0].Rows[0]["ExchangeRate"].ToString()); } model.Msige = ds.Tables[0].Rows[0]["Msige"].ToString(); model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); model.Code = ds.Tables[0].Rows[0]["Code"].ToString(); if (ds.Tables[0].Rows[0]["Sort"].ToString() != "") { model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString()); } if (ds.Tables[0].Rows[0]["IsDefault"].ToString() != "") { model.IsDefault = int.Parse(ds.Tables[0].Rows[0]["IsDefault"].ToString()); } if (ds.Tables[0].Rows[0]["DecimalLength"].ToString() != "") { model.DecimalLength = int.Parse(ds.Tables[0].Rows[0]["DecimalLength"].ToString()); } return(model); } else { return(null); } }
protected void Page_Load(object sender, EventArgs e) { try { string RefId = Request.Params["RefId"]; string ResCode = Request.Params["ResCode"]; SaleOrderId = Convert.ToInt64(Request.Params["SaleOrderId"]); SaleReferenceId = Convert.ToInt64(Request.Params["SaleReferenceId"]); string OrderID = Convert.ToString(SaleOrderId); Lebi_Order order = B_Lebi_Order.GetModel("id=" + OrderID + ""); if (order == null) { Response.Write("416"); //Response.Write("系统错误"); Response.End(); return; } Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order.Code, "behpardakht"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); string Content = ""; Content += "OrderCode:" + order.Code + "<br>"; Content += "ResCode:" + ResCode + "<br>"; Content += "SaleReferenceId:" + SaleReferenceId + "<br>"; if (yanzheng(pay) == 0)//验证成功 { Response.Write("0"); Order.OnlinePaySuccess(order.Code); } else { Response.Write("416"); //SystemLog.Add("paypal验证失败"); } } catch (Exception ex) { //Response.Write("False"); SystemLog.Add("behpardakht验证异常" + ex.Message); } }
/// <summary> /// 得到一个对象实体 by where条件 /// </summary> public Lebi_Currency GetModel(string strWhere) { if (strWhere.IndexOf("lbsql{") > 0) { SQLPara para = new SQLPara(strWhere, "", ""); return(GetModel(para)); } StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 * from [Lebi_Currency] "); strSql.Append(" where " + strWhere + ""); Lebi_Currency model = new Lebi_Currency(); DataSet ds = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString()); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } if (ds.Tables[0].Rows[0]["ExchangeRate"].ToString() != "") { model.ExchangeRate = decimal.Parse(ds.Tables[0].Rows[0]["ExchangeRate"].ToString()); } model.Msige = ds.Tables[0].Rows[0]["Msige"].ToString(); model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); model.Code = ds.Tables[0].Rows[0]["Code"].ToString(); if (ds.Tables[0].Rows[0]["Sort"].ToString() != "") { model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString()); } if (ds.Tables[0].Rows[0]["IsDefault"].ToString() != "") { model.IsDefault = int.Parse(ds.Tables[0].Rows[0]["IsDefault"].ToString()); } if (ds.Tables[0].Rows[0]["DecimalLength"].ToString() != "") { model.DecimalLength = int.Parse(ds.Tables[0].Rows[0]["DecimalLength"].ToString()); } return(model); } else { return(null); } }
public SupplierBase() { site = new Site_Supplier(); CurrentLanguage = Language.CurrentLanguage(); DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1"); if (DefaultCurrency == null) { DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault(); } CurrentCurrency = DefaultCurrency; site = new Site_Supplier(); langs = Language.Languages(); reqPage = RequestTool.GetRequestUrl().ToLower(); }
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\">»</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>»</em><a href=\"" + URL("P_UserMoney", "") + "\"><span>" + Tag("资金记录") + "</span></a><em>»</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"); }
public string tenpay_notify = "http://*****/payReturnUrl.aspx"; //支付完成后的回调处理页面; public TenpayUtil(Lebi_Order order) { /*tenpay = System.Configuration.ConfigurationSettings.AppSettings["tenpay"];*/ Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order, "tenpayJSDZ"); if (pay == null) { return; } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); Shop.Bussiness.Site site = new Shop.Bussiness.Site(); B_BaseConfig bconfig = new B_BaseConfig(); BaseConfig SYS = bconfig.LoadConfig(); bargainor_id = pay.UserName; tenpay_key = pay.UserKey; tenpay_return = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/payReturnUrl.aspx"; tenpay_notify = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/payNotifyUrl.aspx"; }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Lebi_Currency model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Lebi_Currency]("); strSql.Append("[ExchangeRate],[Msige],[Name],[Code],[Sort],[IsDefault],[DecimalLength])"); strSql.Append(" values ("); strSql.Append("@ExchangeRate,@Msige,@Name,@Code,@Sort,@IsDefault,@DecimalLength)"); OleDbParameter[] parameters = { new OleDbParameter("@ExchangeRate", model.ExchangeRate), new OleDbParameter("@Msige", model.Msige), new OleDbParameter("@Name", model.Name), new OleDbParameter("@Code", model.Code), new OleDbParameter("@Sort", model.Sort), new OleDbParameter("@IsDefault", model.IsDefault), new OleDbParameter("@DecimalLength", model.DecimalLength) }; AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters); return(1); }
protected override void OnLoad(EventArgs e) { //页面载入检查 PageLoadCheck(); site = new Site_Agent(); string themecode = ""; int siteid = 0; string languagecode = ""; var nv = CookieTool.GetCookie("ThemeStatus"); if (!string.IsNullOrEmpty(nv.Get("theme"))) { themecode = nv.Get("theme"); } if (!string.IsNullOrEmpty(nv.Get("language"))) { languagecode = nv.Get("language"); } if (!string.IsNullOrEmpty(nv.Get("theme"))) { int.TryParse(nv.Get("site"), out siteid); } if (siteid == 0) { siteid = ShopCache.GetMainSite().id; } LoadTheme(themecode, siteid, languagecode, "", true); DefaultCurrency = B_Lebi_Currency.GetModel("IsDefault=1"); if (DefaultCurrency == null) { DefaultCurrency = B_Lebi_Currency.GetList("", "Sort desc").FirstOrDefault(); } CurrentCurrency = DefaultCurrency; base.OnLoad(e); }