Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ForKids.DB.Model.MEETINGBASE> DataTableToList(DataTable dt)
        {
            List <ForKids.DB.Model.MEETINGBASE> modelList = new List <ForKids.DB.Model.MEETINGBASE>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                ForKids.DB.Model.MEETINGBASE model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ForKids.DB.Model.MEETINGBASE();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["NAME"] != null && dt.Rows[n]["NAME"].ToString() != "")
                    {
                        model.NAME = dt.Rows[n]["NAME"].ToString();
                    }
                    if (dt.Rows[n]["DESCRITION"] != null && dt.Rows[n]["DESCRITION"].ToString() != "")
                    {
                        model.DESCRITION = dt.Rows[n]["DESCRITION"].ToString();
                    }
                    if (dt.Rows[n]["MEETINGDATE"] != null && dt.Rows[n]["MEETINGDATE"].ToString() != "")
                    {
                        model.MEETINGDATE = DateTime.Parse(dt.Rows[n]["MEETINGDATE"].ToString());
                    }
                    if (dt.Rows[n]["ATTENDANCE"] != null && dt.Rows[n]["ATTENDANCE"].ToString() != "")
                    {
                        model.ATTENDANCE = double.Parse(dt.Rows[n]["ATTENDANCE"].ToString());
                    }
                    if (dt.Rows[n]["SUMMARY"] != null && dt.Rows[n]["SUMMARY"].ToString() != "")
                    {
                        model.SUMMARY = dt.Rows[n]["SUMMARY"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<ForKids.DB.Model.MEETINGBASE> DataTableToList(DataTable dt)
 {
     List<ForKids.DB.Model.MEETINGBASE> modelList = new List<ForKids.DB.Model.MEETINGBASE>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         ForKids.DB.Model.MEETINGBASE model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new ForKids.DB.Model.MEETINGBASE();
             if(dt.Rows[n]["ID"]!=null && dt.Rows[n]["ID"].ToString()!="")
             {
                 model.ID=int.Parse(dt.Rows[n]["ID"].ToString());
             }
             if(dt.Rows[n]["NAME"]!=null && dt.Rows[n]["NAME"].ToString()!="")
             {
             model.NAME=dt.Rows[n]["NAME"].ToString();
             }
             if(dt.Rows[n]["DESCRITION"]!=null && dt.Rows[n]["DESCRITION"].ToString()!="")
             {
             model.DESCRITION=dt.Rows[n]["DESCRITION"].ToString();
             }
             if(dt.Rows[n]["MEETINGDATE"]!=null && dt.Rows[n]["MEETINGDATE"].ToString()!="")
             {
                 model.MEETINGDATE=DateTime.Parse(dt.Rows[n]["MEETINGDATE"].ToString());
             }
             if(dt.Rows[n]["ATTENDANCE"]!=null && dt.Rows[n]["ATTENDANCE"].ToString()!="")
             {
             //model.ATTENDANCE=dt.Rows[n]["ATTENDANCE"].ToString();
             }
             if(dt.Rows[n]["SUMMARY"]!=null && dt.Rows[n]["SUMMARY"].ToString()!="")
             {
             model.SUMMARY=dt.Rows[n]["SUMMARY"].ToString();
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(ForKids.DB.Model.MEETINGBASE model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(ForKids.DB.Model.MEETINGBASE model)
 {
     return(dal.Add(model));
 }