2024-10-17 16:08:02 +00:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Posechaemost.Data.LocalData;
|
|
|
|
using Posechaemost.Data.LocalData.Entity;
|
|
|
|
|
|
|
|
namespace Posechaemost.Data.Repository
|
|
|
|
{
|
|
|
|
public class GroupRepositoryImpl
|
|
|
|
{
|
|
|
|
public List<GroupLocalEntity> GetAllGroups() => LocalStaticData.groups;
|
2024-10-18 08:27:50 +00:00
|
|
|
public GroupLocalEntity? UpdateGroup(String name)
|
2024-10-17 16:08:02 +00:00
|
|
|
{
|
|
|
|
GroupLocalEntity? groupLocal = GetAllGroups()
|
2024-10-18 08:27:50 +00:00
|
|
|
.Where(x => x.Name == name).FirstOrDefault();
|
2024-10-17 16:08:02 +00:00
|
|
|
if (groupLocal == null) return null;
|
2024-10-18 08:27:50 +00:00
|
|
|
groupLocal.Name = name;
|
2024-10-17 16:08:02 +00:00
|
|
|
return groupLocal;
|
|
|
|
}
|
|
|
|
|
2024-10-18 08:43:40 +00:00
|
|
|
public GroupLocalEntity? AddGroup(String name, String id)
|
|
|
|
{
|
|
|
|
GroupLocalEntity? groupLocal = GetAllGroups().FirstOrDefault();
|
|
|
|
groupLocal.Name = name;
|
|
|
|
groupLocal.Id = int.Parse(id);
|
|
|
|
return groupLocal;
|
|
|
|
}
|
2024-10-17 16:08:02 +00:00
|
|
|
}
|
|
|
|
}
|