示例#1
0
文件: Shop.cs 项目: Abnertd/public
    /// <summary>
    /// 搜索店铺下商品
    /// </summary>
    /// <param name="supplier_id"></param>
    /// <returns></returns>
    public string ShopProducts(int supplier_id)
    {
        StringBuilder strHTML = new StringBuilder();

        QueryInfo Query = new QueryInfo();

        Query.PageSize    = 3;
        Query.CurrentPage = 1;
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "ProductInfo.Product_Site", "=", pub.GetCurrentSite()));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "ProductInfo.Product_IsInsale", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "ProductInfo.Product_IsAudit", "=", "1"));
        Query.ParamInfos.Add(new ParamInfo("AND", "int", "ProductInfo.Product_SupplierID", "=", supplier_id.ToString()));
        Query.OrderInfos.Add(new OrderInfo("ProductInfo.Product_Sort", "ASC"));
        Query.OrderInfos.Add(new OrderInfo("ProductInfo.Product_ID", "DESC"));
        IList <ProductInfo> entitys = Myproduct.GetProductList(Query, pub.CreateUserPrivilege("ae7f5215-a21a-4af2-8d47-3cda2e1e2de8"));

        if (entitys != null)
        {
            string targetURL = string.Empty;
            foreach (ProductInfo entity in entitys)
            {
                targetURL = pageurl.FormatURL(pageurl.product_detail, entity.Product_ID.ToString());

                strHTML.Append("<li><div class=\"img_box\"><a href=\"" + targetURL + "\" target=\"_blank\"><img src=\"" + pub.FormatImgURL(entity.Product_Img, "thumbnail") + "\" alt=\"" + entity.Product_Name + "\" /></a><i><a href=\"" + targetURL + "\" target=\"_blank\">" + entity.Product_Name + "</a></i></div><p><span>成交 " + entity.Product_SaleAmount + "个</span><strong>" + (entity.Product_PriceType == 1 ? pub.FormatCurrency(entity.Product_Price) : pub.FormatCurrency(pub.GetProductPrice(entity.Product_ManualFee, entity.Product_Weight))) + "</strong></p></li>");
            }
        }
        entitys = null;

        return(strHTML.ToString());
    }