示例#1
0
 public ActionResult <int> GetIdOfNearestSession(int teacherId)
 {
     if (DbActions.ValidateRequest(Request))
     {
         return(DbActions.GetClosestSessionId(teacherId));
     }
     return(StatusCode(401));
 }
示例#2
0
 public ActionResult <CTeacher> GetTeacher(int teacherId, int userId)
 {
     if (DbActions.ValidateRequest(Request))
     {
         return(DbActions.GetTeacher(teacherId, userId));
     }
     return(StatusCode(401));
 }
示例#3
0
 public ActionResult <CSession> GetAttendance(int sessionId)
 {
     if (DbActions.ValidateRequest(Request))
     {
         return(DbActions.GetSession(sessionId));
     }
     return(StatusCode(401));
 }
示例#4
0
 public ActionResult <bool> CheckDuplicateEmail(String emailAddress)
 {
     if (DbActions.ValidateRequest(Request))
     {
         return(DbActions.CheckIfEmailIsDuplicate(emailAddress));
     }
     return(StatusCode(401));
 }
示例#5
0
 public ActionResult <List <CClassTerm> > GetClassTermList(int teacherId)
 {
     if (DbActions.ValidateRequest(Request))
     {
         return(DbActions.GetClassTermsForRec(teacherId));
     }
     return(StatusCode(401));
 }
示例#6
0
 public IActionResult UpdateTeacher(CTeacher teacherToUpdate, int userId)
 {
     if (DbActions.ValidateRequest(Request))
     {
         DbActions.UpdateExistingTeacher(teacherToUpdate, userId);
         return(StatusCode(200));
     }
     return(StatusCode(401));
 }
示例#7
0
 public IActionResult AddNewTeacher(CTeacher newTeacher, int userId)
 {
     if (DbActions.ValidateRequest(Request))
     {
         DbActions.AddNewTeacher(newTeacher, userId);
         return(StatusCode(200));
     }
     return(StatusCode(401));
 }
示例#8
0
        public ActionResult <List <CSession> > GetSessionList(int teacherId, String monthYear)
        {
            DateTime parsedMonth = DateTime.ParseExact(monthYear, "MM-yyyy", null);

            if (DbActions.ValidateRequest(Request))
            {
                return(DbActions.GetSessionList(teacherId, parsedMonth));
            }
            return(StatusCode(401));
        }
示例#9
0
 public IActionResult Post(CSession attendance)
 {
     if (DbActions.ValidateRequest(Request))
     {
         DbActions.UpdateAttendance(attendance);
     }
     else
     {
         return(StatusCode(401));
     }
     return(StatusCode(200));
 }