public void LoadView(string parameter, Dictionary<string, object> lastState = null)
 {
     try
     {
         SelectedCourse = UserManager.CurrentUser.Courses.Single<Course>((Course c) => string.Equals(c.ClassNumber.ToString(), parameter));
     }
     catch
     {
         SelectedCourse = null;
     }
 }
Ejemplo n.º 2
0
 internal void AddCourse(Course course)
 {
     _courses.Add(course);
 }
 // Depth 0 Assignment (Course)
 private static void AssignRootTypeDetails(Course course, JsonObject courseObject)
 {
     course.ClassNumber = (ushort)courseObject.GetNamedNumber("class_number");
     course.CourseCode = courseObject.GetNamedString("course_code");
     course.CourseMode = courseObject.GetNamedString("course_mode");
     course.CourseOption = courseObject.GetNamedString("course_option");
     course.SubjectType = courseObject.GetNamedString("subject_type");
     course.Faculty = courseObject.GetNamedString("faculty");
     course.Title = courseObject.GetNamedString("course_title");
     course.Ltpjc = courseObject.GetNamedString("ltpjc");
     course.Credits = (ushort)int.Parse(course.Ltpjc.Substring(4));
 }
        private List<string> GetAgendaList(Course course)
        {
            List<string> agendaList = null;

            switch (course.CourseMode)
            {
                case "CBL":
                    agendaList = new List<string>() { "Quiz I", "Quiz II", "Quiz III", "Class Test", "Assignment Deadline" };
                    break;
                case "LBC":
                    agendaList = new List<string>() { "VIVA Test", "Quiz", "Record Submission", "Mid-Term Examination", "Term-end Examination" };
                    break;
                case "PBL":
                case "RBL":
                    agendaList = new List<string>() { "Class Test", "Quiz", "Mid-Term Examination", "Project/Report Submission" };
                    break;
                default:
                    agendaList = new List<string>() { "Class Test", "Internal Assessment", "Mid-Term Examination" };
                    break;
            }

            if (course is LtpCourse)
            {
                agendaList.Add("Extra Class");
                agendaList.Add("Class Cancelled");
            }
            agendaList.Add("type...");
            return agendaList;
        }
        public static async Task WriteAppointmentAsync(Course contextCourse, string subject, DateTimeOffset reminderDate, TimeSpan startTime, TimeSpan duration, TimeSpan reminder)
        {
            if (_calendar == null)
                throw new InvalidOperationException();

            Appointment appt = new Appointment();
            LtpCourse ltpCourse = contextCourse as LtpCourse;
            if (ltpCourse != null)
                appt.Location = ltpCourse.Venue;

            string code = contextCourse.CourseCode;
            if (contextCourse is LBCCourse)
                code = code + " Lab";

            await WriteAppointmentCoreAsync(appt, code, subject, reminderDate, startTime, duration, reminder);
        }
 public DummyCalendarInfoStub(Course course, DateTimeOffset date, TimeSpan start, TimeSpan end)
     : base(date, course, null)
 {
     _startTime = start;
     _endTime = end;
 }
 public CalendarAwareStub(DateTimeOffset contextDate, Course contextCourse, Appointment appt)
 {
     _contextDate = contextDate;
     _contextCourse = contextCourse;
     if (appt != null)
         ApptInfo = new AppointmentInfo(appt);
 }