コード例 #1
0
ファイル: PilotTask.cs プロジェクト: flyvfr/lessontrack
 internal static PilotTask GetTask(string userEmail, Guid taskID)
 {
     using (DBClassesDataContext dbc = new DBClassesDataContext())
     {
         PilotTask ach = (from u in dbc.PilotTasks
                          where u.PilotEmail == userEmail && u.TaskID == taskID
                          select u).SingleOrDefault();
         if (ach != null)
         {
             return(ach);
         }
     }
     return(null);
 }
コード例 #2
0
ファイル: PilotTask.cs プロジェクト: flyvfr/lessontrack
 /// <summary>
 /// Get the date when pilot class was achieved
 /// </summary>
 /// <param name="classid"></param>
 /// <param name="user"></param>
 /// <returns></returns>
 public static DateTime WhenAchieved(Guid taskid, String user)
 {
     using (DBClassesDataContext dbc = new DBClassesDataContext())
     {
         PilotTask ach = (from u in dbc.PilotTasks
                          where u.PilotEmail == user && u.TaskID == taskid
                          select u).SingleOrDefault();
         if (ach != null)
         {
             return(ach.DateCompleted ?? DateTime.MinValue);
         }
     }
     return(DateTime.MinValue);
 }