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

            if (rowsCount > 0)
            {
                Hownet.Model.ImageList model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.ImageList();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    model.Image  = dt.Rows[n]["Image"].ToString();
                    if (dt.Rows[n]["MainID"] != null && dt.Rows[n]["MainID"].ToString() != "")
                    {
                        model.MainID = int.Parse(dt.Rows[n]["MainID"].ToString());
                    }
                    if (dt.Rows[n]["TableTypeID"] != null && dt.Rows[n]["TableTypeID"].ToString() != "")
                    {
                        model.TableTypeID = int.Parse(dt.Rows[n]["TableTypeID"].ToString());
                    }
                    model.SerName = dt.Rows[n]["SerName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hownet.Model.ImageList model)
 {
     return(dal.Update(model));
 }
Example #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.ImageList model)
 {
     return(dal.Add(model));
 }