/*
'' ============================================================================================
'' 项目名称：风越项目范例ASPX单层框架
'' 项目版本：V1.0
'' 项目描述：
'' 文件名称：YongHuXinXi_detail.aspx
'' 文件描述：信息详情文件 （用户信息）
'' 公司名称：中极网盛
'' 开发人员：刘怒
'' 创建日期：2008-8-7 21:34:32
'' 修订日期：2009-03-10 05:59:18
'' 版权信息：Copyright (C) 2008

'' 项目升级时需读取以下生成工具的版权信息
'' 生成工具：风越代码生成器 [FireCode Creator]
'' 当前版本：通用版 V1.8
'' 官方网站：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;

public partial class YongHuXinXi_detail : System.Web.UI.Page
{
    
    string strReq_USER_ID = ""; 
    string strReq_USER_NAME = ""; 

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

        
        strReq_USER_ID = this.Request.QueryString["USER_ID"]; 
        strReq_USER_NAME = this.Request.QueryString["USER_NAME"]; 

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

    /// <summary>
    /// 读取数据库指定记录
    /// </summary>
    /// <returns></returns>
    
    private FypSystem.DBManager.SortedItem GetRecordData(FypSystem.DBManager.Access dbManager)
    
    
    {
        FypSystem.DBManager.SortedItem itemCurrent = new SortedItem();
        //string strSql = "select [USER_ID], [USER_NAME], [USER_PWD], [USER_BIRTHDAY], [USER_PHOTO], [USER_COMPANY], [USER_DEPT], [USER_INFO] from [USER] where [USER_ID] = " + strReq_USER_ID + " and [USER_NAME] = '" + strReq_USER_NAME + "'";

        string strSql = "select * from [USER] where [USER_ID] = " + strReq_USER_ID + " and [USER_NAME] = '" + strReq_USER_NAME + "'";
        itemCurrent = dbManager.Read(strSql);
        return itemCurrent;
    }

    /// <summary>
    /// 导入默认值、数据
    /// </summary>
    private void Initialize()
    {

        using (FypSystem.DBManager.Access dbManager = new FypSystem.DBManager.Access())


        {
            string strSql = "";
            FypSystem.DBManager.SortedItem item = GetRecordData(dbManager);
            if (item.Count > 0)
            {
                try
                {
            
                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
                    
                    this.lab_USER_ID_Show.Text = WebString.HtmlEncodeExtend(item["USER_ID"].ToString());
                    

                    
            
                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
                    
                    this.lab_USER_NAME_Show.Text = WebString.HtmlEncodeExtend(item["USER_NAME"].ToString());
                    

                    
            
                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
                    
                    this.lab_USER_PWD_Show.Text = WebString.HtmlEncodeExtend(item["USER_PWD"].ToString());
                    

                    
            
                

                    

                    
                    item["USER_BIRTHDAY"] = FypSystem.Common.StringExtend.FormatDateTime(item["USER_BIRTHDAY"], "yyyy-MM-dd");

                    

                    

                    

                    

                    

                    

                    

                    

                    
                    
                    this.lab_USER_BIRTHDAY_Show.Text = WebString.HtmlEncodeExtend(item["USER_BIRTHDAY"].ToString());
                    

                    
            
                

                    

                    

                    

                    

                    

                    

                    
                    item["USER_PHOTO"] = "<a href='" + item["USER_PHOTO"].ToString() + "'>打开文件 " + item["USER_PHOTO"].ToString() + "</a>";

                    

                    

                    

                    
                    

                    
                    this.lab_USER_PHOTO_Show.Text = item["USER_PHOTO"].ToString();
                    
            
                
                    if (item["USER_COMPANY"].ToString().Length > 0)
                    {
                        strSql = "select [COMPANY_NAME] from [COMPANY] where [COMPANY_ID]=" + item["USER_COMPANY"].ToString() + "";
                        if (dbManager.Read(strSql).Count > 0)
                        {
                            string str_USER_COMPANY = dbManager.Read(strSql)["COMPANY_NAME"].ToString();
                            item["USER_COMPANY"] = WebString.HtmlEncodeExtend(str_USER_COMPANY);
                        }
                    }
                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
                    
                    this.lab_USER_COMPANY_Show.Text = WebString.HtmlEncodeExtend(item["USER_COMPANY"].ToString());
                    

                    
            
                
                    if (item["USER_DEPT"].ToString().Length > 0)
                    {
                        strSql = "select [DEPARTMENT_NAME] from [DEPARTMENT] where [DEPARTMENT_ID]=" + item["USER_DEPT"].ToString() + "";
                        if (dbManager.Read(strSql).Count > 0)
                        {
                            string str_USER_DEPT = dbManager.Read(strSql)["DEPARTMENT_NAME"].ToString();
                            item["USER_DEPT"] = WebString.HtmlEncodeExtend(str_USER_DEPT);
                        }
                    }
                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
                    
                    this.lab_USER_DEPT_Show.Text = WebString.HtmlEncodeExtend(item["USER_DEPT"].ToString());
                    

                    
            
                

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    

                    
                    
                    this.lab_USER_INFO_Show.Text = WebString.HtmlEncodeExtend(item["USER_INFO"].ToString());
                    

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

    

    
}