using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CitySunlight.Product
{
    public partial class ProductShow : System.Web.UI.Page
    {

        public String type;
        public String username;

        public String name;
        public String url;
        public String picurl;

        public String price;
        public String amount;
        public String user;
        public String edit;
        public String classname;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] != null)
            {
                username = Session["username"].ToString();
            }
            int id = HttpUtils.getQueryString("id").ToInt();
            GetProductInfo(id);
        }

        private void GetProductInfo(int id)
        {
            name = ProductManager.GetProductInfo(id, ProductManager.Info.ItemName);
            picurl = ProductManager.GetProductInfo(id, ProductManager.Info.PicUrl);
            price = ProductManager.GetProductInfo(id, ProductManager.Info.Price);
            amount = ProductManager.GetProductInfo(id, ProductManager.Info.Amount);
            user = ProductManager.GetProductInfo(id, ProductManager.Info.UserName);
            edit = "<a href=\"/Product/ProductEdit.aspx?id=" + id + "&type=edit\" >编辑</a>";
            classname = ProductClassManager.getClassName(int.Parse(ProductManager.GetProductInfo(id, ProductManager.Info.Class)));
        }

    }
}