private void LoadFiles() { RelatedContent rc = new RelatedContent(); rc.GetRelatedContentByTypeIDAndPageIDAndSubCatID(CurrentPage.PageID, 2, Convert.ToInt32(uiDropDownListsubCats.SelectedValue)); uiGridViewFiles.DataSource = rc.DefaultView; uiGridViewFiles.DataBind(); }
private void LoadVideos() { RelatedContent rc = new RelatedContent(); rc.GetRelatedContentByTypeIDAndPageID(CurrentPage.PageID, 3); uiGridViewVideos.DataSource = rc.DefaultView; uiGridViewVideos.DataBind(); }
protected void uiLinkButtonUpdatePic_Click(object sender, EventArgs e) { RelatedContent rcv = new RelatedContent(); rcv.AddNew(); rcv.ArTitle = uiTextBoxPicName.Text; if (!string.IsNullOrEmpty(RelatedPicPath)) { rcv.URL = RelatedPicPath; } rcv.Description = uiTextBoxPicDesc.Text; rcv.TypeID = 4; rcv.PageID = CurrentPage.PageID; rcv.Save(); ClearPicsFields(); CurrentRelatedPic = null; RelatedPicPath = null; LoadPics(); uiPanelAllPics.Visible = true; uiPanelEditPics.Visible = false; }
protected void uiLinkButtonUpdateVideo_Click(object sender, EventArgs e) { if (CurrentRelatedVideo != null) { CurrentRelatedVideo.ArTitle = uiTextBoxName.Text; CurrentRelatedVideo.URL = uiTextBoxURL.Text; CurrentRelatedVideo.Description = uiTextBoxArDesc.Text; CurrentRelatedVideo.TypeID = 3; CurrentRelatedVideo.PageID = CurrentPage.PageID; CurrentRelatedVideo.Save(); } else { RelatedContent rcv = new RelatedContent(); rcv.AddNew(); rcv.ArTitle = uiTextBoxName.Text; rcv.URL = uiTextBoxURL.Text; rcv.Description = uiTextBoxArDesc.Text; rcv.TypeID = 3; rcv.PageID = CurrentPage.PageID; rcv.Save(); } ClearVideoFields(); CurrentRelatedVideo = null; LoadVideos(); uiPanelViewAllVideos.Visible = true; uiPanelEditVideos.Visible = false; }
protected void uiLinkButtonUpdateCMS_Click(object sender, EventArgs e) { if (CurrentRelatedArticle != null) { CurrentRelatedArticle.ArTitle = uiTextBoxCMSTitle.Text; CMS_Content cms = new CMS_Content(); cms.LoadByPrimaryKey(CurrentRelatedArticle.CMSID); cms.ArTitle = uiTextBoxCMSTitle.Text; cms.ArContent = Server.HtmlEncode(uiRadEditorCMSContent.Content); if (!string.IsNullOrEmpty(CMSMainImagePath)) { cms.MainImagePath = CMSMainImagePath; } CMSMainImagePath = null; cms.Save(); CurrentRelatedArticle.TypeID = 1; CurrentRelatedArticle.PageID = CurrentPage.PageID; CurrentRelatedArticle.Save(); } else { RelatedContent rcv = new RelatedContent(); rcv.AddNew(); CMS_Content cms = new CMS_Content(); cms.AddNew(); cms.ArTitle = uiTextBoxCMSTitle.Text; if (!string.IsNullOrEmpty(CMSMainImagePath)) { cms.MainImagePath = CMSMainImagePath; } CMSMainImagePath = null; rcv.ArTitle = uiTextBoxCMSTitle.Text; cms.ArContent = Server.HtmlEncode(uiRadEditorCMSContent.Content); cms.Save(); rcv.TypeID = 1; rcv.PageID = CurrentPage.PageID; rcv.SubCategoryID = Convert.ToInt32(uiDropDownListCMSSubCats.SelectedValue); rcv.CMSID = cms.CMSID; rcv.Save(); } ClearCMSFields(); CurrentRelatedArticle = null; LoadArticles(); uiPanelAllCMS.Visible = true; uiPanelEditCMS.Visible = false; }
protected void uiLinkButtonUpdateFile_Click(object sender, EventArgs e) { RelatedContent rcv = new RelatedContent(); if (CurrentRelatedFile == null) rcv.AddNew(); else rcv = CurrentRelatedFile; rcv.ArTitle = uiTextBoxFileName.Text; if (CurrentRelatedFile == null) { if (!string.IsNullOrEmpty(RelatedFilePath)) { rcv.URL = RelatedFilePath; } } rcv.Description = uiTextBoxDescFile.Text; rcv.TypeID = 2; rcv.PageID = CurrentPage.PageID; rcv.SubCategoryID = Convert.ToInt32(uiDropDownListsubCats.SelectedValue); rcv.Save(); ClearFileFields(); CurrentRelatedFile = null; RelatedFilePath = null; LoadFiles(); uiPanelAllFiles.Visible = true; uiPanelEditFiles.Visible = false; }
protected void uiGridViewPics_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DeletePic") { RelatedContent objData = new RelatedContent(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); LoadPics(); } }
protected void uiGridViewVideos_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditVideo") { RelatedContent objData = new RelatedContent(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxName.Text = objData.ArTitle; uiTextBoxURL.Text = objData.URL; uiTextBoxArDesc.Text = objData.Description; uiPanelViewAllVideos.Visible = false; uiPanelEditVideos.Visible = true; CurrentRelatedVideo = objData; } else if (e.CommandName == "DeleteVideo") { RelatedContent objData = new RelatedContent(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); LoadVideos(); } }
protected void uiGridViewFiles_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditFile") { RelatedContent objData = new RelatedContent(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxFileName.Text = objData.ArTitle; uiTextBoxDescFile.Text = objData.Description; uiPanelEditFiles.Visible = true; uiPanelAllFiles.Visible = false; CurrentRelatedFile = objData; } else if (e.CommandName == "DeleteFile") { RelatedContent objData = new RelatedContent(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); LoadFiles(); } }
protected void uiGridViewCMS_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditCMS") { RelatedContent objData = new RelatedContent(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CMS_Content cms = new CMS_Content(); cms.LoadByPrimaryKey(objData.CMSID); uiTextBoxCMSTitle.Text = cms.ArTitle; uiRadEditorCMSContent.Content = Server.HtmlDecode(cms.ArContent); uiPanelAllCMS.Visible = false; uiPanelEditCMS.Visible = true; CurrentRelatedArticle = objData; } else if (e.CommandName == "DeleteCMS") { RelatedContent objData = new RelatedContent(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CMS_Content cms = new CMS_Content(); cms.LoadByPrimaryKey(objData.CMSID); objData.MarkAsDeleted(); objData.Save(); cms.MarkAsDeleted(); cms.Save(); LoadArticles(); } }
private void LoadFiles(string id) { int pid = 0; if (Request.QueryString["pid"] != null) { try { pid = Convert.ToInt32(Request.QueryString["pid"].ToString()); } catch (Exception ex) { pid = 0; } } RelatedContent rcp = new RelatedContent(); rcp.GetRelatedContentByTypeIDAndPageIDAndSubCatID(pid, 2,Convert.ToInt32(id)); PagedDataSource pds = new PagedDataSource(); pds.DataSource = rcp.DefaultView; pds.AllowPaging = true; pds.PageSize = 6; pds.CurrentPageIndex = currentPage; uiRepeaterFiles.DataSource = pds; uiRepeaterFiles.DataBind(); uiLinkButtonNext.Enabled = true; uiLinkButtonPrev.Enabled = true; if (currentPage == 0) { uiLinkButtonPrev.Enabled = false; } if (currentPage == (pds.PageCount - 1)) { uiLinkButtonNext.Enabled = false; } uiPanelSubCats.Visible = false; uiPanelCats.Visible = false; uiPanelFiles.Visible = true; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "scroll5", "$(document).ready(function () {$('#scrollbar5').tinyscrollbar();});", true); }
private void LoadCMS(string id) { int pid = 0; if (Request.QueryString["pid"] != null) { try { pid = Convert.ToInt32(Request.QueryString["pid"].ToString()); } catch (Exception ex) { pid = 0; } } RelatedContent rcp = new RelatedContent(); rcp.GetRelatedContentByTypeIDAndPageIDAndSubCatID(pid, 1, Convert.ToInt32(id)); PagedDataSource pds = new PagedDataSource(); pds.DataSource = rcp.DefaultView; pds.AllowPaging = true; pds.PageSize = 6; pds.CurrentPageIndex = currentCMSPage; uiRepeaterCMS.DataSource = pds; uiRepeaterCMS.DataBind(); uiLinkButtonCMSNext.Enabled = true; uiLinkButtonCMSPrev.Enabled = true; if (currentCMSPage == 0) { uiLinkButtonCMSPrev.Enabled = false; } if (currentCMSPage == (pds.PageCount - 1)) { uiLinkButtonCMSNext.Enabled = false; } uiPanelCMSSubCats.Visible = false; uiPanelCMSCats.Visible = false; uiPanelCMS.Visible = true; }
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();*/ } } }