public async Task <bool> SaveCourse()
        {
            NewCourse.Start = StartDate;
            NewCourse.End   = EndDate;
            if (await ValidateCourse(NewCourse))
            {
                if (isUpdate)
                {
                    await SqliteConn.UpdateAsync(NewCourse);
                }
                else
                {
                    var courseCount = await SqliteConn.Table <Course>().Where(c => c.TermId == Term.Id).CountAsync();

                    if (courseCount > 5)
                    {
                        ErrorText = $"* Term '{Term.Title}' has already reached the maximum number of courses of 6.";
                        return(false);
                    }
                    await SqliteConn.InsertAsync(NewCourse);
                }
                return(true);
            }
            return(false);
        }
示例#2
0
 public async Task <bool> SaveTerm()
 {
     NewTerm.Start = StartDate;
     NewTerm.End   = EndDate;
     if (ValidateTerm())
     {
         if (isUpdate)
         {
             await SqliteConn.UpdateAsync(NewTerm);
         }
         else
         {
             await SqliteConn.InsertAsync(NewTerm);
         }
         return(true);
     }
     return(false);
 }
示例#3
0
 public async Task <bool> SaveAssessment()
 {
     NewAssessment.Start = StartDate;
     NewAssessment.End   = EndDate;
     if (!ValidateAssessment())
     {
         return(false);
     }
     if (isUpdate)
     {
         await SqliteConn.UpdateAsync(NewAssessment);
     }
     else
     {
         await SqliteConn.InsertAsync(NewAssessment);
     }
     return(true);
 }
示例#4
0
 public async Task UpdateAssessmentNotifications(Assessment assessment)
 {
     await SqliteConn.UpdateAsync(assessment);
 }
示例#5
0
 public async Task UpdateCourseNotifications()
 {
     await SqliteConn.UpdateAsync(Course);
 }