예제 #1
0
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Lib.PhotoMgr myPhotoMgr = new Lib.PhotoMgr();

                e2Data[] UpdateData =
                {
                    new e2Data("PhotoID",           _itemid),
                    new e2Data("Photo_Title",       tbx_Photo_Title.Text),
                    new e2Data("Description",       TextEditor_Description.Content),
                    new e2Data("ImageURL",          tbx_ImageURL.Text),
                    new e2Data("ImageURL_Type",     droplist_ImageType.SelectedValue),
                    new e2Data("AlternateText",     tbx_AlternateText.Text),
                    new e2Data("IsActive",          rbtn_IsActive.SelectedValue),
                    new e2Data("LastUpdate_Date",   DateTime.Now.ToString()),
                    new e2Data("LastUpdate_UserID", Security.Users.UserStatus.Current_UserID(this.Page))
                };

                myPhotoMgr.Edit_Photo(UpdateData);

                // Finish Update Close Window
                string _finishupdate_script = string.Format("CloseAndRebind({0});", DataEval.QuoteText("Module_ControlPanel"));
                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "myScript", _finishupdate_script, true);
            }
        }
예제 #2
0
        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);
            }
        }