protected void dangBangDate() { DropDownList0.Items.Add(new ListItem("请选择", "0")); ProductsTypeDAL dl = new ProductsTypeDAL(); if (dl != null) { List <ProductsType> list = dl.getAllProductsTypeCanUser(); foreach (ProductsType t in list) { if (t.State.Equals("Y")) { DropDownList0.Items.Add(new ListItem(t.TypeName, t.TypeID.ToString())); } } } DropDownList1.Items.Add(new ListItem("请选择", "")); foreach (ProductsBrand t in Leyp.SQLServerDAL.Factory.getProductsBrandDAL().getAllProductsBrand()) { if (t.State.Equals("Y")) { DropDownList1.Items.Add(new ListItem(t.BrandName, t.BrandID.ToString())); } } }
protected void DataBand() { object PID = Request.QueryString["ProductsID"]; string ProductsID = PID.ToString(); VProducts p = new VProducts(); p = new VProductsDAL().getByID(int.Parse(ProductsID)); if (p == null) { Response.Write("没有你要的数据"); Response.End(); return; } int typeid = p.TypeID; ProductsType pt = new ProductsTypeDAL().getByTypeID(typeid); if (getTypeID() != 0) { if (pt.State.Equals("NB")) { Response.Write("没有权限"); Response.End(); return; } } Label1.Text = p.BrandName; Label2.Text = p.TypeName; Label3.Text = p.ProductsUints; Label4.Text = p.Color; Label5.Text = p.Spec; Label6.Text = p.Weight; Label7.Text = p.Material; Label8.Text = ProductsID; Label9.Text = p.ProductsName; Image1.ImageUrl = "~/UploadFiles/Images/" + p.PhotoUrl + ""; ProductsUserType pu = Leyp.SQLServerDAL.Factory.getProductsUserTypeDAL().getByProductsIDAndSubClassID(int.Parse(ProductsID), 1);//按用户类型给出一个商品的标价 Label10.Text = pu.Price.ToString(); ListBand(int.Parse(ProductsID)); }