Пример #1
0
        public void GenerateProfileXML(string strBookCode)
        {
            string           strProfilePath = $"SiteMap\\SM_Profile_{strBookCode}.xml";
            SiteMapGenerator gen            = new SiteMapGenerator(strProfilePath);

            gen.WriteStartDocument();
            List <Profile> lstProfile = null;

            if (strBookCode == "XSEO")
            {
                lstProfile = GetAllProfileBookCodeByCities(strBookCode);
            }
            else
            {
                lstProfile = GetAllProfileBookCode(strBookCode);
            }
            foreach (var profile in lstProfile)
            {
                //string strLink = $"{AppSetting.myypUrl}/{profile.CityState}/{profile.CompanyName}/profile/{profile.ProfileID}";
                string strLink = $"{AppSetting.myypUrl}/{profile.CityState}/{profile.CompanyName}/profile";
                gen.WriteItem(strLink, DateTime.Now, "1.0");
            }
            gen.WriteEndDocument();
            gen.Close();
        }
Пример #2
0
        public void GenerateCategoryXML(bool IsMap)
        {
            foreach (string strBookCode in catRepo.GetAllBook())
            {
                string           strCategoryPath = !IsMap ? $"SiteMap\\SM_Category_{strBookCode}.xml" : $"SiteMap\\SM_Category_{strBookCode}_Map.xml";
                SiteMapGenerator gen             = new SiteMapGenerator(strCategoryPath);
                //Console.WriteLine( "Book Code: {0}, City: {1},  Heading: {2}", cat.BookCode, cat.CityState, cat.HeadingName );
                gen.WriteStartDocument();
                List <Category> lstCategory = GetAllCategoryBookCode(strBookCode);
                foreach (var cat in lstCategory)
                {
                    string strLink = !IsMap ? $"{AppSetting.myypUrl}/{cat.CityState}/{cat.HeadingName}" : $"{AppSetting.myypUrl}/{cat.CityState}/{cat.HeadingName}/Map";
                    gen.WriteItem(strLink, DateTime.Now, "1.0");
                }
                gen.WriteEndDocument();
                gen.Close();
            }


            // List<Category> lstCategory =  GetAllCategory();
            // foreach(var cat in lstCategory)
            // {
            //Console.WriteLine( "Book Code: {0}, City: {1},  Heading: {2}", cat.BookCode, cat.CityState, cat.HeadingName );
            // }
        }
Пример #3
0
 public void GenerateCategoryXML(bool IsMap, string strBookCode)
 {
     if (strBookCode == "ALL")
     {
         GenerateCategoryXML(IsMap);
         return;
     }
     else
     {
         string           strCategoryPath = !IsMap ? $"SiteMap\\SM_Category_{strBookCode}.xml" : $"SiteMap\\SM_Category_{strBookCode}_Map.xml";
         SiteMapGenerator gen             = new SiteMapGenerator(strCategoryPath);
         gen.WriteStartDocument();
         List <Category> lstCategory = GetAllCategoryBookCode(strBookCode);
         foreach (var cat in lstCategory)
         {
             string strLink = !IsMap ? $"{AppSetting.myypUrl}/{cat.CityState}/{cat.HeadingName}" : $"{AppSetting.myypUrl}/{cat.CityState}/{cat.HeadingName}/Map";
             gen.WriteItem(strLink, DateTime.Now, "1.0");
         }
         gen.WriteEndDocument();
         gen.Close();
     }
 }