bello with presence(final(real_final))
This commit is contained in:
parent
8cfc727b8c
commit
2d00dc5129
@ -9,5 +9,6 @@ namespace Demo.Data.Repository
|
||||
List<PresenceLocalEntity> GetPresenceByGroupDate();
|
||||
void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid);
|
||||
List<PresenceLocalEntity> GeneratePresence(List<PresenceLocalEntity> presenceLocalEntities);
|
||||
List<PresenceLocalEntity> GeneratePresenceWeek(List<PresenceLocalEntity> presenceLocalEntities);
|
||||
}
|
||||
}
|
@ -24,6 +24,11 @@ namespace Demo.Data.Repository
|
||||
return presenceLocalEntities;
|
||||
}
|
||||
|
||||
public List<PresenceLocalEntity> GeneratePresenceWeek(List<PresenceLocalEntity> presenceLocalEntities){
|
||||
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){
|
||||
|
@ -8,5 +8,6 @@ namespace Demo.Domain.UseCase
|
||||
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);
|
||||
bool GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date);
|
||||
}
|
||||
}
|
@ -99,5 +99,12 @@ namespace Demo.Domain.UseCase
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date){
|
||||
for (int i = 0; i < 8; i++){
|
||||
GeneratePresence(firstLesson, lastLesson, groupID, date.AddDays(i));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -33,9 +33,10 @@ namespace Demo.UI
|
||||
|
||||
case "10": Console.WriteLine("писяпопакака"); 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 "555": _presenceConsoleUI.DisplayPresenceByGroup(Convert.ToInt32(Console.ReadLine())); break;
|
||||
case "666": _presenceConsoleUI.DisplayPresenceByGroupByTime(Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break;
|
||||
case "777": _presenceConsoleUI.GeneratePresence(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break;
|
||||
case "888": _presenceConsoleUI.GeneratePresenceWeek(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();
|
||||
|
@ -114,6 +114,11 @@ namespace Demo.UI
|
||||
Console.WriteLine(output);
|
||||
}
|
||||
|
||||
public void GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date){
|
||||
string output = _presenceUseCase.GeneratePresenceWeek(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+fdad32d8d007294c9270715bb64c3c6b73d4aa0e")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8cfc727b8c403baa97f18ee84c21b4211cf565aa")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Demo")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Demo")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
1f5ed0f5079c7ee0bc0322da92b35ef0b9128733503d321fbe8276d571ff8b7d
|
||||
d45a67746d856242cba9a02077a6869dc9aa935476034281590d01e4894701f6
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user