slarny4/Demo1/Data/LocalData/LocalStaticData.cs
Class_Student aa3336ca1b init
2024-10-23 12:52:43 +03:00

58 lines
2.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Demo.Data.LocalData.Entity;
using System;
using System.Collections.Generic;
using Demo.Domain.Models;
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"
};
// Список посещаемостей
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;
}
}
}