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;
public partial class WebMain_Product_ProductList : System.Web.UI.UserControl
{
    private string id;
    DropDownList dd1 = new DropDownList();
    DropDownList dd2 = new DropDownList();
    DropDownList dd3 = new DropDownList();
    DropDownList dd4 = new DropDownList();
    DropDownList dd5 = new DropDownList();
    DropDownList dd6 = new DropDownList();
    Label l1 = new Label();
    Label l2 = new Label();
    Label l3 = new Label();
    Label l4 = new Label();
    Label l5 = new Label();
    Label l6 = new Label();
    string picurl = "";
    string pname = "";
    public string Id
    {
        set
        {
            this.id = value.ToString().Trim();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {

        SqlConnection conn = CDatabase.wtoconn();
        conn.Open();
        Session["pid"] = id;
        SqlCommand smd = new SqlCommand("select * from ProductInfo where id="+id, conn);
        SqlDataReader sdr = smd.ExecuteReader();
        sdr.Read();
        int bigid = sdr.GetInt32(1);
        int smaid = sdr.GetInt32(2);
        this.IMG1.Attributes.Add("onclick", "window.open('picmore.aspx?id="+sdr.GetInt32(0)+"')");
        this.Products.Text = sdr.GetString(3);
        pname = sdr.GetString(3);
        this.ProductsNo.Text = sdr.GetString(4);
        
        string BRANDid = sdr.GetString(7);


        this.Unit.Text = sdr.GetString(9);
        this.Unitweight.Text = sdr.GetString(10);
        this.Description.Text = sdr.GetString(8);
        this.pic.ImageUrl = "~/upfile/" + sdr.GetString(26);
        this.pic.Attributes.Add("onclick", "window.open('picmore.aspx?id=" + sdr.GetInt32(0) + "')");
        picurl = sdr.GetString(26);
        this.concent.Text = Server.HtmlDecode(sdr.GetString(33)).Replace("http://127.0.0.1/","../");
        string picmove = sdr.GetString(34);
        string Pnew = sdr.GetString(13).Trim();
        string Phot = sdr.GetString(14).Trim();
        string Pt = sdr.GetString(15).Trim();
        TableRow trP=new TableRow();
        if (Pnew == "y")
        {
            TableCell tcP = new TableCell();
            Image picnew = new Image();
            picnew.ImageUrl = "~/images/newicon.gif";
            tcP.Controls.Add(picnew);
            trP.Controls.Add(tcP);
        }
        if (Phot == "y")
        {
            TableCell tcP2 = new TableCell();
            Image pichot = new Image();
            pichot.ImageUrl = "~/images/hoticon.gif";
            tcP2.Controls.Add(pichot);
            trP.Controls.Add(tcP2);
        }
        if (Pt == "y")
        {
            TableCell tcP3 = new TableCell();
            Image pt = new Image();
            pt.ImageUrl = "~/images/commendicon.gif";
            tcP3.Controls.Add(pt);
            trP.Controls.Add(tcP3);
        }

        sdr.Close();
        conn.Close();
    }

      
    
   
    }
