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 sql;

public partial class SoftWareDocShow : System.Web.UI.Page
{
    SqlDB sqldb = new SqlDB();
    Operation operate = new Operation();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string sqlStr = "select * from softwareType";
            operate.DataListBind(DataList2, sqlStr);
            InitDoc();
        }
    }
    private void InitDoc()
    {
        string DocId = "";
        if (Request.QueryString["DocId"] == null)
        {
            Response.Redirect("err.aspx");
        }
        else
        {
            DocId = Request.QueryString["DocId"];
        }
        string sqlStr = "select * from softwareDoc where softwareDocId=" + DocId;
        //绑定所有lt        
        DataSet ds = sqldb.GetDS(sqlStr);
        ltDocName.Text = ds.Tables[0].Rows[0][2].ToString();
        ltDocFrom.Text = ds.Tables[0].Rows[0][3].ToString();
        ltDocDate.Text = ds.Tables[0].Rows[0][4].ToString();
        ltDocDetails.Text = ds.Tables[0].Rows[0][5].ToString();
        //得到服务表ID,并根据服务ID显示服务名称
        string softwareId = ds.Tables[0].Rows[0][1].ToString();
        sqlStr = "select softwareName from software where softwareId=" + softwareId;
        lblsoftwareName.Text = sqldb.ExecuteScalar(sqlStr);
        //得到服务类型表ID,并根据服务类型ID显示服务名称
        string softwareTypeId = ds.Tables[0].Rows[0][6].ToString();
        sqlStr = "select softwareTypeName from softwareType where softwareTypeId=" + softwareTypeId;
        lblsoftwareTypeName.Text = sqldb.ExecuteScalar(sqlStr);
        ds.Clear();
    }
}
