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 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 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 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; }