Example #1
0
 public async Task AddAlertLog(SchoolYearTypeModel currentSchoolYear, int alertTypeId, string parentUniqueId, string studentUniqueId, string absencesCount)
 {
     _edFiDb.AlertLogs.Add(new AlertLog
     {
         SchoolYear      = currentSchoolYear.SchoolYear,
         AlertTypeId     = alertTypeId,
         ParentUniqueId  = parentUniqueId,
         StudentUniqueId = studentUniqueId,
         Value           = absencesCount
     });
 }
        public async Task <bool> wasSentBefore(string parentUniqueId, string studentUniqueId, string absencesCount, SchoolYearTypeModel currentSchoolYear, int alertType)
        {
            var wasSentBefore = await _edFiDb.AlertLogs.AnyAsync(x =>
                                                                 x.SchoolYear == currentSchoolYear.SchoolYear &&
                                                                 x.AlertTypeId == alertType &&
                                                                 x.ParentUniqueId == parentUniqueId &&
                                                                 x.StudentUniqueId == studentUniqueId &&
                                                                 x.Value == absencesCount);

            return(wasSentBefore);
        }