using System;
using System.IO;
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.CustomMAP.Project
{
    public partial class List_Project : MyApp.Web.UI.UserPage
    {
        public int PageRecord = 15, NowPage, RecordCount, hRecordCount, MaxPage;
        public DataTable list_dt;
        protected override void AppInit()
        {
            base.AppInit();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            MyApp.Components.NavUrl.SetUrl(1);
            try
            {
                Page.DataBind();
            }
            catch (Exception) { }

        }

        protected override void DataInit()
        {
            list_dt = MyApp.Components.CustomMap.Project.GetDirectorys("", PageRecord, ref NowPage, ref RecordCount, ref hRecordCount, ref MaxPage);
            base.DataInit();
        }

        public string GetElemValueByPath(object project_id, string attribute)
        {
            string _File_Dir = Server.MapPath(String.Format("/map/Project/{0}/project.xml", project_id.ToString()));
            StreamReader sr = System.IO.File.OpenText(_File_Dir);
            XmlDocument xmldoc = new XmlDocument();
            xmldoc.LoadXml(sr.ReadToEnd());
            sr.Close();
            XmlNode xmlnode = xmldoc.ChildNodes[0];
            XmlElement xmlelem = (XmlElement)xmlnode;
            if (xmlelem.GetAttribute(attribute).Trim() != "")
            {
                return xmlelem.GetAttribute(attribute).Trim();
            }
            else
            {
                return "　";
            }
        }
    }
}
