예제 #1
0
        public int CreateResourcHtmlById(ref string errText, int id, TCGTagHandlers tcgth)
        {
            if (id <= 0) return -1000000308;

            Resources item = this.GetResourcesById(id);
            if (item == null) return -1000000309;

            if (item.vcUrl.IndexOf(".") > -1) return -1000000310;

            int rtn = 0;
            tcgth.Template = item.Categorie.ResourceTemplate.Content.Replace("_$Id$_", id.ToString());
            tcgth.FilePath =  HttpContext.Current.Server.MapPath("~" + item.vcFilePath);
            tcgth.WebPath = item.vcFilePath;

            string text1 = string.Empty;

            if (tcgth.Replace())
            {
                item.cCreated = "Y";
                item.cChecked = "Y";
                rtn = base.handlerService.resourcsService.resourcesHandlers.UpdateResources(item);
            }
            else
            {
                rtn = -1000000311;
            }

            return 1;
        }
예제 #2
0
        /// <summary>
        ///  ���ɷ����б�
        /// </summary>
        /// <param name="categoriesid"></param>
        /// <returns></returns>
        public int CreateCategoriesListHtml(string categoriesid, TCGTagHandlers tcgthdl,ref string createfilepath)
        {
            if (string.IsNullOrEmpty(categoriesid))
            {
                return -1000000801;
            }

            Categories cif = this.GetCategoriesById(categoriesid);

            if (cif == null) { return -1000000802; }

            if (cif.ResourceListTemplate == null) { return -1000000803; }

            if (cif.vcUrl.IndexOf(".") > -1) { return -1000000804; }

            string filepath = "";

            filepath = HttpContext.Current.Server.MapPath("~" + cif.vcUrl + ConfigServiceEx.baseConfig["FileExtension"]);

            tcgthdl.Template = cif.ResourceListTemplate.Content.Replace("_$ClassId$_", categoriesid.ToString());
            tcgthdl.FilePath = filepath;
            tcgthdl.WebPath = cif.vcUrl + ConfigServiceEx.baseConfig["FileExtension"];

            tcgthdl.Replace();
            if (tcgthdl.PagerInfo.PageCount > 1)
            {

                for (int i = 0; i <= tcgthdl.PagerInfo.PageCount; i++)
                {
                    string num = (i == 0) ? "" :"_" + i.ToString();
                    createfilepath += "<a>���ɳɹ�:" + cif.vcUrl + num + ConfigServiceEx.baseConfig["FileExtension"] + "...</a>";
                }
            }
            else
            {
                createfilepath = "<a>���ɳɹ�:" + cif.vcUrl + ConfigServiceEx.baseConfig["FileExtension"] + "...</a>";
            }

            return 1;
        }
예제 #3
0
        public string ReplaceTCGTag(string strHtml, string DefaultSkinId)
        {
            tcgTagHandlers = new TCGTagHandlers(base.handlerService);
            tcgTagHandlers.Template = strHtml;
            tcgTagHandlers.FilePath = "";
            tcgTagHandlers.WebPath = "";
            tcgTagHandlers.PagerInfo.DoAllPage = false;
            tcgTagHandlers.PagerInfo.Page = 0;
            tcgTagHandlers.PagerInfo.PageSep = 0;
            tcgTagHandlers.SkinInfo = base.handlerService.skinService.skinHandlers.GetSkinEntityBySkinId(DefaultSkinId);

            tcgTagHandlers.NeedCreate = false;

            tcgTagHandlers.Replace();

            return tcgTagHandlers.Template;
        }
예제 #4
0
        public int CreateClassList(string categorieid, int page,ref int pagecount,ref string pagepath)
        {
            if (string.IsNullOrEmpty(categorieid))
            {
                return -1000000801;
            }

            Categories cif = tcgTagHandlers.handlerService.skinService.categoriesHandlers.GetCategoriesById(categorieid);

            if (cif == null)
            {
                return -1000000802;
            }

            if (cif.ResourceListTemplate == null)
            {
                return -1000000803;
            }

            if (cif.vcUrl.IndexOf(".") > -1)
            {
                pagepath = cif.vcUrl;
                return 1;
            }

            string url = cif.vcUrl;
            if (!string.IsNullOrEmpty(url))
            {
                url = (cif.vcUrl.IndexOf(".") > -1) ? cif.vcUrl : cif.vcUrl + ConfigServiceEx.baseConfig["FileExtension"];
            }
            else
            {
                if (cif.IsSinglePage == "Y" )
                {
                    Resources res = tcgTagHandlers.handlerService.resourcsService.resourcesHandlers.GetNewsResourcesAtCategorie(cif.Id);
                    if (res == null) return -1000000810;
                    return this.CreateResourcHtmlById(ref pagepath, objectHandlers.ToInt(res.Id));
                }

                return -1000000809;
            }

            string filepath = "";
            filepath = HttpContext.Current.Server.MapPath("~" + url);

            tcgTagHandlers = new TCGTagHandlers(base.handlerService);
            tcgTagHandlers.Template = cif.ResourceListTemplate.Content.Replace("_$ClassId$_", categorieid.ToString());
            tcgTagHandlers.FilePath = filepath;
            tcgTagHandlers.WebPath = url;
            tcgTagHandlers.PagerInfo.DoAllPage = false;
            tcgTagHandlers.PagerInfo.Page = page;
            tcgTagHandlers.PagerInfo.PageSep = page <= 0 ? 0 : 1;
            tcgTagHandlers.SkinInfo = cif.SkinInfo;

            if (tcgTagHandlers.Replace())
            {
                pagecount = tcgTagHandlers.PagerInfo.PageCount;
                pagepath = tcgTagHandlers.GetFilePath();
                return 1;
            }
            else
            {
                return -1000000805;
            }
        }
예제 #5
0
        public int CreateSingeTemplateToHtml(string templateid, ref string filepath)
        {
            if (string.IsNullOrEmpty(templateid)) { return -1000000806; }
            Template tlif = tcgTagHandlers.handlerService.skinService.templateHandlers.GetTemplateByID(templateid);

            if (tlif == null) { return -1000000807; }

            tlif.vcUrl = tlif.vcUrl.IndexOf(".") > -1 ? tlif.vcUrl : tlif.vcUrl + ConfigServiceEx.baseConfig["FileExtension"];

            filepath = HttpContext.Current.Server.MapPath("~" + tlif.vcUrl);

            tcgTagHandlers = new TCGTagHandlers(base.handlerService);
            tcgTagHandlers.Template = tlif.Content;
            tcgTagHandlers.FilePath = filepath;
            tcgTagHandlers.SkinInfo = tlif.SkinInfo;
            if (tcgTagHandlers.Replace())
            {
                return 1;
            }
            else
            {
                return -1000000313;
            }
        }