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 System.Data.SqlClient;
using SqlOperate;
using Base;

public partial class Admin_Trade_VisitorRequestShow : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckRights("column", "E1");
        if (Request["ID"]!=null)
        {
            SqlParameter[] param = new SqlParameter[] 
            { 
                new SqlParameter("@strSelect","a.*,b.Name"),
                new SqlParameter("@strwhere", "where a.id="+int.Parse(Request["ID"])),
                new SqlParameter("@strtableName", "[W_VisitorRequest] a inner join [W_Products] b on a.ProductId=b.ID"),
                new SqlParameter("@strOrder", "") 
            };
            DataTable dt=SqlHelper.ExecuteTable(CommandType.StoredProcedure, "SP_SelectByWhere", param);
            if (dt!=null)
            {
                this.txtproductName.Text = dt.Rows[0]["Name"].ToString();
                this.txtCompanyName.Text = dt.Rows[0]["CompanyName"].ToString();
                this.txtUserName.Text = dt.Rows[0]["UserName"].ToString();
                this.txtPhone.Text = dt.Rows[0]["Phone"].ToString();
                this.txtFax.Text = dt.Rows[0]["Fax"].ToString();
                this.txtEmail.Text = dt.Rows[0]["Email"].ToString();
                this.txtContent.Text = dt.Rows[0]["RequestContent"].ToString();
                this.txtDate.Text = dt.Rows[0]["AddDate"].ToString();
            }
        }

    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        Response.Redirect("VisitorRequest.aspx");
    }
}
