コード例 #1
0
ファイル: UPDATE.cs プロジェクト: yzbjack/LebiShop
        /// <summary>
        /// 更新type表
        ///
        /// </summary>
        public void UpdateType()
        {
            //============================================
            //获取服务端数据
            List <Lebi_Type> apis;

            try
            {
                string res = Shop.LebiAPI.Service.Instanse.API("CheckType", "");
                JavaScriptSerializer jss = new JavaScriptSerializer();
                apis = jss.Deserialize <List <Lebi_Type> >(res);
            }
            catch (Exception)
            {
                apis = new List <Lebi_Type>();
            }
            Lebi_Type model;

            foreach (Lebi_Type api in apis)
            {
                model = B_Lebi_Type.GetModel(api.id);
                if (model == null)
                {
                    B_Lebi_Type.Add(api);
                    continue;
                }
                if (model.Name == api.Name && model.Sort == api.Sort && model.Class == api.Class)
                {
                    continue;
                }
                B_Lebi_Type.Update(api);
            }
        }
コード例 #2
0
        public static string TypeName(int id, string lang)
        {
            Lebi_Type model = B_Lebi_Type.GetModel(id);

            if (model != null)
            {
                if (model.Color != "")
                {
                    return("<font style=\"color:" + model.Color + "\">" + Language.Tag(model.Name, lang) + "</font>");
                }
                else
                {
                    return(Language.Tag(model.Name, lang));
                }
            }
            return("");
        }
コード例 #3
0
        /// <summary>
        /// 返回类型名称
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static string TypeName(int id)
        {
            Lebi_Type model = B_Lebi_Type.GetModel(id);

            if (model != null)
            {
                if (model.Color != "")
                {
                    return("<font style=\"color:" + model.Color + "\">" + model.Name + "</font>");
                }
                else
                {
                    return(model.Name);
                }
            }
            return("");
        }