private void LoadPages() { Pages objdata = new Pages(); objdata.LoadAll(); uiGridViewPages.DataSource = objdata.DefaultView; uiGridViewPages.DataBind(); }
protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditPage") { Pages objData = new Pages(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxArTitle.Text = objData.ArTitle; uiRadEditorPageContent.Content = Server.HtmlDecode(objData.ArContent); if (!string.IsNullOrEmpty(objData.PageType) && objData.PageType.Length == 5) { for (int i = 0; i < 5; i++) { if (objData.PageType[i] == 'T') { uiCheckBoxListPageType.Items[i].Selected = true; } } } uiPanelViewAllPages.Visible = false; uiPanelEdit.Visible = true; CurrentPage = objData; LoadAllRelatedContent(); } }
private void LoadDDls() { Pages pages = new Pages(); pages.LoadAll(); uiDropDownListPages.DataSource = pages.DefaultView; uiDropDownListPages.DataTextField = "ArTitle"; uiDropDownListPages.DataValueField = "PageID"; uiDropDownListPages.DataBind(); uiDropDownListPages.SelectedIndex = 0; Categories cats = new Categories(); cats.GetCategoriesByTypeIDAndPageID(4, Convert.ToInt32(uiDropDownListPages.SelectedValue)); uiDropDownListAllCategories.DataSource = cats.DefaultView; uiDropDownListAllCategories.DataTextField = "Title"; uiDropDownListAllCategories.DataValueField = "CategoryID"; uiDropDownListAllCategories.DataBind(); if (cats.RowCount > 0) uiDropDownListAllCategories.SelectedIndex = 0; }
private void LoadFilesCats() { int pid = 0; if (Request.QueryString["pid"] != null) { try { pid = Convert.ToInt32(Request.QueryString["pid"].ToString()); } catch (Exception ex) { pid = 0; } } Pages page = new Pages(); page.LoadByPrimaryKey(pid); Categories cat = new Categories(); cat.GetCategoriesByTypeIDAndPageID(3, pid); PagedDataSource pds = new PagedDataSource(); pds.DataSource = cat.DefaultView; pds.AllowPaging = true; pds.PageSize = 6; pds.CurrentPageIndex = currentFileCat; uiDataListCats.DataSource = pds; uiDataListCats.DataBind(); uiLinkButtonCatPrev.Enabled = true; uiLinkButtonCatNext.Enabled = true; if (currentFileCat == 0) { uiLinkButtonCatPrev.Enabled = false; } if (currentFileCat == (pds.PageCount - 1)) { uiLinkButtonCatNext.Enabled = false; } uiPanelSubCats.Visible = false; uiPanelCats.Visible = true; uiPanelFiles.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int pid = 0; if (Request.QueryString["pid"] != null) { try { pid = Convert.ToInt32(Request.QueryString["pid"].ToString()); } catch (Exception ex) { pid = 0; } } if (pid == 0) { Response.Redirect("~/Default.aspx"); } else { Pages page = new Pages(); page.LoadByPrimaryKey(pid); uiLabelTitle.Text = page.ArTitle; Master.PageTitle = page.ArTitle; uiLiteralContent.Text = Server.HtmlDecode(page.ArContent); uiImageMain.ImageUrl = "Images.aspx?Inner=t&Image=" + page.MainImagePath; string pagetype = page.PageType; if (string.IsNullOrEmpty(pagetype)) pagetype = "FFFFF"; tabs_1.Visible = TabContent.Visible = (pagetype[0] == 'T'); // content tabs_2.Visible = TabVideos.Visible = (pagetype[1] == 'T'); // videos tabs_3.Visible = TabFiles.Visible = (pagetype[2] == 'T'); // files tabs_4.Visible = TabArticles.Visible = (pagetype[3] == 'T'); // articles tabs_5.Visible = TabPics.Visible = (pagetype[4] == 'T'); // pics RelatedContent rc = new RelatedContent(); rc.GetRelatedContentByTypeIDAndPageID(page.PageID, 3); uiDataListVideos.DataSource = rc.DefaultView; uiDataListVideos.DataBind(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "scroll4", "$(document).ready(function () {$('#scrollbar5').tinyscrollbar();});", true); RelatedContent rcp = new RelatedContent(); rcp.GetRelatedContentByTypeIDAndPageID(page.PageID, 4); uiDataListPics.DataSource = rcp.DefaultView; uiDataListPics.DataBind(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "scroll7", "$(document).ready(function () {$('#scrollbar5').tinyscrollbar();});", true); LoadFilesCats(); LoadCMSCats(); /*RelatedContent rca = new RelatedContent(); rca.GetRelatedContentByTypeIDAndPageID(page.PageID, 1); uiRepeaterCMS.DataSource = rca.DefaultView; uiRepeaterCMS.DataBind();*/ } } }
private void LoadDDls() { Pages pages = new Pages(); pages.LoadAll(); uiDropDownListPages.DataSource = pages.DefaultView; uiDropDownListPages.DataTextField = "ArTitle"; uiDropDownListPages.DataValueField = "PageID"; uiDropDownListPages.DataBind(); uiDropDownListPages.SelectedIndex = 0; }