/*
'' ============================================================================================
'' 项目名称：风越项目范例ASPX普通三层结构
'' 项目版本：V1.0
'' 项目描述：风越项目范例，用于建立ASPX普通三层结构
'' 文件名称：ChengShi_detail.aspx
'' 文件描述：信息详情文件 （城市）
'' 公司名称：中极网盛
'' 开发人员：刘怒
'' 创建日期：2008-12-25 20:23:50
'' 修订日期：2009-01-14 12:12:20
'' 版权信息：Copyright (C) 2008

'' 项目升级时需读取以下生成工具的版权信息
'' 生成工具：风越代码生成器 [FireCode Creator]
'' 当前版本：通用版 V1.5
'' 官方网站：http://www.sino8848.com
'' ============================================================================================
*/

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FypSystem.Common;
using FypSystem.DBManager;

namespace Fyp_3TierCommon.Web
{
    public partial class ChengShi_detail : System.Web.UI.Page
    {
        
        int req_CITY_ID; 

        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = WebPage.GetConfig("fypWebName");

            if (!StringExtend.IsEmpty(this.Request.QueryString["CITY_ID"]))
            {
            
                
                
                req_CITY_ID = int.Parse(this.Request.QueryString["CITY_ID"]);
                

                
                
            
            }
            if (StringExtend.IsEmpty(req_CITY_ID))
            {
                //如找不到指定记录，提示
                FypSystem.Common.WebPage.JsAlert(this, "未指定合法的参数！");
            }
            else if (!this.Page.IsPostBack)
            {
                Initialize();
            }
        }

        /// <summary>
        /// 读取数据库指定记录
        /// </summary>
        /// <returns></returns>
        private Fyp_3TierCommon.Model.Model_CITY GetModelData()
        {
            Fyp_3TierCommon.Model.Model_CITY model_CITY = new Fyp_3TierCommon.BLL.BLL_CITY().GetModel(req_CITY_ID);

            return model_CITY;
        }

        /// <summary>
        /// 导入默认值、数据
        /// </summary>
        private void Initialize()
        {
            Fyp_3TierCommon.Model.Model_CITY model_CITY = GetModelData();
            if (model_CITY != null)
            {
                try
                {
					string strValue;
            
                    strValue = "";
                
                    if (model_CITY.CITY_ID != null)
    					strValue = model_CITY.CITY_ID.ToString();
                

                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
					
                    this.lab_CITY_ID_Show.Text = WebString.HtmlEncodeExtend(strValue);
                    

                    
            
                    strValue = "";
                
                    if (model_CITY.PROVINCE_ID != null)
    					strValue = model_CITY.PROVINCE_ID.ToString();
                

                
                    if (strValue.Length > 0)
                    {
                        Fyp_3TierCommon.Model.Model_PROVINCE model_PROVINCE = new Fyp_3TierCommon.BLL.BLL_PROVINCE().GetModel(model_CITY.PROVINCE_ID);
                        if (model_PROVINCE != null && model_PROVINCE.PROVINCE_ID != null)
                            strValue = model_PROVINCE.PROVINCE_ID.ToString();
                    }
                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
					
                    this.lab_PROVINCE_ID_Show.Text = WebString.HtmlEncodeExtend(strValue);
                    

                    
            
                    strValue = "";
                
                    if (model_CITY.CITY_CN != null)
    					strValue = model_CITY.CITY_CN.ToString();
                

                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
					
                    this.lab_CITY_CN_Show.Text = WebString.HtmlEncodeExtend(strValue);
                    

                    
            
                    strValue = "";
                
                    if (model_CITY.CITY_EN != null)
    					strValue = model_CITY.CITY_EN.ToString();
                

                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
					
                    this.lab_CITY_EN_Show.Text = WebString.HtmlEncodeExtend(strValue);
                    

                    
            
                    strValue = "";
                
                    if (model_CITY.CITY_AREA_CODE != null)
    					strValue = model_CITY.CITY_AREA_CODE.ToString();
                

                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
					
                    this.lab_CITY_AREA_CODE_Show.Text = WebString.HtmlEncodeExtend(strValue);
                    

                    
            
                }
                catch (System.Exception err)
                {
                    FypSystem.Common.WebPage.JsAlert(this, err.Message);
                }
            }
            else
            {
                //找不到指定记录时
                FypSystem.Common.WebPage.JsAlert(this, "未找到指定记录！");
            }
        }

        

        
    }
}