Exemplo n.º 1
0
        public override List <Persistence.Classroom_Attendance> ViewMyAttendance(int CourseID)
        {
            CRUD.Attendance attendanceCRUD = new CRUD.Attendance();
            List <Persistence.Classroom_Attendance> classes = (List <Persistence.Classroom_Attendance>)attendanceCRUD.fetchAttendance(this.GetID());

            if (classes != null)
            {
                return(classes);
            }
            else
            {
                throw new Exception("No classes found");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a record for each student. Requires a student dictionary where Key is the Student ID, and the value is a bool.
 /// </summary>
 /// <param name="students"></param>
 /// <param name="classID"></param>
 /// <returns></returns>
 public override bool TakeAttendance(Dictionary <int, bool> students, int classID)
 {
     try
     {
         CRUD.Attendance attendance = new CRUD.Attendance();
         foreach (var student in students)
         {
             attendance.createRecord(student.Key, student.Value, classID);
         }
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message.ToString());
         return(false);
     }
 }