Example #1
0
        public static string GetURL(string code, string ParaStr, string url, Lebi_Language lang)
        {
            if (lang == null)
            {
                lang = new Lebi_Language();
            }
            Lebi_Site site = B_Lebi_Site.GetModel(lang.Site_id);

            if (site == null)
            {
                if (ShopPage.IsAPP() || ShopPage.IsWechat() || ShopPage.IsWap())
                {
                    site = B_Lebi_Site.GetModel("IsMobile = 1 order by Sort asc");
                }
                else
                {
                    site = B_Lebi_Site.GetModel("IsMobile = 0 order by Sort asc");
                }
                if (site == null)
                {
                    site = new Lebi_Site();
                }
            }
            return(GetURL(code, ParaStr, url, site, lang));
        }
Example #2
0
        public static string GetURL(string code, string ParaStr, string url, string langcode)
        {
            Lebi_Site site = new Lebi_Site();

            if (ShopPage.IsAPP() || ShopPage.IsWechat() || ShopPage.IsWap())
            {
                site = B_Lebi_Site.GetModel("IsMobile = 1 order by Sort asc");
                if (site == null)
                {
                    site = B_Lebi_Site.GetModel("IsMobile = 0 order by Sort asc");
                }
            }
            else
            {
                site = B_Lebi_Site.GetModel("IsMobile = 0 order by Sort asc");
                if (site == null)
                {
                    site = B_Lebi_Site.GetModel("IsMobile = 1 order by Sort asc");
                }
            }
            Lebi_Language lang = B_Lebi_Language.GetModel("Site_id =" + site.id + " and Code = '" + langcode + "'");

            if (lang == null)
            {
                lang = new Lebi_Language();
            }
            return(GetURL(code, ParaStr, url, lang));
        }
Example #3
0
        /// <summary>
        /// 获取一个设置值
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string Get(string key)
        {
            Lebi_DT_Config conf = B_Lebi_DT_Config.GetModel("DT_id = " + ShopPage.GetDT() + " and Name='" + key + "'");

            if (conf == null)
            {
                return("");
            }
            return(conf.Value);
        }
Example #4
0
        public decimal ProductPrice_Market(Lebi_Product pro)
        {
            //<-{获取分销价格
            int DT_id = ShopPage.GetDT();

            if (DT_id > 0)
            {
                Lebi_DT_Product DT_product = B_Lebi_DT_Product.GetModel("DT_id = " + DT_id + " and Product_id = " + pro.id);
                if (DT_product != null)
                {
                    return(DT_product.Price_Market);
                }
            }
            //}->
            return(pro.Price_Market);
        }
Example #5
0
        /// <summary>
        /// 设置一个设置值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public static void Set(string key, string value)
        {
            Lebi_DT_Config conf = B_Lebi_DT_Config.GetModel("DT_id = " + ShopPage.GetDT() + " and Name='" + key + "'");

            if (conf == null)
            {
                conf       = new Lebi_DT_Config();
                conf.Name  = key;
                conf.Value = value;
                B_Lebi_DT_Config.Add(conf);
            }
            else
            {
                conf.Value = value;
                B_Lebi_DT_Config.Update(conf);
            }
        }