private void Control_PreInit() { if (!DataEval.IsEmptyQuery(Request["NexusPhotoID"])) { // Add View Count Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr(); Lib.Photo myPhoto = myPhotoMgr.Get_Photo(Request["NexusPhotoID"]); int _view_count = Convert.ToInt32(myPhoto.View_Count) + 1; e2Data[] UpdateData_Item = { new e2Data("PhotoID", myPhoto.PhotoID), new e2Data("View_Count", _view_count.ToString()) }; myPhotoMgr.Edit_Photo(UpdateData_Item); } }
private void Control_Init() { if (!DataEval.IsEmptyQuery(Request["NexusPhotoID"])) { Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr(); Lib.Photo myPhoto = myPhotoMgr.Get_Photo(Request["NexusPhotoID"]); tbx_Photo_Title.Text = myPhoto.Photo_Title; TextEditor_Description.Content = myPhoto.Description; droplist_ImageType.SelectedValue = StringEnum.GetStringValue(myPhoto.ImageURL_Type); tbx_ImageURL.Text = myPhoto.ImageURL; tbx_AlternateText.Text = myPhoto.AlternateText; rbtn_IsActive.SelectedValue = myPhoto.IsActive.ToString(); _itemid = myPhoto.PhotoID; ViewState["PhotoID"] = _itemid; } else { btn_Update.Enabled = false; } }
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; } } }