private void BindProducts() { LoadParameters(); ProductQuery query = new ProductQuery(); query.Keywords = searchkey; query.ProductCode = productCode; query.PageSize = pager.PageSize; query.CategoryId = categoryId; query.StartDate = startDate; query.EndDate = endDate; query.ProductLineId = lineId; int? selectedValue = dropBrandList.SelectedValue; query.BrandId = selectedValue.HasValue ? dropBrandList.SelectedValue : null; query.PageIndex = pager.PageIndex; query.SortOrder = SortAction.Desc; query.SortBy = "DisplaySequence"; if (categoryId.HasValue) { query.MaiCategoryPath = CatalogHelper.GetCategory(query.CategoryId.Value).Path; } DbQueryResult unclassifiedProducts = ProductHelper.GetUnclassifiedProducts(query); grdProducts.DataSource = unclassifiedProducts.Data; grdProducts.DataBind(); pager1.TotalRecords = pager.TotalRecords = unclassifiedProducts.TotalRecords; }
protected void DoCallback() { this.LoadParameters(); ProductQuery query = new ProductQuery { PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SaleStatus = ProductSaleStatus.OnSale, TopicId = new int?(this.topicid), Keywords = this.productName }; if (this.brandId.HasValue) { query.BrandId = new int?(this.brandId.Value); } query.CategoryId = this.categoryId; if (this.categoryId.HasValue) { query.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } DbQueryResult products = ProductHelper.GetProducts(query); DataTable data = (DataTable) products.Data; this.pager1.TotalRecords = this.pager.TotalRecords = products.TotalRecords; this.grdproducts.DataSource = data; this.grdproducts.DataBind(); }
private void BindProducts() { LoadParameters(); ProductQuery entity = new ProductQuery(); entity.IsMakeTaobao = isPub; entity.Keywords = productName; entity.ProductCode = productCode; entity.CategoryId = categoryId; entity.ProductLineId = lineId; entity.PageSize = pager.PageSize; entity.PageIndex = pager.PageIndex; entity.SaleStatus = ProductSaleStatus.OnSale; entity.SortOrder = SortAction.Desc; entity.SortBy = "DisplaySequence"; entity.StartDate = startDate; entity.EndDate = endDate; if (categoryId.HasValue) { entity.MaiCategoryPath = CatalogHelper.GetCategory(categoryId.Value).Path; } Globals.EntityCoding(entity, true); DbQueryResult products = ProductHelper.GetProducts(entity); grdProducts.DataSource = products.Data; grdProducts.DataBind(); txtSearchText.Text = entity.Keywords; txtSKU.Text = entity.ProductCode; dropCategories.SelectedValue = entity.CategoryId; dropLines.SelectedValue = entity.ProductLineId; dpispub.SelectedValue = entity.IsMakeTaobao.ToString(); pager1.TotalRecords = pager.TotalRecords = products.TotalRecords; }
private void BindProducts() { this.LoadParameters(); ProductQuery entity = new ProductQuery { Keywords = this.productName, ProductCode = this.productCode, CategoryId = this.categoryId, StartDate = this.startDate, EndDate = this.endDate, PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SaleStatus = ProductSaleStatus.Delete, SortOrder = SortAction.Desc, BrandId = this.dropBrandList.SelectedValue.HasValue ? this.dropBrandList.SelectedValue : null, SortBy = "DisplaySequence" }; if (this.categoryId.HasValue) { entity.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } Globals.EntityCoding(entity, true); DbQueryResult products = ProductHelper.GetProducts(entity); this.grdProducts.DataSource = products.Data; this.grdProducts.DataBind(); this.txtSearchText.Text = entity.Keywords; this.txtSKU.Text = entity.ProductCode; this.dropCategories.SelectedValue = entity.CategoryId; this.pager1.TotalRecords = this.pager.TotalRecords = products.TotalRecords; }
private void BindProducts() { LoadParameters(); ProductQuery entity = new ProductQuery(); entity.Keywords = productName; entity.ProductCode = productCode; entity.CategoryId = categoryId; entity.StartDate = startDate; entity.EndDate = endDate; entity.ProductLineId = lineId; entity.PageSize = pager.PageSize; entity.PageIndex = pager.PageIndex; int? selectedValue = dropBrandList.SelectedValue; entity.BrandId = selectedValue.HasValue ? dropBrandList.SelectedValue : null; entity.SaleStatus = ProductSaleStatus.OnStock; entity.SortOrder = SortAction.Desc; entity.SortBy = "DisplaySequence"; if (categoryId.HasValue) { entity.MaiCategoryPath = CatalogHelper.GetCategory(categoryId.Value).Path; } Globals.EntityCoding(entity, true); DbQueryResult products = ProductHelper.GetProducts(entity); grdProducts.DataSource = products.Data; grdProducts.DataBind(); pager1.TotalRecords = pager.TotalRecords = products.TotalRecords; }
public static DbQueryResult GetHomeProduct(MemberInfo member, ProductQuery query) { DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(); if ((currentDistributors != null) && (currentDistributors.UserId != 0)) { return new HomeProductDao().GetHomeProducts(member, query, true); } return new HomeProductDao().GetHomeProducts(member, query, false); }
protected override void AttachChildControls() { this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts"); this.img = (HtmlImage) this.FindControl("imgDefaultBg"); this.pager = (Pager) this.FindControl("pager"); this.litstorename = (Literal) this.FindControl("litstorename"); this.litdescription = (Literal) this.FindControl("litdescription"); this.imgback = (HiImage) this.FindControl("imgback"); this.imglogo = (HiImage) this.FindControl("imglogo"); this.Page.Session["stylestatus"] = "3"; SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PageTitle.AddSiteNameTitle(masterSettings.SiteName); this.litstorename.Text = masterSettings.SiteName; this.litdescription.Text = masterSettings.ShopIntroduction; if (base.referralId <= 0) { HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"]; if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value))) { base.referralId = int.Parse(cookie.Value); } } DistributorsInfo userIdDistributors = new DistributorsInfo(); userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId); if ((userIdDistributors != null) && (userIdDistributors.UserId > 0)) { PageTitle.AddSiteNameTitle(userIdDistributors.StoreName); this.litdescription.Text = userIdDistributors.StoreDescription; this.litstorename.Text = userIdDistributors.StoreName; if (userIdDistributors.Logo != "") { this.imglogo.ImageUrl = userIdDistributors.Logo; } this.imgback.ImageUrl = userIdDistributors.BackImage; } if (this.rptProducts != null) { ProductQuery query = new ProductQuery { PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex }; DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query); this.rptProducts.DataSource = homeProduct.Data; this.rptProducts.DataBind(); this.pager.TotalRecords = homeProduct.TotalRecords; if (this.pager.TotalRecords <= this.pager.PageSize) { this.pager.Visible = false; } } if (this.img != null) { this.img.Src = new VTemplateHelper().GetDefaultBg(); } }
private void btnAddSearch_Click(object sender, EventArgs e) { ProductQuery query = new ProductQuery(); query.Keywords = keywords; query.CategoryId = categoryId; query.SaleStatus = ProductSaleStatus.OnSale; foreach (int num in ProductHelper.GetProductIds(query)) { ArticleHelper.AddReleatesProdcutByArticId(articId, num); } base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true); }
protected void Page_Load(object sender, EventArgs e) { StringBuilder builder = new StringBuilder(); string sarachName = ""; string searchSku = ""; string page = "1"; if (Request.Params["serachName"] != null) { sarachName = Request.Params["serachName"].Trim(); } if (Request.Params["serachSKU"] != null) { searchSku = Request.Params["serachSKU"].Trim(); } if (base.Request.Params["page"] != null) { page = Request.Params["page"].Trim(); } ProductQuery query = new ProductQuery(); query.PageSize = 8; query.PageIndex = Convert.ToInt32(page); query.Keywords = sarachName; query.ProductCode = searchSku; int count = 0; builder.Append("{data:["); DataTable puchaseProducts = SubSiteProducthelper.GetPuchaseProducts(query, out count); for (int i = 0; i < puchaseProducts.Rows.Count; i++) { builder.Append("{'skuId':'"); builder.Append(puchaseProducts.Rows[i]["SkuId"].ToString()); builder.Append("','sku':'"); builder.Append(puchaseProducts.Rows[i]["SKU"].ToString()); builder.Append("','productId':'"); builder.Append(puchaseProducts.Rows[i]["ProductId"].ToString().Trim()); builder.Append("','Name':'"); builder.Append(puchaseProducts.Rows[i]["ProductName"].ToString()); builder.Append("','Price':'"); builder.Append(puchaseProducts.Rows[i]["PurchasePrice"].ToString()); builder.Append("','Stock':'"); builder.Append(puchaseProducts.Rows[i]["Stock"].ToString()); builder.Append("'},"); } builder.Append("],recCount:'"); builder.Append(count); builder.Append("'}"); Response.ContentType = "text/plain"; Response.Write(builder.ToString()); }
protected void btnAddSearch_Click(object sender, EventArgs e) { ProductQuery query = new ProductQuery(); query.Keywords = keywords; query.CategoryId = categoryId; query.SaleStatus = ProductSaleStatus.OnSale; foreach (int num in SubSiteProducthelper.GetProductIds(query)) { if (productId != num) { SubSiteProducthelper.AddRelatedProduct(productId, num); } } base.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true); }
private void BindProducts() { ProductQuery query = new ProductQuery(); query.Keywords = keywords; query.CategoryId = categoryId; if (categoryId.HasValue) { query.MaiCategoryPath = CatalogHelper.GetCategory(categoryId.Value).Path; } query.PageSize = 10; query.PageIndex = pager.PageIndex; query.SaleStatus = ProductSaleStatus.OnSale; query.SortOrder = SortAction.Desc; query.SortBy = "DisplaySequence"; DbQueryResult products = ProductHelper.GetProducts(query); dlstProducts.DataSource = products.Data; dlstProducts.DataBind(); pager.TotalRecords = products.TotalRecords; }
private void BindProducts() { ProductQuery query = new ProductQuery(); query.Keywords = searchkey; query.PageSize = pager.PageSize; query.ProductCode = productcode; if (dropCategories.SelectedValue.HasValue) { query.CategoryId = dropCategories.SelectedValue; query.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(query.CategoryId.Value).Path; } query.PageIndex = pager.PageIndex; query.SortOrder = SortAction.Desc; query.SortBy = "DisplaySequence"; DbQueryResult unclassifiedProducts = SubSiteProducthelper.GetUnclassifiedProducts(query); grdProducts.DataSource = unclassifiedProducts.Data; grdProducts.DataBind(); pager.TotalRecords = unclassifiedProducts.TotalRecords; }
private void BindProducts() { ProductQuery entity = new ProductQuery(); entity.Keywords = productName; entity.ProductCode = productCode; entity.CategoryId = categoryId; if (categoryId.HasValue) { entity.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(categoryId.Value).Path; } entity.PageSize = pager.PageSize; entity.PageIndex = pager.PageIndex; entity.SaleStatus = ProductSaleStatus.OnStock; entity.SortOrder = SortAction.Desc; entity.SortBy = "DisplaySequence"; Globals.EntityCoding(entity, true); DbQueryResult products = SubSiteProducthelper.GetProducts(entity); grdProducts.DataSource = products.Data; grdProducts.DataBind(); pager.TotalRecords = products.TotalRecords; pager1.TotalRecords = products.TotalRecords; }
void BindProducts() { this.LoadParameters(); ProductQuery entity = new ProductQuery(); entity.PageSize = this.pager.PageSize; entity.PageIndex = this.pager.PageIndex; entity.ProductCode = this.txtProductCode.Text; entity.Keywords = this.txtProductName.Text; entity.BrandId = this.dropBrandCategories.SelectedValue; entity.CategoryId = this.ddlCategories.SelectedValue; if (entity.CategoryId.HasValue) { entity.MaiCategoryPath = CategoryBrowser.GetCategory(entity.CategoryId.Value).Path; } entity.SortOrder = SortAction.Desc; entity.SortBy = "DisplaySequence"; Globals.EntityCoding(entity, true); DbQueryResult batchBuyProducts = CommentsHelper.GetBatchBuyProducts(entity); this.batchbuys.DataSource = batchBuyProducts.Data; this.batchbuys.DataBind(); this.pager.TotalRecords = batchBuyProducts.TotalRecords; }
private void BindData() { ProductQuery entity = new ProductQuery(); entity.PageSize = pager.PageSize; entity.PageIndex = pager.PageIndex; entity.ProductCode = productCode; entity.Keywords = name; entity.ProductLineId = lineId; if (grdAuthorizeProducts.SortOrder.ToLower() == "desc") { entity.SortOrder = SortAction.Desc; } entity.SortBy = grdAuthorizeProducts.SortOrderBy; Globals.EntityCoding(entity, true); DbQueryResult authorizeProducts = SubSiteProducthelper.GetAuthorizeProducts(entity, false); grdAuthorizeProducts.DataSource = authorizeProducts.Data; grdAuthorizeProducts.DataBind(); pager.TotalRecords = authorizeProducts.TotalRecords; pager1.TotalRecords = authorizeProducts.TotalRecords; }
public DbQueryResult GetHomeProducts(MemberInfo member, ProductQuery query, bool isdistributor) { int discount = 100; StringBuilder builder = new StringBuilder(); int currentDistributorId = Globals.GetCurrentDistributorId(); builder.Append("ProductId, ProductCode,ShortDescription,ProductName,ShowSaleCounts, ThumbnailUrl60,ThumbnailUrl40,ThumbnailUrl100,ThumbnailUrl180,ThumbnailUrl220,ThumbnailUrl310, MarketPrice,"); if (member != null) { discount = new MemberGradeDao().GetMemberGrade(member.GradeId).Discount; builder.AppendFormat(" (CASE WHEN (SELECT COUNT(*) FROM Hishop_SKUMemberPrice WHERE SkuId = p.SkuId AND GradeId = {0}) = 1", member.GradeId); builder.AppendFormat(" THEN (SELECT MemberSalePrice FROM Hishop_SKUMemberPrice WHERE SkuId = p.SkuId AND GradeId = {0}) ELSE SalePrice*{1}/100 END) AS SalePrice, ", member.GradeId, discount); } else { builder.Append("SalePrice,"); } builder.Append("SaleCounts, Stock"); StringBuilder builder2 = new StringBuilder(" SaleStatus =" + 1); if (isdistributor && (currentDistributorId > 0)) { builder2.AppendFormat(" AND ProductId IN (SELECT ProductId FROM Hishop_DistributorProducts WHERE UserId={0})", currentDistributorId); } return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_Hishop_BrowseProductList p", "ProductId", builder2.ToString(), builder.ToString()); }
public static IList<int> GetProductIds(ProductQuery query) { return ProductProvider.Instance().GetProductIds(query); }
public static DbQueryResult GetAlertProducts(ProductQuery query) { return ProductProvider.Instance().GetAlertProducts(query); }
private void btnAddSearch_Click(object sender, EventArgs e) { ProductQuery query = new ProductQuery(); query.Keywords = txtSearchText.Text; query.CategoryId = categoryId; query.SaleStatus = ProductSaleStatus.OnSale; IList<int> productIds = SubSiteProducthelper.GetProductIds(query); if (SubSiteProducthelper.AddSubjectProducts(subjectType, productIds)) { BindSubjectProducts(); } }
public IList<int> GetProductIds(ProductQuery query) { StringBuilder builder = new StringBuilder(); builder.AppendFormat("SELECT p.ProductId FROM Hishop_Products p WHERE p.SaleStatus = {0}", (int) query.SaleStatus); if (!(string.IsNullOrEmpty(query.ProductCode) || (query.ProductCode.Length <= 0))) { builder.AppendFormat(" AND LOWER(p.ProductCode) LIKE '%{0}%'", DataHelper.CleanSearchString(query.ProductCode)); } if (!string.IsNullOrEmpty(query.Keywords)) { builder.AppendFormat(" AND LOWER(p.ProductName) LIKE '%{0}%'", DataHelper.CleanSearchString(query.Keywords)); } if (query.CategoryId.HasValue) { builder.AppendFormat(" AND (p.CategoryId = {0} OR p.CategoryId IN (SELECT CategoryId FROM Hishop_Categories WHERE Path LIKE (SELECT Path FROM Hishop_Categories WHERE CategoryId = {0}) + '|%'))", query.CategoryId.Value); } IList<int> list = new List<int>(); DbCommand sqlStringCommand = this.database.GetSqlStringCommand(builder.ToString()); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { while (reader.Read()) { list.Add((int) reader["ProductId"]); } } return list; }
public DbQueryResult GetProducts(ProductQuery query) { StringBuilder builder = new StringBuilder(); builder.Append(" 1=1 "); if (query.SaleStatus != ProductSaleStatus.All) { builder.AppendFormat(" AND SaleStatus = {0}", (int) query.SaleStatus); } else { builder.AppendFormat(" AND SaleStatus <> ({0})", 0); } if (query.BrandId.HasValue) { builder.AppendFormat(" AND BrandId = {0}", query.BrandId.Value); } if (query.TypeId.HasValue) { builder.AppendFormat(" AND TypeId = {0}", query.TypeId.Value); } if (query.TagId.HasValue) { builder.AppendFormat(" AND ProductId IN (SELECT ProductId FROM Hishop_ProductTag WHERE TagId={0})", query.TagId); } if (query.TopicId.HasValue) { builder.AppendFormat(" AND ProductId not IN (SELECT RelatedProductId FROM Vshop_RelatedTopicProducts WHERE TopicId={0})", query.TopicId); } if (!string.IsNullOrEmpty(query.Keywords)) { query.Keywords = DataHelper.CleanSearchString(query.Keywords); string[] strArray = Regex.Split(query.Keywords.Trim(), @"\s+"); builder.AppendFormat(" AND ProductName LIKE '%{0}%'", DataHelper.CleanSearchString(strArray[0])); for (int i = 1; (i < strArray.Length) && (i <= 4); i++) { builder.AppendFormat("AND ProductName LIKE '%{0}%'", DataHelper.CleanSearchString(strArray[i])); } } if (query.IsMakeTaobao.HasValue && (query.IsMakeTaobao.Value >= 0)) { builder.AppendFormat(" AND IsMaketaobao={0}", query.IsMakeTaobao.Value); } if (query.IsIncludeHomeProduct.HasValue && !query.IsIncludeHomeProduct.Value) { builder.Append(" AND ProductId NOT IN (SELECT ProductId FROM Vshop_HomeProducts)"); } if (!string.IsNullOrEmpty(query.ProductCode)) { builder.AppendFormat(" AND ProductCode LIKE '%{0}%'", DataHelper.CleanSearchString(query.ProductCode)); } if (query.CategoryId.HasValue) { if (query.CategoryId.Value > 0) { builder.AppendFormat(" AND (MainCategoryPath LIKE '{0}|%' OR ExtendCategoryPath LIKE '{0}|%') ", query.MaiCategoryPath); } else { builder.Append(" AND (CategoryId = 0 OR CategoryId IS NULL)"); } } if (query.StartDate.HasValue) { builder.AppendFormat(" AND AddedDate >='{0}'", DataHelper.GetSafeDateTimeFormat(query.StartDate.Value)); } if (query.EndDate.HasValue) { builder.AppendFormat(" AND AddedDate <='{0}'", DataHelper.GetSafeDateTimeFormat(query.EndDate.Value)); } string selectFields = "ProductId, ProductCode,IsMakeTaobao,ProductName, ThumbnailUrl40, MarketPrice, SalePrice, (SELECT CostPrice FROM Hishop_SKUs WHERE SkuId = p.SkuId) AS CostPrice, Stock, DisplaySequence,SaleStatus"; return DataHelper.PagingByRownumber(query.PageIndex, query.PageSize, query.SortBy, query.SortOrder, query.IsCount, "vw_Hishop_BrowseProductList p", "ProductId", builder.ToString(), selectFields); }
protected void Page_Load(object sender, EventArgs e) { if (string.Compare(base.Request.RequestType, "post", true) != 0) { btnSubmit.Enabled = false; } else if (base.IsPostBack) { tbOrders = (IList<tbOrder>)Session["tbOrders"]; } else { XmlDocument document = new XmlDocument(); if (string.IsNullOrEmpty(base.Request.Form["data"])) { ShowMsg("数据丢失,请关闭此页重新操作", false); } else { document.LoadXml(base.Request.Form["data"]); tbOrders = new List<tbOrder>(); XmlNodeList list = document.FirstChild.SelectNodes("order"); string innerText = null; string str2 = null; for (int i = 0; i < list.Count; i++) { string str3; tbOrder order = new tbOrder(); XmlNode node = list.Item(i); if (innerText == null) { innerText = node.SelectSingleNode("ship_addr").InnerText; str2 = node.SelectSingleNode("ship_name").InnerText; } else { str3 = node.SelectSingleNode("ship_addr").InnerText; string str4 = node.SelectSingleNode("ship_name").InnerText; if ((innerText != str3) || (str2 != str4)) { ShowMsg("收货人地址/姓名不一致不能合并下单!", false); break; } str2 = str4; innerText = str3; } string[] strArray = innerText.Split(new char[] { ' ' }); txtShipTo.Text = str2; if (strArray.Length >= 4) { str3 = strArray[0] + "," + strArray[1] + "," + strArray[2]; rsddlRegion.SelectedRegions = str3; txtAddress.Text = strArray[3]; } txtZipcode.Text = node.SelectSingleNode("ship_zipcode").InnerText; txtTel.Text = node.SelectSingleNode("ship_tel").InnerText; txtMobile.Text = node.SelectSingleNode("ship_mobile").InnerText; radioShippingMode.DataBind(); if (radioShippingMode.Items.Count > 0) { radioShippingMode.Items[0].Selected = true; } order.orderId = node.SelectSingleNode("order_id").InnerText; order.buyer = node.SelectSingleNode("buyer").InnerText; order.createTime = node.SelectSingleNode("createtime").InnerText; order.orderMemo = node.SelectSingleNode("order_memo").InnerText; XmlNode node2 = node.SelectSingleNode("items"); double num2 = 0.0; for (int j = 0; j < node2.ChildNodes.Count; j++) { tbOrderItem item2 = new tbOrderItem(); item2.id = string.Format("{0}_{1}", order.orderId, j); item2.title = node2.ChildNodes[j].SelectSingleNode("title").InnerText; item2.spec = node2.ChildNodes[j].SelectSingleNode("spec").InnerText; item2.price = node2.ChildNodes[j].SelectSingleNode("price").InnerText; item2.number = node2.ChildNodes[j].SelectSingleNode("number").InnerText; item2.url = node2.ChildNodes[j].SelectSingleNode("url").InnerText; tbOrderItem item = item2; HttpRequest request = HttpContext.Current.Request; if (request.Cookies[Globals.UrlEncode(item.title + item.spec)] != null) { ProductQuery query2 = new ProductQuery(); query2.PageSize = 1; query2.PageIndex = 1; query2.ProductCode = Globals.UrlDecode(request.Cookies[Globals.UrlEncode(item.title + item.spec)].Value); ProductQuery query = query2; int count = 0; DataTable puchaseProducts = SubSiteProducthelper.GetPuchaseProducts(query, out count); if (puchaseProducts.Rows.Count > 0) { item.localSkuId = puchaseProducts.Rows[0]["SkuId"].ToString(); item.localSKU = puchaseProducts.Rows[0]["SKU"].ToString(); item.localProductId = puchaseProducts.Rows[0]["ProductId"].ToString().Trim(); item.localProductName = puchaseProducts.Rows[0]["ProductName"].ToString(); item.thumbnailUrl100 = puchaseProducts.Rows[0]["ThumbnailUrl100"].ToString(); item.localPrice = puchaseProducts.Rows[0]["PurchasePrice"].ToString(); item.localStock = puchaseProducts.Rows[0]["Stock"].ToString(); num2 += Convert.ToDouble(puchaseProducts.Rows[0]["PurchasePrice"]) * Convert.ToInt32(item.number); } } else { ProductQuery query4 = new ProductQuery(); query4.PageSize = 1; query4.PageIndex = 1; query4.Keywords = item.title; ProductQuery query3 = query4; int num5 = 0; DataTable table2 = SubSiteProducthelper.GetPuchaseProducts(query3, out num5); if (num5 == 1) { item.localSkuId = table2.Rows[0]["SkuId"].ToString(); item.localSKU = table2.Rows[0]["SKU"].ToString(); item.localProductId = table2.Rows[0]["ProductId"].ToString().Trim(); item.localProductName = table2.Rows[0]["ProductName"].ToString(); item.thumbnailUrl100 = table2.Rows[0]["ThumbnailUrl100"].ToString(); item.localPrice = table2.Rows[0]["PurchasePrice"].ToString(); item.localStock = table2.Rows[0]["Stock"].ToString(); num2 += Convert.ToDouble(table2.Rows[0]["PurchasePrice"]) * Convert.ToInt32(item.number); } } order.items.Add(item); order.orderCost = num2; } tbOrders.Add(order); } Session["tbOrders"] = tbOrders; pageDataBind(); } } }
public DataTable GetGroupBuyProducts(ProductQuery query) { StringBuilder builder = new StringBuilder(); builder.AppendFormat(" WHERE SaleStatus = {0}", 1); if (!string.IsNullOrEmpty(query.Keywords)) { query.Keywords = DataHelper.CleanSearchString(query.Keywords); string[] strArray = Regex.Split(query.Keywords.Trim(), @"\s+"); builder.AppendFormat(" AND ProductName LIKE '%{0}%'", DataHelper.CleanSearchString(strArray[0])); for (int i = 1; (i < strArray.Length) && (i <= 4); i++) { builder.AppendFormat("AND ProductName LIKE '%{0}%'", DataHelper.CleanSearchString(strArray[i])); } } if (!string.IsNullOrEmpty(query.ProductCode)) { builder.AppendFormat(" AND ProductCode LIKE '%{0}%'", DataHelper.CleanSearchString(query.ProductCode)); } if (query.CategoryId.HasValue && (query.CategoryId.Value > 0)) { builder.AppendFormat(" AND MainCategoryPath LIKE '{0}|%'", query.MaiCategoryPath); } DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT ProductId,ProductName FROM Hishop_Products" + builder.ToString()); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { return DataHelper.ConverDataReaderToDataTable(reader); } }
public static DataTable GetGroupBuyProducts(ProductQuery query) { return ProductProvider.Instance().GetGroupBuyProducts(query); }
public static DbQueryResult GetUnclassifiedProducts(ProductQuery query) { return ProductProvider.Instance().GetUnclassifiedProducts(query); }
private void btnAddSearch_Click(object sender, EventArgs e) { ProductQuery query = new ProductQuery(); query.Keywords = txtSearchText.Text; query.CategoryId = dropCategories.SelectedValue; query.SaleStatus = ProductSaleStatus.OnSale; IList<int> productIds = SubSiteProducthelper.GetProductIds(query); foreach (int num in productIds) { if (!ProductIds.Contains(num)) { ProductIds.Add(num); SubsitePromoteHelper.InsertPromotionProduct(activeId, num); } } ProductIds = productIds; BindPromoteProducts(); }
private void BindProducts() { ProductQuery query = new ProductQuery(); query.Keywords = txtSearchText.Text; query.CategoryId = dropCategories.SelectedValue; query.PageSize = 10; query.PageIndex = pageindex; query.SaleStatus = ProductSaleStatus.OnSale; query.SortOrder = SortAction.Desc; query.SortBy = "DisplaySequence"; DbQueryResult products = SubSiteProducthelper.GetProducts(query); dlstProducts.DataSource = products.Data; dlstProducts.DataBind(); pager.TotalRecords = products.TotalRecords; }
public override void DataBind() { Items.Clear(); ProductQuery query = new ProductQuery(); query.Keywords = productName; query.ProductCode = productCode; query.CategoryId = categoryId; query.SaleStatus = ProductSaleStatus.OnSale; if (categoryId.HasValue) { query.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(categoryId.Value).Path; } DataTable groupBuyProducts = SubSiteProducthelper.GetGroupBuyProducts(query); base.Items.Add(new ListItem("--请选择--", string.Empty)); foreach (DataRow row in groupBuyProducts.Rows) { base.Items.Add(new ListItem(row["ProductName"].ToString(), row["ProductId"].ToString())); } }
private void BindData() { ProductQuery entity = new ProductQuery(); entity.PageSize = pager.PageSize; entity.PageIndex = pager.PageIndex; entity.ProductCode = productCode; entity.Keywords = productName; entity.ProductLineId = productLineId; if (grdAuthorizeProducts.SortOrder.ToLower() == "desc") { entity.SortOrder = SortAction.Desc; } entity.SortBy = grdAuthorizeProducts.SortOrderBy; Globals.EntityCoding(entity, true); DbQueryResult submitPuchaseProductsByDistorUserId = ProductHelper.GetSubmitPuchaseProductsByDistorUserId(entity, distorUserId); grdAuthorizeProducts.DataSource = submitPuchaseProductsByDistorUserId.Data; grdAuthorizeProducts.DataBind(); pager.TotalRecords = submitPuchaseProductsByDistorUserId.TotalRecords; pager1.TotalRecords = submitPuchaseProductsByDistorUserId.TotalRecords; }
public static DbQueryResult GetSubmitPuchaseProductsByDistorUserId(ProductQuery query, int distorUserId) { return ProductProvider.Instance().GetSubmitPuchaseProductsByDistorUserId(query, distorUserId); }