using System;
using System.Collections;
using System.Configuration;
using System.Data;
 
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace MYAPP.Manage.Project.Design.Scene
{
    public partial class UpLoad_Scene_SPIC : MyApp.Web.UI.UserPage
    {
        public string _Scene_ID = "", _Tour_ID = "";
        public string _name = "t";
        override protected void AppInit()//程序基本信息初始化
        {
            try
            {
                _Tour_ID = Request.QueryString["Tour_ID"].Trim();
                _Scene_ID = Request.QueryString["Scene_ID"].Trim();
            }
            catch (Exception)
            {
                ButPost.Enabled = false;
                ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script language=javascript>alert('错误!!!');</script>");
                return;
            }
            base.action = "edit";
        }

        protected override void pl_register_script()
        {

        }

        protected void Page_Init(object sender, EventArgs e)
        {
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        override protected void pl_edit()
        {
            if (MyApp.Components.KRPano.Scene.IsSceneExist(_name, _Tour_ID, _Scene_ID))
            {
                ib_img.ImageUrl = String.Format("/Project/{0}/Scene/{1}/{2}.jpg", _Tour_ID, _Scene_ID, _name); ;
                ib_img.Visible = true;
            }
            else
            {
                ib_img.Visible = false;
            }
        }

        protected void ButPost_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                MyApp.Components.KRPano.Scene.UploadScenePic(_name, _Tour_ID, _Scene_ID);

                ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script language=javascript>oWindow.location=oWindow.location;oWindow.close_dialog();</script>");
            }
        }
    }
}
