protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BlogPage bp = new BlogPage(); bp.Where.BlogPageID.Value = BlogPageID; if (bp.Query.Load()) { lblName.Text = bp.GetColumn(BlogPage.ColumnNames.Name).ToString(); if (!bp.IsColumnNull(BlogPage.ColumnNames.PageContent)) { divCategoryContent.InnerHtml = Utils.FormatContent(bp.GetColumn(BlogPage.ColumnNames.PageContent).ToString()); } if (bp.IsBlogPage && (!bp.IsColumnNull(BlogPage.ColumnNames.StartTravelDate) || !bp.IsColumnNull(BlogPage.ColumnNames.EndTravelDate))) { lblTravelDate.Visible = true; if (!bp.IsColumnNull(BlogPage.ColumnNames.StartTravelDate)) { lblTravelDate.Text = bp.s_StartTravelDate; } if (!bp.IsColumnNull(BlogPage.ColumnNames.EndTravelDate)) { lblTravelDate.Text += " - " + bp.s_EndTravelDate; } } else { pTravelDate.Visible = false; } if (bp.IsBlogPage) { blogPageTableList.LoadBlogPages(BlogPageID); } else { blogPageTableList.Visible = false; } if (!bp.IsColumnNull(BlogPage.ColumnNames.MainImage) && bp.s_MainImage.Length > 0) { pnlPageTitle.Attributes["style"] = "background-image: url(" + Master.SiteURL + Utils.GaleryImagePath.Replace("~", "") + "/" + bp.MainImage + ");"; } } } }
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(); } } }