public ActionResult <int> GetIdOfNearestSession(int teacherId) { if (DbActions.ValidateRequest(Request)) { return(DbActions.GetClosestSessionId(teacherId)); } return(StatusCode(401)); }
public ActionResult <CTeacher> GetTeacher(int teacherId, int userId) { if (DbActions.ValidateRequest(Request)) { return(DbActions.GetTeacher(teacherId, userId)); } return(StatusCode(401)); }
public ActionResult <CSession> GetAttendance(int sessionId) { if (DbActions.ValidateRequest(Request)) { return(DbActions.GetSession(sessionId)); } return(StatusCode(401)); }
public ActionResult <bool> CheckDuplicateEmail(String emailAddress) { if (DbActions.ValidateRequest(Request)) { return(DbActions.CheckIfEmailIsDuplicate(emailAddress)); } return(StatusCode(401)); }
public ActionResult <List <CClassTerm> > GetClassTermList(int teacherId) { if (DbActions.ValidateRequest(Request)) { return(DbActions.GetClassTermsForRec(teacherId)); } return(StatusCode(401)); }
public IActionResult UpdateTeacher(CTeacher teacherToUpdate, int userId) { if (DbActions.ValidateRequest(Request)) { DbActions.UpdateExistingTeacher(teacherToUpdate, userId); return(StatusCode(200)); } return(StatusCode(401)); }
public IActionResult AddNewTeacher(CTeacher newTeacher, int userId) { if (DbActions.ValidateRequest(Request)) { DbActions.AddNewTeacher(newTeacher, userId); return(StatusCode(200)); } return(StatusCode(401)); }
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)); }
public IActionResult Post(CSession attendance) { if (DbActions.ValidateRequest(Request)) { DbActions.UpdateAttendance(attendance); } else { return(StatusCode(401)); } return(StatusCode(200)); }