public void LoadPage() { CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Product'"); int id = Rint("id"); product = EX_Product.GetProduct(id); if (product.id == 0) { Response.End(); } Protype = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id); GetProWords(); supplier = B_Lebi_Supplier.GetModel(product.Supplier_id); if (supplier == null) { supplier = new Lebi_Supplier(); } product.IsSupplierTransport = supplier.IsSupplierTransport; }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { pageindex = RequestTool.RequestInt("page", 1); LoadTheme(themecode, siteid, languagecode, pcode); CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Product'"); int id = Rint_Para("0"); product = EX_Product.GetProduct(id); if (product.id == 0) { Response.Redirect(URL("P_404", "")); Response.End(); } int num = 0; int Count_Views_Show = 0; if (SYS.ClickFlag == "0") { int.TryParse(SYS.ClickNum1, out num); Count_Views_Show = num; } else { int.TryParse(SYS.ClickNum2, out num); Random r = new Random(); int c = r.Next(1, num); Count_Views_Show = c; } string sql = "update [Lebi_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where id=" + id + ""; Common.ExecuteSql(sql); if (product.Product_id > 0) { sql = "update [Lebi_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where Product_id=" + product.Product_id + ""; Common.ExecuteSql(sql); } int DT_id = ShopPage.GetDT(); if (DT_id > 0) { sql = "update [Lebi_DT_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where DT_id = " + DT_id + " and Product_id=" + id + ""; Common.ExecuteSql(sql); if (product.Product_id > 0) { Common.ExecuteSql("update [Lebi_DT_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where DT_id = " + DT_id + " and Product_id=" + product.Product_id + ""); } } Protype = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id); images = EX_Product.ProductImages(product, CurrentTheme); //=============================================================== //处理规格选项 //ProductProperty = Get_guige(product); //处理规格选项结束 //================================================================== //添加访问记录 int Product_id = product.Product_id == 0 ? product.id : product.Product_id; EX_User.UserProduct_Edit(CurrentUser, Product_id, 1, 143, "", 0, ""); path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em>"; if (product.Type_id_ProductType == 321) { path += "<a href=\"" + URL("P_LimitBuy", "") + "\"><span>" + Tag("限时抢购") + "</span></a><em>»</em>"; } else if (product.Type_id_ProductType == 322) { path += "<a href=\"" + URL("P_GroupPurchase", "") + "\"><span>" + Tag("团购") + "</span></a><em>»</em>"; } else if (product.Type_id_ProductType == 323) { path += "<a href=\"" + URL("P_Exchange", "") + "\"><span>" + Tag("积分换购") + "</span></a><em>»</em>"; } else { if (Protype != null) { string[,] parr = Categorypath(Protype.id); for (int i = 0; i <= parr.GetUpperBound(0); i++) { path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>»</em>"; } } } path += "<a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a>"; GetProWords(); ProductStar = Convert.ToInt32(product.Star_Comment); if (ProductStar > 5) { ProductStar = 5; } if (ProductStar < 0) { ProductStar = 0; } }
public Lebi_Product GetProduct(int id) { return(EX_Product.GetProduct(id)); }