bello with presence(final)

This commit is contained in:
Your Name 2024-10-23 10:53:19 +03:00
parent fdad32d8d0
commit 8cfc727b8c
14 changed files with 28 additions and 7 deletions

View File

@ -7,6 +7,7 @@ namespace Demo.Data.Repository
List<PresenceLocalEntity> GetAllPresences();
List<PresenceLocalEntity>? GetPresenceByGroup();
List<PresenceLocalEntity> GetPresenceByGroupDate();
void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid);
List<PresenceLocalEntity> GeneratePresence(List<PresenceLocalEntity> presenceLocalEntities);
}
}

View File

@ -11,7 +11,7 @@ namespace Demo.Data.Repository
return GetAllPresence;
}
public List<PresenceLocalEntity>? GetPresenceByGroup(){
public List<PresenceLocalEntity> GetPresenceByGroup(){
return GetAllPresence;
}
@ -23,5 +23,13 @@ namespace Demo.Data.Repository
GetAllPresence.AddRange(presenceLocalEntities);
return presenceLocalEntities;
}
public void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){
foreach(PresenceLocalEntity presence in GetAllPresence.Where(x => x.LessonNumber >= firstLesson && x.LessonNumber <= lastLesson && x.Date == date)){
if (presence.UserGuid == UserGuid){
presence.IsAttedance = false;
}
}
}
}
}

View File

@ -6,6 +6,7 @@ namespace Demo.Domain.UseCase
{
List<Presence> GetPresenceByGroup(int groupID);
List<Presence> GetPresenceByGroupByTime(int groupID, DateOnly date);
bool IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid);
bool GeneratePresence(int firstLesson, int lastLesson, int groupID, DateOnly date);
}
}

View File

@ -63,6 +63,11 @@ namespace Demo.Domain.UseCase
return presenceByGroup;
}
public bool IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){
_repositoryPresenceImpl.IsAttedance(firstLesson, lastLesson, date, UserGuid);
return true;
}
public bool GeneratePresence(int firstLesson, int lastLesson, int groupID, DateOnly date){
List<Presence> presenceList = new List<Presence>{};
var usersByGroup = _repositoryUserImpl.GetAllUser().Where(x => x.GroupID == groupID);

View File

@ -33,9 +33,10 @@ namespace Demo.UI
case "10": Console.WriteLine("писяпопакака"); break;
case "777": _presenceConsoleUI.DisplayPresenceByGroup(Convert.ToInt32(Console.ReadLine())); break;
case "888": _presenceConsoleUI.DisplayPresenceByGroupByTime(Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break;
case "999": _presenceConsoleUI.GeneratePresence(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break;
case "666": _presenceConsoleUI.DisplayPresenceByGroup(Convert.ToInt32(Console.ReadLine())); break;
case "777": _presenceConsoleUI.DisplayPresenceByGroupByTime(Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break;
case "888": _presenceConsoleUI.GeneratePresence(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break;
case "999": _presenceConsoleUI.IsAttedance(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine())), Guid.Parse(Console.ReadLine())); break;
default: DisplayMenu();
break;

View File

@ -113,5 +113,10 @@ namespace Demo.UI
string output = _presenceUseCase.GeneratePresence(firstLesson, lastLesson, groupID, date) ? "Сгенерированно" : "Не сгенерированно";
Console.WriteLine(output);
}
public void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){
string output = _presenceUseCase.IsAttedance(firstLesson, lastLesson, date, UserGuid) ? "Обновлено" : "Не обновлено";
Console.WriteLine(output);
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Demo")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+62cf71e0807e9e3240bed91fc96a70ca85f326da")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+fdad32d8d007294c9270715bb64c3c6b73d4aa0e")]
[assembly: System.Reflection.AssemblyProductAttribute("Demo")]
[assembly: System.Reflection.AssemblyTitleAttribute("Demo")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
a01cfb167fed9f2405a5e73c2f292e1435aae3d26590e7f2368a0b28d9d0813e
1f5ed0f5079c7ee0bc0322da92b35ef0b9128733503d321fbe8276d571ff8b7d

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.