Exemplo n.º 1
0
        public List<ProductAttr> GetAttrList(string categoryid, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            var dal = new ProductsDAL();
            DataSet ds = dal.GetAttrList(categoryid, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount);

            List<ProductAttr> list = new List<ProductAttr>();
            if (ds.Tables.Contains("Attrs"))
            {
                foreach (DataRow dr in ds.Tables["Attrs"].Rows)
                {
                    ProductAttr model = new ProductAttr();
                    model.FillData(dr);

                    //List<AttrValue> valueList = new List<AttrValue>();
                    //foreach (DataRow drValue in ds.Tables["Values"].Select("AttrID='" + model.AttrID + "'"))
                    //{
                    //    AttrValue valueModel = new AttrValue();
                    //    valueModel.FillData(drValue);
                    //    valueList.Add(valueModel);
                    //}
                    //model.AttrValues = valueList;

                    list.Add(model);
                }
            }
            return list;
        }