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); }
/// <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); }