2024-10-21 22:57:01 +00:00
|
|
|
|
using Demo.Data.LocalData.Entity;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2024-10-23 09:52:43 +00:00
|
|
|
|
using Demo.Domain.Models;
|
2024-10-21 22:57:01 +00:00
|
|
|
|
|
|
|
|
|
namespace Demo.Data.LocalData
|
|
|
|
|
{
|
|
|
|
|
public static class LocalStaticData
|
|
|
|
|
{
|
|
|
|
|
public static List<LocalUser> Users { get; } = new List<LocalUser>
|
|
|
|
|
{
|
|
|
|
|
new LocalUser { Id = Guid.Parse("e6b9964d-ea9f-420a-84b9-af9633bbfab9"), FIO = "Иванов Иван Иванович", GroupID = 1 },
|
|
|
|
|
new LocalUser { Id = Guid.Parse("8388d931-5bef-41be-a152-78f1aca980ed"), FIO = "Петров Петр Петрович", GroupID = 2 },
|
|
|
|
|
new LocalUser { Id = Guid.Parse("ed174548-49ed-4503-a902-c970cbf27173"), FIO = "Мендалиев Наиль", GroupID = 3 },
|
|
|
|
|
new LocalUser { Id = Guid.Parse("614c0a23-5bd5-43ae-b48e-d5750afbc282"), FIO = "Сидоров Сидор Сидорович", GroupID = 1 },
|
|
|
|
|
new LocalUser { Id = Guid.Parse("efcc1473-c116-4244-b3f7-f2341a5c3003"), FIO = "Кузнецов Алексей Викторович", GroupID = 2 },
|
|
|
|
|
new LocalUser { Id = Guid.Parse("60640fb3-ace2-4cad-81d5-a0a58bc2dbbd"), FIO = "Смирнова Анна Сергеевна", GroupID = 3 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static List<string> Groups { get; } = new List<string>
|
|
|
|
|
{
|
|
|
|
|
"ИП1-22",
|
|
|
|
|
"ИП1-23",
|
|
|
|
|
"С1-23"
|
|
|
|
|
};
|
2024-10-23 09:52:43 +00:00
|
|
|
|
|
|
|
|
|
// Список посещаемостей
|
|
|
|
|
public static List<Presence> Presences { get; } = new List<Presence>();
|
|
|
|
|
|
|
|
|
|
public static void InitializePresences()
|
|
|
|
|
{
|
|
|
|
|
// Инициализация списка посещаемости для текущей недели
|
|
|
|
|
foreach (var user in Users)
|
|
|
|
|
{
|
|
|
|
|
var lessons = new List<bool>(new bool[3]); // Предположим, что у нас 3 занятия
|
|
|
|
|
Presences.Add(new Presence(user.Id, DateTime.Today, user.GroupID, lessons));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Класс для хранения посещаемости
|
|
|
|
|
public class Presence
|
|
|
|
|
{
|
|
|
|
|
public Guid UserID { get; set; }
|
|
|
|
|
public DateTime Date { get; set; }
|
|
|
|
|
public int GroupID { get; set; }
|
|
|
|
|
public List<bool> Lessons { get; set; } // true - присутствует, false - отсутствует
|
|
|
|
|
|
|
|
|
|
public Presence(Guid userId, DateTime date, int groupId, List<bool> lessons)
|
|
|
|
|
{
|
|
|
|
|
UserID = userId;
|
|
|
|
|
Date = date;
|
|
|
|
|
GroupID = groupId;
|
|
|
|
|
Lessons = lessons;
|
|
|
|
|
}
|
2024-10-21 22:57:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|