void init() { Bll.ProductBll pb = new Bll.ProductBll(); DataTable dt = pb.SelectPro("select * from tab_products where type=N'商城' and productID=176"); // DataTable dt = pb.SelectPro("select * from tab_products where type=N'商城' and productID=" + Request.QueryString["productID"]); this.Label1.Text = DateTime.Parse(dt.Rows[0]["productDate"].ToString()).ToShortDateString(); this.HyperLink1.NavigateUrl = this.HyperLink2.NavigateUrl = "#"; this.HyperLink1.Text = dt.Rows[0]["productName"].ToString(); content = dt.Rows[0]["msg"].ToString(); this.Label2.Text = dt.Rows[0]["productUnitPrice"].ToString(); ViewState["shopitemid"] = dt.Rows[0]["productID"]; itemid = ViewState["shopitemid"].ToString(); }
public ActionResult Index() { IProductBll productBll = new Bll.ProductBll(); var productList1 = productBll.LoadEntity(m => m.pcategoryId == 1).ToList(); var productList2 = productBll.LoadEntity(m => m.pcategoryId == 2).ToList(); var hotProduct = productBll.LoadPageEntity(1, 6, out int total, m => true, m => m.Phot, false); var lastProduct = productBll.LoadPageEntity(1, 6, out int totals, m => true, m => m.productId, true); var category1 = productBll.DoubleSelet().Where(s => s.CategotyId == 1).FirstOrDefault(); //var category3 = productBll.DoubleSelet().Where(s => s.CategotyId ==2).FirstOrDefault(); Model.ViewModel.IndexView index = new Model.ViewModel.IndexView() { Product1 = productList1, Product2 = productList2, Product3 = hotProduct, Product4 = lastProduct, Categories1 = category1, //Categories3=category3 }; return(View(index)); }