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

            if (rowsCount > 0)
            {
                ForKids.DB.Model.CLASSCOURSE model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ForKids.DB.Model.CLASSCOURSE();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["CLASSID"] != null && dt.Rows[n]["CLASSID"].ToString() != "")
                    {
                        model.CLASSID = int.Parse(dt.Rows[n]["CLASSID"].ToString());
                    }
                    if (dt.Rows[n]["COURSEID"] != null && dt.Rows[n]["COURSEID"].ToString() != "")
                    {
                        model.COURSEID = int.Parse(dt.Rows[n]["COURSEID"].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]["TEACHERID"] != null && dt.Rows[n]["TEACHERID"].ToString() != "")
                    {
                        model.TEACHERID = int.Parse(dt.Rows[n]["TEACHERID"].ToString());
                    }
                    if (dt.Rows[n]["SUMMARY"] != null && dt.Rows[n]["SUMMARY"].ToString() != "")
                    {
                        model.SUMMARY = dt.Rows[n]["SUMMARY"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<ForKids.DB.Model.CLASSCOURSE> DataTableToList(DataTable dt)
 {
     List<ForKids.DB.Model.CLASSCOURSE> modelList = new List<ForKids.DB.Model.CLASSCOURSE>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         ForKids.DB.Model.CLASSCOURSE model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new ForKids.DB.Model.CLASSCOURSE();
             if(dt.Rows[n]["ID"]!=null && dt.Rows[n]["ID"].ToString()!="")
             {
                 model.ID=int.Parse(dt.Rows[n]["ID"].ToString());
             }
             if(dt.Rows[n]["CLASSID"]!=null && dt.Rows[n]["CLASSID"].ToString()!="")
             {
             //model.CLASSID=dt.Rows[n]["CLASSID"].ToString();
             }
             if(dt.Rows[n]["COURSEID"]!=null && dt.Rows[n]["COURSEID"].ToString()!="")
             {
             //model.COURSEID=dt.Rows[n]["COURSEID"].ToString();
             }
             if(dt.Rows[n]["ATTENDANCE"]!=null && dt.Rows[n]["ATTENDANCE"].ToString()!="")
             {
             //model.ATTENDANCE=dt.Rows[n]["ATTENDANCE"].ToString();
             }
             if(dt.Rows[n]["TEACHERID"]!=null && dt.Rows[n]["TEACHERID"].ToString()!="")
             {
             //model.TEACHERID=dt.Rows[n]["TEACHERID"].ToString();
             }
             if(dt.Rows[n]["SUMMARY"]!=null && dt.Rows[n]["SUMMARY"].ToString()!="")
             {
             model.SUMMARY=dt.Rows[n]["SUMMARY"].ToString();
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Beispiel #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(ForKids.DB.Model.CLASSCOURSE model)
 {
     return(dal.Update(model));
 }
Beispiel #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(ForKids.DB.Model.CLASSCOURSE model)
 {
     return(dal.Add(model));
 }