private void Control_Init() { if (DataEval.IsEmptyQuery(_itemdetailid)) { MultiView_ItemDetail.SetActiveView(View_New); } else { MultiView_ItemDetail.SetActiveView(View_Detail); Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemDetail_Default.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemDetail_Default.ascx"; break; } Literal_ItemTemplate.Text = "Item Template: " + myItemTemplate.ItemTemplatePath + "</br>"; } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_photo_itemlistid)) { MultiView_ItemDetail.SetActiveView(View_New); } else { MultiView_ItemDetail.SetActiveView(View_Detail); if (Request.QueryString["PageLink"] == "Disable") { } // Init List View Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr(); Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemList_Default.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemList_Default.ascx"; break; } myItemTemplate.Set_Separator(""); myItemTemplate.Set_DataEmpty(""); Literal_ItemList.Text = "Item Template: " + myItemTemplate.ItemTemplatePath + "</br>"; Literal_ItemList.Text += "Item Alternate Template: " + myItemTemplate.AltPath + "</br>"; if (DataEval.IsEmptyQuery(myItemTemplate.Separator)) { Literal_ItemList.Text += "Separator: None" + "</br>"; } else { Literal_ItemList.Text += "Separator: " + myItemTemplate.Separator + "</br>"; } if (DataEval.IsEmptyQuery(myItemTemplate.DataEmpty)) { Literal_ItemList.Text += "DataEmpty Template: None" + "</br>"; } else { Literal_ItemList.Text += "DataEmpty Template: " + myItemTemplate.DataEmpty + "</br>"; } } }
private void Control_Init() { if (!DataEval.IsEmptyQuery(_newslistid)) { if (Request.QueryString["PageLink"] == "Disable") { ListView_NewsList.Enabled = false; btn_NewsStatus_Show.Enabled = false; } #region Bind Data to droplist // Enable user edit mode //Gets your enum names and adds it to a string array Array enumNames = Enum.GetValues(typeof(Lib.News_Status)); //Creates an ArrayList ArrayList myNews_Statuses = new ArrayList(); //Loop through your string array and poppulates the ArrayList foreach (Lib.News_Status myNews_Status in enumNames) { myNews_Statuses.Add(new { Value = StringEnum.GetStringValue(myNews_Status), Name = myNews_Status.ToString() }); } //Bind the ArrayList to your DropDownList droplist_NewsStatus_Show.DataSource = myNews_Statuses; droplist_NewsStatus_Show.DataTextField = "Name"; droplist_NewsStatus_Show.DataValueField = "Value"; droplist_NewsStatus_Show.DataBind(); #endregion if (DataEval.IsEmptyQuery(_news_status_show)) { _news_status_show = droplist_NewsStatus_Show.SelectedValue; } else { droplist_NewsStatus_Show.SelectedValue = _news_status_show; } if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page)) { //lbtn_Add_News.Visible = true; droplist_NewsStatus_Show.Visible = true; btn_NewsStatus_Show.Visible = true; } else { //lbtn_Add_News.Visible = false; droplist_NewsStatus_Show.Visible = false; btn_NewsStatus_Show.Visible = false; } Lib.NewsMgr myNewsMgr = new Lib.NewsMgr(); ListView_NewsList.DataSource = myNewsMgr.Get_News_Posts(_categoryid, _news_status_show, _sortorder, _orientation, _totalnumber, _newsdetailurl); ListView_NewsList.DataKeyNames = new string[] { "NewsID" }; Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsList_Default.ascx"; break; case "TitleOnly": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsList_TitleOnly.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsList_Default.ascx"; break; } myItemTemplate.Set_Separator(""); myItemTemplate.Set_DataEmpty(""); ListView_NewsList.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath); ListView_NewsList.AlternatingItemTemplate = Page.LoadTemplate(myItemTemplate.AltPath); if (!DataEval.IsEmptyQuery(myItemTemplate.Separator)) { ListView_NewsList.ItemSeparatorTemplate = Page.LoadTemplate(myItemTemplate.Separator); } if (!DataEval.IsEmptyQuery(myItemTemplate.DataEmpty)) { ListView_NewsList.EmptyDataTemplate = Page.LoadTemplate(myItemTemplate.DataEmpty); } try { ListView_NewsList.DataBind(); } catch { // Load Template Failed } DataPager_NewsList.PageSize = _numberperpage; DataPager_NewsList.Visible = _enable_pager; } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_itemdetailid)) { MultiView_ItemDetail.SetActiveView(View_New); } else { MultiView_ItemDetail.SetActiveView(View_Detail); if (Request.QueryString["PageLink"] == "Disable") { hlink_Edit_Item.Enabled = false; } Lib.Photo myPhoto; // Init Comment Form if (!DataEval.IsEmptyQuery(Request["NexusPhotoID"])) { Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr(); myPhoto = myPhotoMgr.Get_Photo(Request["NexusPhotoID"], _displayid); if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page)) { hlink_Edit_Item.Visible = true; hlink_Edit_Item.Attributes["href"] = "#"; hlink_Edit_Item.Attributes["onclick"] = string.Format( "return Show_ControlManager('/App_AdminCP/SiteAdmin/PoP_ControlPanel.aspx?ControlID={0}&NexusPhotoID={1}');", "43D902AF-A0DC-4036-BC46-C98EC84B6698", myPhoto.PhotoID); } else { hlink_Edit_Item.Visible = false; } // Page Title if (_ispagetitle) { Page.Title = myPhoto.Photo_Title; } Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemDetail_Default.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemDetail_Default.ascx"; break; } FormView_ItemDetail.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath); List <Lib.Photo> myPhotos = new List <Lib.Photo>(); myPhotos.Add(myPhoto); try { FormView_ItemDetail.DataSource = myPhotos; FormView_ItemDetail.DataKeyNames = new string[] { "PhotoID" }; FormView_ItemDetail.DataBind(); } catch { // Load Template Failed } } else { // No Post ID hlink_Edit_Item.Visible = false; } } }
private void Control_Init() { // Enable Photo Manger if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page)) { hlink_Edit_Item.Visible = true; hlink_Edit_Item.Attributes["href"] = "#"; hlink_Edit_Item.Attributes["onclick"] = string.Format( "return Show_ControlManager('/App_AdminCP/SiteAdmin/PoP_ControlPanel.aspx?ControlID={0}');", "4979A4B0-3F09-4579-9520-90AC64257116" ); } else { hlink_Edit_Item.Visible = false; } // Init Control if (!DataEval.IsEmptyQuery(_photo_itemlistid)) { if (Request.QueryString["PageLink"] == "Disable") { ListView_ItemList.Enabled = false; hlink_Edit_Item.Enabled = false; } // Init List View Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr(); ListView_ItemList.DataSource = myPhotoMgr.Get_Photos(_categoryid, _sortorder, _orientation, true.ToString(), _totalnumber, _photo_itemdetailurl, _displayid); ListView_ItemList.DataKeyNames = new string[] { "PhotoID" }; Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemList_Default.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Gallery/Templates/ItemList_Default.ascx"; break; } myItemTemplate.Set_DataEmpty(""); ListView_ItemList.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath); ListView_ItemList.AlternatingItemTemplate = Page.LoadTemplate(myItemTemplate.AltPath); if (!DataEval.IsEmptyQuery(myItemTemplate.DataEmpty)) { ListView_ItemList.EmptyDataTemplate = Page.LoadTemplate(myItemTemplate.DataEmpty); } try { ListView_ItemList.DataBind(); } catch { // Load Template Failed } DataPager_ItemList.PageSize = _numberperpage; DataPager_ItemList.Visible = _enable_pager; } }
private void Control_Init() { if (!DataEval.IsEmptyQuery(_ebay_itemlistid)) { if (Request.QueryString["PageLink"] == "Disable") { ListView_Ebay_ItemList.Enabled = false; } // Init List View ListView_Ebay_ItemList.GroupItemCount = _repeatcolumn; Lib.EbayMgr myEbayMgr = new Lib.EbayMgr(); ListView_Ebay_ItemList.DataSource = myEbayMgr.Get_Ebay_Items(_categoryid, _ebay_listtype, _sortorder, _orientation, "1", "1", _totalnumber, _ebay_itemdetailurl); ListView_Ebay_ItemList.DataKeyNames = new string[] { "Ebay_ItemID" }; Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemList_Default.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemList_Default.ascx"; break; } myItemTemplate.Set_Separator(""); myItemTemplate.Set_DataEmpty(""); ListView_Ebay_ItemList.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath); ListView_Ebay_ItemList.AlternatingItemTemplate = Page.LoadTemplate(myItemTemplate.AltPath); if (!DataEval.IsEmptyQuery(myItemTemplate.Separator)) { ListView_Ebay_ItemList.ItemSeparatorTemplate = Page.LoadTemplate(myItemTemplate.Separator); } if (!DataEval.IsEmptyQuery(myItemTemplate.DataEmpty)) { ListView_Ebay_ItemList.EmptyDataTemplate = Page.LoadTemplate(myItemTemplate.DataEmpty); } try { ListView_Ebay_ItemList.DataBind(); } catch { // Load Template Failed } DataPager_Ebay_ItemList.PageSize = _numberperpage; DataPager_Ebay_ItemList.Visible = _enable_pager; } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_ebay_itemdetailid)) { MultiView_ItemDetail.SetActiveView(View_New); } else { MultiView_ItemDetail.SetActiveView(View_Detail); if (Request.QueryString["PageLink"] == "Disable") { hlink_Edit_Item.Enabled = false; } Lib.Ebay_Item myEbay_Item; // Init Comment Form if (!DataEval.IsEmptyQuery(Request["NexusEbayItemID"])) { Lib.EbayMgr myEbayMgr = new Lib.EbayMgr(); myEbay_Item = myEbayMgr.Get_Ebay_Item(Request["NexusEbayItemID"]); if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page)) { hlink_Edit_Item.Visible = true; hlink_Edit_Item.Attributes["href"] = "#"; hlink_Edit_Item.Attributes["onclick"] = string.Format("return Show_ControlManager('/App_AdminCP/SiteAdmin/PoP_ControlPanel.aspx?ControlID={0}&NexusEbayItemID={1}');", "8BF5ABB9-30D5-429E-8017-A168672AC15F", myEbay_Item.Ebay_ItemID); } else { hlink_Edit_Item.Visible = false; } // Page Title if (_ispagetitle) { Page.Title = myEbay_Item.Ebay_Title; } // Init Form View if (DataEval.IsEmptyQuery(myEbay_Item.Item_PicutreURL)) { myEbay_Item.Item_PicutreURL = "/App_Control_Style/Nexus_Ebay/Images/EbaySample.png"; } // Fillup Post Content //lbl_Price.Text = myEbay_Item.Currency_Web + myEbay_Item.CurrentPrice.ToString(); //lbl_Title.Text = myEbay_Item.Ebay_Title; //lbl_SubTitle.Text = myEbay_Item.Ebay_SubTitle; //lbl_QuantityAvailable.Text = myEbay_Item.QuantityAvailable.ToString(); //lbl_QuantitySold.Text = myEbay_Item.QuantitySold.ToString(); //lbl_TotalView_Count.Text = myEbay_Item.Total_View_Count.ToString(); //string[] ItemPicutreURLs = myEbay_Item.Ebay_Picture.Split(new string[] { "||" }, StringSplitOptions.None); //if (DataEval.IsEmptyQuery(ItemPicutreURLs[0])) // Img_Product.ImageUrl = "/App_Control_Style/Nexus_Ebay/Images/EbaySample.png"; //else // Img_Product.ImageUrl = ItemPicutreURLs[0]; //hlink_ViewItemURL.NavigateUrl = myEbay_Item.ViewItemURL; //Literal_Item_Description.Text = myEbay_Item.Item_Description; //Literal_Ebay_Description.Text = myEbay_Item.Ebay_Description; } else { // No Post ID myEbay_Item = new Lib.Ebay_Item(); hlink_Edit_Item.Visible = false; myEbay_Item.Item_PicutreURL = "/App_Control_Style/Nexus_Ebay/Images/EbaySample.png"; } Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemDetail_Default.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemDetail_Default.ascx"; break; } FormView_ItemDetail.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath); List <Lib.Ebay_Item> myEbay_Items = new List <Lib.Ebay_Item>(); myEbay_Items.Add(myEbay_Item); try { FormView_ItemDetail.DataSource = myEbay_Items; FormView_ItemDetail.DataKeyNames = new string[] { "Ebay_ItemID" }; FormView_ItemDetail.DataBind(); } catch { // Load Template Failed } } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_blogpostsid)) { MultiView_BlogPosts.SetActiveView(View_New); } else { if (Request.QueryString["PageLink"] == "Disable") { ListView_BlogPosts.Enabled = false; btn_PostStatus_Show.Enabled = false; } MultiView_BlogPosts.SetActiveView(View_Posts); #region Bind Data to droplist // Enable user edit mode //Gets your enum names and adds it to a string array Array enumNames = Enum.GetValues(typeof(Lib.Post_Status)); //Creates an ArrayList ArrayList myPost_Statuses = new ArrayList(); //Loop through your string array and poppulates the ArrayList foreach (Lib.Post_Status myPost_Status in enumNames) { myPost_Statuses.Add(new { Value = StringEnum.GetStringValue(myPost_Status), Name = myPost_Status.ToString() }); } //Bind the ArrayList to your DropDownList droplist_PostStatus_Show.DataSource = myPost_Statuses; droplist_PostStatus_Show.DataTextField = "Name"; droplist_PostStatus_Show.DataValueField = "Value"; droplist_PostStatus_Show.DataBind(); #endregion if (Security.Users.UserStatus.Validate_Ownership(this.Page, _ownership_userid) || Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page)) { lbtn_Add_Post.Visible = true; droplist_PostStatus_Show.Visible = true; btn_PostStatus_Show.Visible = true; } else { lbtn_Add_Post.Visible = false; droplist_PostStatus_Show.Visible = false; btn_PostStatus_Show.Visible = false; } Lib.BlogMgr myBlogMgr = new Lib.BlogMgr(); ListView_BlogPosts.DataSource = myBlogMgr.Get_Blog_Posts(_ownership_userid, "Publish", _postviewurl); ListView_BlogPosts.DataKeyNames = new string[] { "PostID" }; Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/BlogPosts_Default.ascx"; break; case "TitleOnly": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/BlogPosts_TitleOnly.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/BlogPosts_Default.ascx"; break; } myItemTemplate.Set_Separator(""); myItemTemplate.Set_DataEmpty(""); ListView_BlogPosts.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath); ListView_BlogPosts.AlternatingItemTemplate = Page.LoadTemplate(myItemTemplate.AltPath); if (!DataEval.IsEmptyQuery(myItemTemplate.Separator)) { ListView_BlogPosts.ItemSeparatorTemplate = Page.LoadTemplate(myItemTemplate.Separator); } if (!DataEval.IsEmptyQuery(myItemTemplate.DataEmpty)) { ListView_BlogPosts.EmptyDataTemplate = Page.LoadTemplate(myItemTemplate.DataEmpty); } try { ListView_BlogPosts.DataBind(); } catch { // Load Template Failed } DataPager_BlogPosts.PageSize = _numberperpage; DataPager_BlogPosts.Visible = _enable_pager; } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_postviewid)) { MultiView_PostView.SetActiveView(View_New); } else { if (Request.QueryString["PageLink"] == "Disable") { lbtn_Edit_Post.Enabled = false; btn_PostComment.Enabled = false; } MultiView_PostView.SetActiveView(View_Post); // Init Comment Form RadEditor_Comment.ToolsFile = "~/App_Data/Editor/BasicTools.xml"; RadEditor_Comment.EditModes = Telerik.Web.UI.EditModes.Design | Telerik.Web.UI.EditModes.Preview; // Fillup Post Content if (!DataEval.IsEmptyQuery(Request["NexusBlogPostID"])) { Lib.BlogMgr myBlogMgr = new Lib.BlogMgr(); Lib.Blog_Post myBlog_Post = myBlogMgr.Get_Blog_Post(Request["NexusBlogPostID"]); List <Blog_Post> myPostViews = new List <Blog_Post>(); myPostViews.Add(myBlog_Post); FormView_PostView.DataSource = myPostViews; FormView_PostView.DataKeyNames = new string[] { "PostID" }; Core.Tools.AppItemTemplates myPostView_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_postview_itemtemplate) { case "Default": myPostView_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/PostView_Default.ascx"; break; case "Custom": myPostView_ItemTemplate.ItemTemplatePath = _postview_itemtemplateurl; break; default: myPostView_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/PostView_Default.ascx"; break; } FormView_PostView.ItemTemplate = Page.LoadTemplate(myPostView_ItemTemplate.ItemTemplatePath); try { FormView_PostView.DataBind(); } catch { // Load Template Failed } //lbl_Title.Text = "Demo Title..."; //lbl_Post_Date.Text = DateTime.Now.ToShortDateString(); //lbl_UserName.Text = "Demo User Name"; //Literal_Content.Text = "<p>Demo Content...</p>"; //lbl_Post_ModifyDate.Text = DateTime.Now.ToString(); //lbl_Comment_Count.Text = "0"; //// Add Social button //PlaceHolder_SocialNetwork.Controls.Clear(); //HyperLink myHyperLink = new HyperLink(); //myHyperLink.ImageUrl = "~/App_Control_Style/Nexus_Blog/SocialBookmark/Facebook_24.png"; //PlaceHolder_SocialNetwork.Controls.Add(myHyperLink); } else { // No Post ID lbtn_Edit_Post.Visible = false; btn_PostComment.Visible = false; } } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_newsdetailid)) { MultiView_NewsDetail.SetActiveView(View_New); } else { MultiView_NewsDetail.SetActiveView(View_Detail); // Init Item Template Check Core.Tools.AppItemTemplates myNewsDetail_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_newsdetail_itemtemplate) { case "Default": myNewsDetail_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsDetail_Default.ascx"; break; case "Custom": myNewsDetail_ItemTemplate.ItemTemplatePath = _newsdetail_itemtemplateurl; break; default: myNewsDetail_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsDetail_Default.ascx"; break; } Literal_NewsDetail.Text = "Item Template: " + myNewsDetail_ItemTemplate.ItemTemplatePath; // Comment Title Core.Tools.AppItemTemplates myCommentTitle_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_commenttitle_itemtemplate) { case "Default": myCommentTitle_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsCommentTitle_Default.ascx"; break; case "Custom": myCommentTitle_ItemTemplate.ItemTemplatePath = _commenttitle_itemtemplateurl; break; default: myCommentTitle_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsCommentTitle_Default.ascx"; break; } Literal_CommentTitle.Text = "Item Template: " + myCommentTitle_ItemTemplate.ItemTemplatePath; // Comment Core.Tools.AppItemTemplates myComment_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_comment_itemtemplate) { case "Default": myComment_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsComment_Default.ascx"; break; case "Custom": myComment_ItemTemplate.ItemTemplatePath = _comment_itemtemplateurl; break; default: myComment_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsComment_Default.ascx"; break; } myComment_ItemTemplate.Set_Separator(""); myComment_ItemTemplate.Set_DataEmpty(""); Literal_Comment.Text = "Item Template: " + myComment_ItemTemplate.ItemTemplatePath; Literal_Comment.Text += "\n <br /> " + "Item Alter Template: " + myComment_ItemTemplate.AltPath; if (!DataEval.IsEmptyQuery(myComment_ItemTemplate.Separator)) { Literal_Comment.Text += "\n <br /> " + "Item Template Separator: " + myComment_ItemTemplate.Separator; } else { Literal_Comment.Text += "\n <br /> " + "Item Template Separator: None"; } if (!DataEval.IsEmptyQuery(myComment_ItemTemplate.DataEmpty)) { Literal_Comment.Text += "\n <br /> " + "Item Data Empty Template: " + myComment_ItemTemplate.DataEmpty; } else { Literal_Comment.Text += "\n <br /> " + "Item Data Empty Template: None"; } } }
private void Control_Init() { if (!DataEval.IsEmptyQuery(_e2shop_itemlistid)) { if (Request.QueryString["PageLink"] == "Disable") { ListView_e2Shop_ItemList.Enabled = false; Panel_PagerTop.Enabled = false; Panel_PagerBottom.Enabled = false; } #region Get client request int pagenum; if (DataEval.IsEmptyQuery(Request.QueryString["PageNum"])) { pagenum = 1; } else { pagenum = Convert.ToInt16(Request.QueryString["PageNum"]); } #endregion // Init List View ListView_e2Shop_ItemList.GroupItemCount = _repeatcolumn; ProductSearchMgr myProductSearchMgr = new ProductSearchMgr(); ListView_e2Shop_ItemList.DataSource = myProductSearchMgr.Get_Product_Search( "", "", "", _categoryid, "", true.ToString(), true.ToString(), _sortorder, _orientation, pagenum, _numberperpage); ListView_e2Shop_ItemList.DataKeyNames = new string[] { "Ebay_ItemID" }; Core.Tools.AppItemTemplates myItemTemplate = new Core.Tools.AppItemTemplates(); switch (_itemtemplate) { case "Default": myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemList_Default.ascx"; break; case "Custom": myItemTemplate.ItemTemplatePath = _itemtemplateurl; break; default: myItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Ebay/Templates/ItemList_Default.ascx"; break; } myItemTemplate.Set_Separator(""); myItemTemplate.Set_DataEmpty(""); ListView_e2Shop_ItemList.ItemTemplate = Page.LoadTemplate(myItemTemplate.ItemTemplatePath); ListView_e2Shop_ItemList.AlternatingItemTemplate = Page.LoadTemplate(myItemTemplate.AltPath); if (!DataEval.IsEmptyQuery(myItemTemplate.Separator)) { ListView_e2Shop_ItemList.ItemSeparatorTemplate = Page.LoadTemplate(myItemTemplate.Separator); } if (!DataEval.IsEmptyQuery(myItemTemplate.DataEmpty)) { ListView_e2Shop_ItemList.EmptyDataTemplate = Page.LoadTemplate(myItemTemplate.DataEmpty); } try { ListView_e2Shop_ItemList.DataBind(); } catch { // Load Template Failed } DataPager_e2Shop_ItemList.PageSize = _numberperpage; } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_newsdetailid)) { MultiView_NewsDetail.SetActiveView(View_New); } else { MultiView_NewsDetail.SetActiveView(View_Detail); if (Request.QueryString["PageLink"] == "Disable") { hlink_Edit_News.Enabled = false; btn_PostComment.Enabled = false; } // Init Comment Form RadEditor_Comment.ToolsFile = "~/App_Data/Editor/BasicTools.xml"; RadEditor_Comment.EditModes = Telerik.Web.UI.EditModes.Design | Telerik.Web.UI.EditModes.Preview; RadEditor_Comment.Content = ""; if (!DataEval.IsEmptyQuery(Request["NexusNewsPostID"])) { Lib.NewsMgr myNewsMgr = new Lib.NewsMgr(); Lib.News_Post myNews_Post = myNewsMgr.Get_News_Post(Request["NexusNewsPostID"]); if (Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page)) { hlink_Edit_News.Visible = true; hlink_Edit_News.Attributes["href"] = "#"; hlink_Edit_News.Attributes["onclick"] = string.Format("return Show_ControlManager('/App_AdminCP/SiteAdmin/PoP_ControlPanel.aspx?ControlID={0}&NexusNewsPostID={1}');", "60B08E61-40DA-4989-B401-81B75A619F85", myNews_Post.NewsID); } else { hlink_Edit_News.Visible = false; } // Page Title if (_ispagetitle) { Page.Title = myNews_Post.News_Title; } // Fillup Post Content List <News_Post> myNews_Posts = new List <News_Post>(); myNews_Posts.Add(myNews_Post); FormView_NewsDetail.DataSource = myNews_Posts; FormView_NewsDetail.DataKeyNames = new string[] { "NewsID" }; Core.Tools.AppItemTemplates myNewsDetail_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_newsdetail_itemtemplate) { case "Default": myNewsDetail_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsDetail_Default.ascx"; break; case "Custom": myNewsDetail_ItemTemplate.ItemTemplatePath = _newsdetail_itemtemplateurl; break; default: myNewsDetail_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsDetail_Default.ascx"; break; } FormView_NewsDetail.ItemTemplate = Page.LoadTemplate(myNewsDetail_ItemTemplate.ItemTemplatePath); try { FormView_NewsDetail.DataBind(); } catch { // Load Template Failed } //lbl_Title.Text = myNews_Post.News_Title; //lbl_News_Date.Text = myNews_Post.News_Date_Short; //lbl_UserName.Text = myNews_Post.UserName; //Literal_Content.Text = myNews_Post.News_Content; //lbl_Post_ModifyDate.Text = myNews_Post.News_ModifyDate; //lbl_Comment_Count.Text = myNews_Post.Comment_Count; //// Fillup Author //if (DataEval.IsEmptyQuery(myNews_Post.Author) && DataEval.IsEmptyQuery(myNews_Post.Source_Name)) //{ // Panel_Original_Source.Visible = false; //} //else //{ // Panel_Original_Source.Visible = true; // if (!DataEval.IsEmptyQuery(myNews_Post.Author)) // lbl_Author.Text = "Author : " + myNews_Post.Author; // if (!DataEval.IsEmptyQuery(myNews_Post.Source_Name_URL)) // lbl_Source_Name.Text = "Source : " + myNews_Post.Source_Name_URL; //} // Enable Comment if (_iscomment) { // Show Comment Title #region Show Comment Title FormView_Comment.DataSource = myNews_Posts; FormView_Comment.DataKeyNames = new string[] { "NewsID" }; Core.Tools.AppItemTemplates myCommentTitle_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_commenttitle_itemtemplate) { case "Default": myCommentTitle_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsCommentTitle_Default.ascx"; break; case "Custom": myCommentTitle_ItemTemplate.ItemTemplatePath = _commenttitle_itemtemplateurl; break; default: myCommentTitle_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsCommentTitle_Default.ascx"; break; } FormView_Comment.ItemTemplate = Page.LoadTemplate(myCommentTitle_ItemTemplate.ItemTemplatePath); try { FormView_Comment.DataBind(); } catch { // Load Template Failed } #endregion // Load User Name and Disable Guest Comment string _current_username = Security.Users.UserStatus.Current_UserName(this.Page); if (_current_username == "Guest") { if (_isguestcomment) { btn_PostComment.Enabled = true; } else { btn_PostComment.Enabled = false; } tbx_Comment_UserName.Enabled = true; Panel_Comment_Contact.Visible = false; } else { tbx_Comment_UserName.Text = _current_username; tbx_Comment_UserName.Enabled = false; Panel_Comment_Contact.Visible = true; } // Bind Post Comment ListView_Comment.DataSource = myNewsMgr.Get_News_Comments(Request["NexusNewsPostID"], "1"); ListView_Comment.DataKeyNames = new string[] { "CommentID" }; Core.Tools.AppItemTemplates myComment_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_comment_itemtemplate) { case "Default": myComment_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsComment_Default.ascx"; break; case "Custom": myComment_ItemTemplate.ItemTemplatePath = _comment_itemtemplateurl; break; default: myComment_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_News/Templates/NewsComment_Default.ascx"; break; } myComment_ItemTemplate.Set_Separator(""); myComment_ItemTemplate.Set_DataEmpty(""); ListView_Comment.ItemTemplate = Page.LoadTemplate(myComment_ItemTemplate.ItemTemplatePath); ListView_Comment.AlternatingItemTemplate = Page.LoadTemplate(myComment_ItemTemplate.AltPath); if (!DataEval.IsEmptyQuery(myComment_ItemTemplate.Separator)) { ListView_Comment.ItemSeparatorTemplate = Page.LoadTemplate(myComment_ItemTemplate.Separator); } if (!DataEval.IsEmptyQuery(myComment_ItemTemplate.DataEmpty)) { ListView_Comment.EmptyDataTemplate = Page.LoadTemplate(myComment_ItemTemplate.DataEmpty); } try { ListView_Comment.DataBind(); } catch { // Load Template Failed } DataPager_PostView.PageSize = _numberperpage; Panel_Comment.Visible = true; } else { Panel_Comment.Visible = false; } } else { // No Post ID hlink_Edit_News.Visible = false; Panel_Comment.Visible = false; } } }
private void Control_Init() { if (DataEval.IsEmptyQuery(_postviewid)) { MultiView_PostView.SetActiveView(View_New); } else { if (Request.QueryString["PageLink"] == "Disable") { lbtn_Edit_Post.Enabled = false; btn_PostComment.Enabled = false; } if (_view_stage == "view_edit") { MultiView_PostView.SetActiveView(View_Edit); } else { MultiView_PostView.SetActiveView(View_Post); _view_stage = "view_post"; ViewState["ViewStage"] = _view_stage; // Init Comment Form RadEditor_Comment.ToolsFile = "~/App_Data/Editor/BasicTools.xml"; RadEditor_Comment.EditModes = Telerik.Web.UI.EditModes.Design | Telerik.Web.UI.EditModes.Preview; if (!DataEval.IsEmptyQuery(Request["NexusBlogPostID"])) { Lib.BlogMgr myBlogMgr = new Lib.BlogMgr(); Lib.Blog_Post myBlog_Post = myBlogMgr.Get_Blog_Post(Request["NexusBlogPostID"]); if (Security.Users.UserStatus.Validate_Ownership(this.Page, myBlog_Post.Ownership_UserID) || Security.Users.UserStatus.Validate_PageAuth_Modify(this.Page)) { lbtn_Edit_Post.Visible = true; } else { lbtn_Edit_Post.Visible = false; } // Page Title if (_ispagetitle) { Page.Title = myBlog_Post.Post_Title; } // Fillup Post Content List <Blog_Post> myPostViews = new List <Blog_Post>(); myPostViews.Add(myBlog_Post); FormView_PostView.DataSource = myPostViews; FormView_PostView.DataKeyNames = new string[] { "PostID" }; Core.Tools.AppItemTemplates myPostView_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_postview_itemtemplate) { case "Default": myPostView_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/PostView_Default.ascx"; break; case "Custom": myPostView_ItemTemplate.ItemTemplatePath = _postview_itemtemplateurl; break; default: myPostView_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/PostView_Default.ascx"; break; } FormView_PostView.ItemTemplate = Page.LoadTemplate(myPostView_ItemTemplate.ItemTemplatePath); try { FormView_PostView.DataBind(); } catch { // Load Template Failed } //lbl_Title.Text = myBlog_Post.Post_Title; //lbl_Post_Date.Text = myBlog_Post.Post_Date_Short; //lbl_UserName.Text = myBlog_Post.UserName; //Literal_Content.Text = myBlog_Post.Post_Content; //lbl_Post_ModifyDate.Text = myBlog_Post.Post_ModifyDate; //lbl_Comment_Count.Text = myBlog_Post.Comment_Count; //// Add Social button //PlaceHolder_SocialNetwork.Controls.Clear(); //string _facebook = string.Format("http://www.facebook.com/sharer.php?u={0}&t={1}", Server.UrlEncode(Request.Url.ToString()), Server.UrlEncode(myBlog_Post.Post_Title)); //HyperLink myHyperLink = new HyperLink(); //myHyperLink.NavigateUrl = _facebook; //myHyperLink.Target = "_blank"; //myHyperLink.ImageUrl = "~/App_Control_Style/Nexus_Blog/SocialBookmark/Facebook_24.png"; //PlaceHolder_SocialNetwork.Controls.Add(myHyperLink); // Load User Name and Disable Guest Comment string _current_username = Security.Users.UserStatus.Current_UserName(this.Page); if (_current_username == "Guest") { if (_isguestcomment) { btn_PostComment.Enabled = true; } else { btn_PostComment.Enabled = false; } tbx_Comment_UserName.Enabled = true; Panel_Comment_Contact.Visible = false; } else { tbx_Comment_UserName.Text = _current_username; tbx_Comment_UserName.Enabled = false; Panel_Comment_Contact.Visible = true; } // Bind Post Comment ListView_Comment.DataSource = myBlogMgr.Get_Blog_Comments(Request["NexusBlogPostID"], "1"); ListView_Comment.DataKeyNames = new string[] { "CommentID" }; Core.Tools.AppItemTemplates myComment_ItemTemplate = new Core.Tools.AppItemTemplates(); switch (_comment_itemtemplate) { case "Default": myComment_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/PostComment_Default.ascx"; break; case "Custom": myComment_ItemTemplate.ItemTemplatePath = _comment_itemtemplateurl; break; default: myComment_ItemTemplate.ItemTemplatePath = "~/App_Control_Style/Nexus_Blog/Templates/PostComment_Default.ascx"; break; } myComment_ItemTemplate.Set_Separator(""); myComment_ItemTemplate.Set_DataEmpty(""); ListView_Comment.ItemTemplate = Page.LoadTemplate(myComment_ItemTemplate.ItemTemplatePath); ListView_Comment.AlternatingItemTemplate = Page.LoadTemplate(myComment_ItemTemplate.AltPath); if (!DataEval.IsEmptyQuery(myComment_ItemTemplate.Separator)) { ListView_Comment.ItemSeparatorTemplate = Page.LoadTemplate(myComment_ItemTemplate.Separator); } if (!DataEval.IsEmptyQuery(myComment_ItemTemplate.DataEmpty)) { ListView_Comment.EmptyDataTemplate = Page.LoadTemplate(myComment_ItemTemplate.DataEmpty); } try { ListView_Comment.DataBind(); } catch { // Load Template Failed } DataPager_PostView.PageSize = _numberperpage; DataPager_PostView.Visible = _enable_pager; } else { // No Post ID lbtn_Edit_Post.Visible = false; btn_PostComment.Visible = false; } } } }