示例#1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <hm.Model.ed_productAttrValue> DataTableToList(DataTable dt)
        {
            List <hm.Model.ed_productAttrValue> modelList = new List <hm.Model.ed_productAttrValue>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                hm.Model.ed_productAttrValue model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new hm.Model.ed_productAttrValue();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["productId"] != null && dt.Rows[n]["productId"].ToString() != "")
                    {
                        model.productId = int.Parse(dt.Rows[n]["productId"].ToString());
                    }
                    if (dt.Rows[n]["attributeId"] != null && dt.Rows[n]["attributeId"].ToString() != "")
                    {
                        model.attributeId = int.Parse(dt.Rows[n]["attributeId"].ToString());
                    }
                    if (dt.Rows[n]["attributeValue"] != null && dt.Rows[n]["attributeValue"].ToString() != "")
                    {
                        model.attributeValue = dt.Rows[n]["attributeValue"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(hm.Model.ed_productAttrValue model)
 {
     return(dal.Update(model));
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(hm.Model.ed_productAttrValue model)
 {
     return(dal.Add(model));
 }