Exemplo n.º 1
0
        public ProductAttr GetTaskPlateAttrByCategoryID(string categoryid)
        {
            var dal = new ProductsDAL();
            DataSet ds = dal.GetTaskPlateAttrByCategoryID(categoryid);

            ProductAttr model = new ProductAttr();
            if (ds.Tables.Contains("Attrs") && ds.Tables["Attrs"].Rows.Count > 0)
            {
                model.FillData(ds.Tables["Attrs"].Rows[0]);
                model.AttrValues = new List<AttrValue>();
                foreach (DataRow item in ds.Tables["Values"].Rows)
                {
                    AttrValue attrValue = new AttrValue();
                    attrValue.FillData(item);
                    model.AttrValues.Add(attrValue);
                }
            }

            return model;
        }