bello with presence(final)
This commit is contained in:
parent
fdad32d8d0
commit
8cfc727b8c
@ -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);
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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.
@ -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")]
|
||||
|
@ -1 +1 @@
|
||||
a01cfb167fed9f2405a5e73c2f292e1435aae3d26590e7f2368a0b28d9d0813e
|
||||
1f5ed0f5079c7ee0bc0322da92b35ef0b9128733503d321fbe8276d571ff8b7d
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user