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 uc_product_PallPP : System.Web.UI.UserControl
{
    private string id;
    public string pId
    {
        set
        {
            this.id = value.ToString().Trim();
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        
        SqlConnection con = CDatabase.wtoconn();
        con.Open();
        SqlCommand cmd = new SqlCommand("select * from ProductInfo where id="+id, con);
        SqlDataReader sdr2 = cmd.ExecuteReader();
        sdr2.Read();
        this.Pname.Text = sdr2.GetString(3);
        this.Price.Text =Convert.ToString(sdr2.GetDecimal(19));
        this.MakPrice.Text =Convert.ToString(sdr2.GetDecimal(18));
        this.ShPrice.Text = Convert.ToString(sdr2.GetDecimal(18) - sdr2.GetDecimal(19));
        this.Pimg.ImageUrl = "~/upfile/" + sdr2.GetString(25).Trim();
        this.Pimg.PostBackUrl = "~/china/productlist.aspx?id=" + sdr2.GetInt32(0);
        this.buy.PostBackUrl = "~/china/cart.aspx?pid=" + sdr2.GetInt32(0) + "&do=addPP&price=" + this.Price.Text;
        this.fav.PostBackUrl = "~/china/productPP.aspx";
        this.details.PostBackUrl = "~/china/productlist.aspx?id=" + sdr2.GetInt32(0);
        this.Pname.PostBackUrl = "~/china/productlist.aspx?id=" + sdr2.GetInt32(0);
        sdr2.Close();
        con.Close();
    }

}
