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

            if (rowsCount > 0)
            {
                Maticsoft.Model.tupian model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.tupian();
                    if (dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    model.ImageURL1 = dt.Rows[n]["ImageURL1"].ToString();
                    model.ImageURL2 = dt.Rows[n]["ImageURL2"].ToString();
                    model.ImageURL3 = dt.Rows[n]["ImageURL3"].ToString();
                    model.ImageURL4 = dt.Rows[n]["ImageURL4"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.tupian model)
 {
     return(dal.Update(model));
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.tupian model)
 {
     return(dal.Add(model));
 }