using System;
using System.Xml;
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;
using System.Web.UI.WebControls.WebParts;

namespace MYAPP.Manage.Project.Design.Tour.Map
{
    public partial class View_Map_Scene : MyApp.Web.UI.UserPage
    {
        string _Map_Image = "";
        public string _Tour_ID = "";
        public int _MapIndex_ID = 0;

        override protected void AppInit()//程序基本信息初始化
        {
            try
            {
                _Tour_ID = Request.QueryString["Tour_ID"].Trim();
                _MapIndex_ID = Convert.ToInt32(Request.QueryString["MapIndex_ID"]);

            }
            catch (Exception)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script language=javascript>alert('请勿非法操作!!!');window.close();</script>");
                return;
            }
            base.AppInit();
        }

        override protected void DataInit()//数据初始化
        {

        }

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

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

        protected override void pl_register_script()
        {

        }

        override protected void pl_view()
        {

            XmlDocument xmldoc;
            xmldoc = MyApp.Components.XML.XmlDocument.Load(MyApp.Components.KRPano.Project.Get_Project_Name(_Tour_ID));

            try
            {
                XmlElement elem = (XmlElement)xmldoc.SelectNodes("/Project/Maps/Map")[_MapIndex_ID - 1];
                _Map_Image = elem.GetAttribute("url");

                this.Image_Map.ImageUrl = "/Project/" + _Tour_ID + _Map_Image.Replace("%FIRSTXML%", ""); ;

                xds.Data = xmldoc.OuterXml;
                xds.XPath = String.Format("/Project/Maps/Map[position()={0}]/point", _MapIndex_ID);
                this.rp_list.DataSourceID = "xds";
            }
            catch (Exception)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script language=javascript>alert('错误!!!');history.back()</script>");
                return;
            }
        }
    }
}
