Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <hm.Model.ed_productAttribute> DataTableToList(DataTable dt)
        {
            List <hm.Model.ed_productAttribute> modelList = new List <hm.Model.ed_productAttribute>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                hm.Model.ed_productAttribute model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new hm.Model.ed_productAttribute();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["title"] != null && dt.Rows[n]["title"].ToString() != "")
                    {
                        model.title = dt.Rows[n]["title"].ToString();
                    }
                    if (dt.Rows[n]["valueList"] != null && dt.Rows[n]["valueList"].ToString() != "")
                    {
                        model.valueList = dt.Rows[n]["valueList"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(hm.Model.ed_productAttribute model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(hm.Model.ed_productAttribute model)
 {
     return(dal.Add(model));
 }