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.IO;
using System.Data.SqlClient;
using System.Text;
public partial class control_Tradedetail : System.Web.UI.UserControl
{
public string proname = string.Empty;
public string description = string.Empty;
public string details = string.Empty;
public string picture = string.Empty;
public string fobprice = string.Empty;
public string minorder = string.Empty;
public string port = string.Empty;
public string payment = string.Empty;
public string deliverytime = string.Empty;
public string supplyability = string.Empty;
public string package = string.Empty;
public string productdetails = string.Empty;
public string sendyour = string.Empty;
public string email = string.Empty;
public string telfax = string.Empty;
public string message = string.Empty;
public string pleaseenter = string.Empty;
public string sendmessage = string.Empty;
public string rewrite = string.Empty;
public string related = string.Empty;
public string xianshi = string.Empty;
public string pic = string.Empty;
public string url = string.Empty;
public int lid = 0, userId = 0;
public string style2 = string.Empty;
Fun fun1 = new Fun();
public string style = string.Empty, style1 = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["lid"] != null && Request.QueryString["url"]!=null)
{
url = Request.QueryString["url"].ToString();
DataSet dss = fun1.trade_product(url);
if (dss.Tables[0].Rows.Count > 0)
{
lid = Convert.ToInt32(Request.QueryString["lid"].ToString());
DataSet ds = DbHelperSQL.Query("select * from trade_product where proId=" + lid + "and userId=" + dss.Tables[0].Rows[0]["userId"].ToString() + " and lang='" + dss.Tables[0].Rows[0]["lang"].ToString() + "' ");
if (ds.Tables[0].Rows.Count > 0)
{
if (!IsPostBack)
{
etw.trade_name leadname = new etw.trade_name();
leadname.lang = dss.Tables[0].Rows[0]["lang"].ToString();
leadname.GetModel();
productdetails = leadname.productdetails;
sendyour = leadname.sendyour;
email = leadname.email;
telfax = leadname.telfax;
message = leadname.message;
pleaseenter = leadname.pleaseenter;
sendmessage = leadname.sendmessage;
rewrite = leadname.rewrite;
related = leadname.related;
etw.trade_product lead = new etw.trade_product();
lead.proId = lid;
lead.userId = Convert.ToInt32(dss.Tables[0].Rows[0]["userId"].ToString());
userId = Convert.ToInt32(dss.Tables[0].Rows[0]["userId"].ToString());
lead.lang = dss.Tables[0].Rows[0]["lang"].ToString();
lead.GetModel();
proname = lead.proname;
description = lead.description;
details = lead.details;
picture = lead.picture;
if (lead.fobprice != null && lead.fobprice != "")
{
fobprice = leadname.fobprice + "" + lead.fobprice + "" + "
";
}
if (lead.port != null && lead.port != "")
{
port = leadname.port + lead.port.ToString() + "
";
}
if (lead.payment != null && lead.payment != "")
{
payment = leadname.payment + lead.payment.ToString() + "
";
}
if (lead.minorder != null && lead.minorder != "")
{
minorder = leadname.minorder + lead.minorder.ToString() + "
";
}
if (lead.deliverytime != null && lead.deliverytime != "")
{
deliverytime = leadname.deliverytime + lead.deliverytime.ToString() + "
";
}
if (lead.supplyability != null && lead.supplyability != "")
{
supplyability = leadname.supplyability + lead.supplyability.ToString() + "
";
}
if (lead.package != null && lead.package != "")
{
package = leadname.package + lead.package.ToString() + "
";
}
BindRelatedImgs();
BindGrid();
}
}
else
{
Fun.JsAlerT("Sorry, the requested URL was not found here.", "../trade.html");
Response.End();
}
}
}
else
{
Fun.JsAlerT("Sorry, the requested URL was not found here.", "../trade.html");
Response.End();
}
}
public void BindRelatedImgs()
{
try
{
string[] strArray = picture.Split(new char[] { ';' });
pic = strArray[0].Trim();
if (strArray.Length > 2)
{
style = "style=\"background:url(../images/left.gif) no-repeat 11px center;height:58px;\"";
style1 = "style=\"background:url(../images/right1.gif) no-repeat 11px center;height:58px;\"";
DataTable table = new DataTable();
table.Columns.Add(new DataColumn("img", typeof(string)));
for (int i = 0; i < strArray.Length; i++)
{
if (strArray[i].Trim() != "")
{
DataRow row = table.NewRow();
row[0] = strArray[i].Trim();
table.Rows.Add(row);
}
}
Repeater1.DataSource = table;
Repeater1.DataBind();
}
}
catch
{
}
}
public void BindGrid()
{
DataSet ds1 = fun1.trade_product(url);
if (ds1.Tables[0].Rows.Count > 0)
{
DataSet ds = DbHelperSQL.Query("select * from trade_pro_param where proId='" + lid + "' and parameter!=''and paramvalue!=''and userId=" + ds1.Tables[0].Rows[0]["userId"].ToString() + " and lang='" + ds1.Tables[0].Rows[0]["lang"].ToString() + "'");
if (ds.Tables[0].Rows.Count > 0)
{
style2 = "style=\"border-bottom:1px #ccc dashed;\"";
Repeater2.DataSource = ds.Tables[0].DefaultView;
Repeater2.DataBind();
}
}
}
}