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"; 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; } }
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); }
/// <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); }
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)); } }
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"); }
/// <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 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", "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; } }
public ShopPage() { pageindex = RequestTool.RequestInt("pageindex", 0); string servicepannelcon = SYS.ServicePanel; servicepannel = B_ServicePanel.GetModel(servicepannelcon); CurrentUser_ = EX_User.CurrentUser(); CurrentUserLevel_ = B_Lebi_UserLevel.GetModel("id=" + CurrentUser_.UserLevel_id + ""); if (CurrentUserLevel_ == null) { CurrentUserLevel_ = B_Lebi_UserLevel.GetList("Grade=0", "Grade asc").FirstOrDefault(); if (CurrentUserLevel_ == null) { CurrentUserLevel_ = new Lebi_UserLevel(); Log.Add("会员分组有误", "User_id=" + CurrentUser_.id.ToString()); } } DT_id = GetDT(); Currencys = B_Lebi_Currency.GetList("1=1", "Sort desc"); }
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); }
public static string FormatMoney(decimal money, int Currencyid) { Lebi_Currency model = B_Lebi_Currency.GetModel(Currencyid); return(FormatMoney(money, model)); }