Esempio n. 1
0
 private void LoadCommonPageData()
 {
     Settings s = new Settings();
     if (s.LoadByPrimaryKey(1))
     {
         if (IsCountryPage)
         {
             Country c = new Country();
             if (c.LoadByPrimaryKey(CountryID))
             {
                 m_Title = c.GetColumn("Name" + Utils.LangPrefix).ToString();
                 if (!s.IsColumnNull("TitleSuffix" + Utils.LangPrefix))
                 {
                     m_Title += " - " + s.GetColumn("TitleSuffix" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Keywords" + Utils.LangPrefix))
                 {
                     m_Keywords = c.GetColumn("Keywords" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Description" + Utils.LangPrefix))
                 {
                     m_Description = c.GetColumn("Description" + Utils.LangPrefix).ToString();
                 }
             }
         }
         else if (IsCityPage)
         {
             City c = new City();
             if (c.LoadByPrimaryKey(CityID))
             {
                 m_Title = c.GetColumn("Name" + Utils.LangPrefix).ToString();
                 if (!s.IsColumnNull("TitleSuffix" + Utils.LangPrefix))
                 {
                     m_Title += " - " + s.GetColumn("TitleSuffix" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Keywords" + Utils.LangPrefix))
                 {
                     m_Keywords = c.GetColumn("Keywords" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Description" + Utils.LangPrefix))
                 {
                     m_Description = c.GetColumn("Description" + Utils.LangPrefix).ToString();
                 }
             }
         }
         if (m_Title.TrimEnd().Length == 0 && !s.IsColumnNull("Title" + Utils.LangPrefix))
         {
             m_Title = s.GetColumn("Title" + Utils.LangPrefix).ToString();
         }
         if (m_Keywords.TrimEnd().Length == 0 && !s.IsColumnNull("Keywords" + Utils.LangPrefix))
         {
             m_Keywords = s.GetColumn("Keywords" + Utils.LangPrefix).ToString();
         }
         if (m_Description.TrimEnd().Length == 0 && !s.IsColumnNull("Description" + Utils.LangPrefix))
         {
             m_Description = s.GetColumn("Description" + Utils.LangPrefix).ToString();
         }
     }
 }
Esempio n. 2
0
 private void LoadCommonPageData()
 {
     Settings s = new Settings();
     if (s.LoadByPrimaryKey(1))
     {
         Category c = new Category();
         if (c.LoadByPrimaryKey(CategoryID))
         {
             if (!c.IsColumnNull("Keywords" + Utils.LangPrefix))
             {
                 m_Keywords = c.GetColumn("Keywords" + Utils.LangPrefix).ToString();
             }
             if (!c.IsColumnNull("Description" + Utils.LangPrefix))
             {
                 m_Description = c.GetColumn("Description" + Utils.LangPrefix).ToString();
             }
         }
         if (m_Keywords.TrimEnd().Length == 0 && !s.IsColumnNull("Keywords" + Utils.LangPrefix))
         {
             m_Keywords = s.GetColumn("Keywords" + Utils.LangPrefix).ToString();
         }
         if (m_Description.TrimEnd().Length == 0 && !s.IsColumnNull("Description" + Utils.LangPrefix))
         {
             m_Description = s.GetColumn("Description" + Utils.LangPrefix).ToString();
         }
         if (m_Keywords.TrimEnd().Length == 0)
         {
             m_Keywords = Resources.Vikkisoft.MetaKeywords;
         }
         if (m_Description.TrimEnd().Length == 0)
         {
             m_Description = Resources.Vikkisoft.MetaDescription;
         }
     }
 }
Esempio n. 3
0
 private void LoadCommonPageData()
 {
     Settings s = new Settings();
     if (s.LoadByPrimaryKey(1))
     {
         if (IsCountryPage)
         {
             Country c = new Country();
             if (c.LoadByPrimaryKey(CountryID))
             {
                 m_Title = c.GetColumn(Country.ColumnNames.Name).ToString();
                 if (!s.IsColumnNull(Settings.ColumnNames.TitleSuffix))
                 {
                     m_Title += " - " + s.GetColumn(Settings.ColumnNames.TitleSuffix).ToString();
                 }
                 if (!c.IsColumnNull(Country.ColumnNames.Keywords))
                 {
                     m_Keywords = c.GetColumn(Country.ColumnNames.Keywords).ToString();
                 }
                 if (!c.IsColumnNull(Country.ColumnNames.Description))
                 {
                     m_Description = c.GetColumn(Country.ColumnNames.Description).ToString();
                 }
             }
         }
         else if (IsCityPage)
         {
             City c = new City();
             if (c.LoadByPrimaryKey(CityID))
             {
                 m_Title = c.GetColumn(City.ColumnNames.Name).ToString();
                 if (!s.IsColumnNull(Settings.ColumnNames.TitleSuffix))
                 {
                     m_Title += " - " + s.GetColumn(Settings.ColumnNames.TitleSuffix).ToString();
                 }
                 if (!c.IsColumnNull(City.ColumnNames.Keywords))
                 {
                     m_Keywords = c.GetColumn(City.ColumnNames.Keywords).ToString();
                 }
                 if (!c.IsColumnNull(City.ColumnNames.Description))
                 {
                     m_Description = c.GetColumn(City.ColumnNames.Description).ToString();
                 }
             }
         }
         else if (IsBlogPagePage)
         {
             BlogPage bp = new BlogPage();
             if (bp.LoadByPrimaryKey(BlogPageID))
             {
                 m_Title = bp.GetColumn(BlogPage.ColumnNames.Name).ToString();
                 if (!s.IsColumnNull(Settings.ColumnNames.TitleSuffix))
                 {
                     m_Title += " - " + s.GetColumn(Settings.ColumnNames.TitleSuffix).ToString();
                 }
                 if (!bp.IsColumnNull(BlogPage.ColumnNames.Keywords))
                 {
                     m_Keywords = bp.GetColumn(BlogPage.ColumnNames.Keywords).ToString();
                 }
                 if (!bp.IsColumnNull(BlogPage.ColumnNames.Description))
                 {
                     m_Description = bp.GetColumn(BlogPage.ColumnNames.Description).ToString();
                 }
             }
         }
         if (m_Title.TrimEnd().Length == 0 && !s.IsColumnNull(Settings.ColumnNames.Title))
         {
             m_Title = s.GetColumn(Settings.ColumnNames.Title).ToString();
         }
         if (m_Keywords.TrimEnd().Length == 0 && !s.IsColumnNull(Settings.ColumnNames.Keywords))
         {
             m_Keywords = s.GetColumn(Settings.ColumnNames.Keywords).ToString();
         }
         if (m_Description.TrimEnd().Length == 0 && !s.IsColumnNull(Settings.ColumnNames.Description))
         {
             m_Description = s.GetColumn(Settings.ColumnNames.Description).ToString();
         }
     }
 }