예제 #1
0
 /// <summary>
 /// 获取课节时间列表
 /// </summary>
 /// <returns>课节时间列表</returns>
 public List<ClassTime> GetClassTimeList()
 {
     List<ClassTime> ClsTimeList = new List<ClassTime>();
     using (JszxDataManager jszxDateManage = new JszxDataManager())
     {
         List<classtimes_tb> ClassTime_tbList = jszxDateManage.GetClassTimes(true);
         foreach(classtimes_tb cltdb in ClassTime_tbList){
             ClassTime clt = new ClassTime();
             clt.ClsTmEnd = cltdb.ClsTmEnd;
             clt.ClsTmIndex = cltdb.ClsTmIndex;
             clt.ClsTmName = cltdb.ClsTmName;
             clt.ClsTmStart = cltdb.ClsTmStart;
             ClsTimeList.Add(clt);
         }
     }
     return ClsTimeList;
 }
예제 #2
0
 /// <summary>
 /// 获取当前的课节信息
 /// </summary>
 /// <returns>当前的课节信息</returns>
 public ClassTime GetCurrentClassTime()
 {
     ClassTime clt = new ClassTime();
     using (JszxDataManager jszxDateManage = new JszxDataManager())
     {
         classtimes_tb clt_tb = jszxDateManage.GetClsTimeByTimeSpan(TimeSpan.Parse(DateTime.Now.ToString("HH:mm:ss")));
         if (clt_tb == null)
         {
             return null;
         }
         else
         {
             clt.ClsTmEnd = clt_tb.ClsTmEnd;
             clt.ClsTmIndex = clt_tb.ClsTmIndex;
             clt.ClsTmName = clt_tb.ClsTmName;
             clt.ClsTmStart = clt_tb.ClsTmStart;
             return clt;
         }
     }
 }