This commit is contained in:
Userok 2024-11-02 13:40:07 +03:00
parent 6882444548
commit 34ff2ea057
20 changed files with 66 additions and 206 deletions

View File

@ -12,6 +12,5 @@
"\\Zurnal\\RemaDateBase\\Interfase",
"\\Zurnal\\UI"
],
"SelectedNode": "\\Zurnal\\Program.cs",
"PreviewInSolutionExplorer": false
}

Binary file not shown.

View File

@ -1,40 +1,7 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\profi\\source\\repos\\Zurnal\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\Program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\Program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\UI\\conver.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\UI\\conver.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\Date\\Repository\\IGroupRepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\Date\\Repository\\IGroupRepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\RemoutDateBase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\RemaDateBase\\RemoutDateBase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\UI\\Info.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\UI\\Info.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\PresnceDao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\RemaDateBase\\DateDao\\PresnceDao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\UserDao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\RemaDateBase\\DateDao\\UserDao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\GroupDao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Zurnal\\RemaDateBase\\DateDao\\GroupDao.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
@ -42,109 +9,11 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 2,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "IGroupRepository.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\Date\\Repository\\IGroupRepository.cs",
"RelativeDocumentMoniker": "Zurnal\\Date\\Repository\\IGroupRepository.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\Date\\Repository\\IGroupRepository.cs",
"RelativeToolTip": "Zurnal\\Date\\Repository\\IGroupRepository.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA0AAAAFAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-31T10:12:18.045Z"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\Program.cs",
"RelativeDocumentMoniker": "Zurnal\\Program.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\Program.cs",
"RelativeToolTip": "Zurnal\\Program.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-31T09:55:53.345Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "RemoutDateBase.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\RemoutDateBase.cs",
"RelativeDocumentMoniker": "Zurnal\\RemaDateBase\\RemoutDateBase.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\RemoutDateBase.cs",
"RelativeToolTip": "Zurnal\\RemaDateBase\\RemoutDateBase.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA4AAABYAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-31T09:55:25.475Z"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "conver.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\UI\\conver.cs",
"RelativeDocumentMoniker": "Zurnal\\UI\\conver.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\UI\\conver.cs",
"RelativeToolTip": "Zurnal\\UI\\conver.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAQAAAATAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-30T08:26:48.661Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "Info.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\UI\\Info.cs",
"RelativeDocumentMoniker": "Zurnal\\UI\\Info.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\UI\\Info.cs",
"RelativeToolTip": "Zurnal\\UI\\Info.cs",
"ViewState": "AgIAAAwAAAAAAAAAAAAAAAsAAAAFAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-28T08:04:53.338Z"
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "PresnceDao.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\PresnceDao.cs",
"RelativeDocumentMoniker": "Zurnal\\RemaDateBase\\DateDao\\PresnceDao.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\PresnceDao.cs",
"RelativeToolTip": "Zurnal\\RemaDateBase\\DateDao\\PresnceDao.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAoAAAABAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-24T11:06:26.008Z"
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "GroupDao.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\GroupDao.cs",
"RelativeDocumentMoniker": "Zurnal\\RemaDateBase\\DateDao\\GroupDao.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\GroupDao.cs",
"RelativeToolTip": "Zurnal\\RemaDateBase\\DateDao\\GroupDao.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAYAAAAwAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-24T11:06:19.494Z"
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "UserDao.cs",
"DocumentMoniker": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\UserDao.cs",
"RelativeDocumentMoniker": "Zurnal\\RemaDateBase\\DateDao\\UserDao.cs",
"ToolTip": "C:\\Users\\profi\\source\\repos\\Zurnal\\Zurnal\\RemaDateBase\\DateDao\\UserDao.cs",
"RelativeToolTip": "Zurnal\\RemaDateBase\\DateDao\\UserDao.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-28T12:18:34.74Z"
}
]
}

Binary file not shown.

View File

@ -1,7 +1,4 @@
using System.Diagnostics;
using System.Linq;
using System.Collections.Generic;
using Zurnal.Date.LocalDate;
using Zurnal.Date.Repository;
using Zurnal.RemaDateBase.DateDao;
using System.Text.RegularExpressions;
@ -77,11 +74,6 @@ public bool UpdateGroupById(int groupId, GroupDao updatedGroup)
}
}
IEnumerable<Group> IGroupRepository.AllGroups()
{
throw new NotImplementedException();
}
bool IGroupRepository.AddGroup(GroupDao newGroup)
{
throw new NotImplementedException();

View File

@ -1,6 +1,5 @@
using Zurnal.RemaDateBase.DateDao;
using Microsoft.Extensions.DependencyInjection;
using Zurnal.Data.Repository;
using Group = System.Text.RegularExpressions.Group;
namespace Zurnal.Date.Repository
@ -9,15 +8,50 @@ namespace Zurnal.Date.Repository
{
List<GroupDao> AllGroup { get; }
IEnumerable<Group> AllGroups();
bool RemoveGroupById(int groupID);
bool UpdateGroupById(int groupID, GroupDao updatedGroup);
bool AddGroup(GroupDao newGroup);
public IEnumerable<GroupDao> AllGroups()
{
return GroupDao.Name.Select(g => new GroupDao { GroupName = g.GroupName, Id = g.Id });
}
public bool RemoveGroupById(int groupId)
{
var group = GroupDao.Name.FirstOrDefault(g => g.Id == groupId);
if (group != null)
{
GroupDao.Name.Remove(group);
return true;
}
return false;
}
public bool UpdateGroupById(int groupId, GroupDao updatedGroup)
{
var group = GroupDao.Name.FirstOrDefault(g => g.Id == groupId);
if (group != null)
{
group.GroupName = updatedGroup.GroupName;
return true;
}
return false;
}
public void DeleteGroup(int id)
{
var group = GroupDao.Name.FirstOrDefault(g => g.Id == id);
if (group != null)
{
GroupDao.Name.Remove(group);
}
}
void AddGroupFromRegex(Group group);
GroupDao GetGroupById(int id);
public GroupDao GetGroupById(int id);
IEnumerable<GroupDao> GetAllGroups();
void UpdateGroup(GroupDao group);
void DeleteGroup(int id);
public void UpdateGroupName(int groupId, string name)
{
var group = GroupDao.Name.FirstOrDefault(g => g.Id == groupId);
if (group != null)
{
group.GroupName = name;
}
}
}
internal class ServiceConfiguration
@ -25,7 +59,7 @@ namespace Zurnal.Date.Repository
public static void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<RemoteDateBaseContext>()
.AddScoped<IGroupRepository, GroupRepositoryImpl>();
.AddScoped<IGroupRepository>();
}
}
}

View File

@ -114,6 +114,11 @@ namespace Zurnal.Data.Repository
throw new NotImplementedException();
}
IEnumerable<GroupDao> IGroupRepository.AllGroups()
{
throw new NotImplementedException();
}
public List<GroupLocalEntity> AllGroup => throw new NotImplementedException();
List<GroupDao> IGroupRepository.AllGroup => throw new NotImplementedException();

View File

@ -6,6 +6,7 @@ namespace Zurnal.Domain.UseCase
{
public class GroupUseCase : IGroupRepository
{
private List<GroupDao> _groups = new List<GroupDao>();
private UserRepositoryImpl _repositoryUserImpl;
private GroupRepositoryImpl _repositoryGroupImpl;
@ -37,9 +38,15 @@ namespace Zurnal.Domain.UseCase
}
public bool RemoveGroupById(int groupID)
{
var group = _repositoryGroupImpl.GetGroupById(groupID);
if (group == null)
{
throw new NotImplementedException();
return false;
}
_repositoryGroupImpl.DeleteGroup(groupID);
return true;
}
public bool UpdateGroupById(int groupID, GroupDao updatedGroup)
{
@ -59,14 +66,9 @@ namespace Zurnal.Domain.UseCase
}
public GroupDao GetGroupById(int id)
{
var group = _repositoryGroupImpl.GetGroupById(id);
if (group == null)
{
throw new KeyNotFoundException($"Группа с ID {id} не найдена.");
return _groups.FirstOrDefault(g => g.Id == id);
}
return group;
}
public void UpdateGroup(GroupDao group)

View File

@ -72,47 +72,6 @@ namespace Zurnal.Domain.UseCase
{
return (IEnumerable<System.Text.RegularExpressions.Group>)((IGroupRepository)_repositoryUserImpl).GetAllGroups();
}
public bool RemoveGroupById(int groupID)
{
throw new NotImplementedException();
}
public bool UpdateGroupById(int groupID, GroupDao updatedGroup)
{
throw new NotImplementedException();
}
public bool AddGroup(GroupDao newGroup)
{
throw new NotImplementedException();
}
public void AddGroupFromRegex(System.Text.RegularExpressions.Group group)
{
throw new NotImplementedException();
}
public GroupDao GetGroupById(int id)
{
throw new NotImplementedException();
}
IEnumerable<GroupDao> IGroupRepository.GetAllGroups()
{
throw new NotImplementedException();
}
public void UpdateGroup(GroupDao group)
{
throw new NotImplementedException();
}
public void DeleteGroup(int id)
{
throw new NotImplementedException();
}
internal class UserLocalEntity
{
public string FIO { get; set; }

View File

@ -23,7 +23,7 @@ namespace Zurnal.UI
StringBuilder userOutput = new StringBuilder();
foreach (var user in _userUseCase.GetAllUsers())
{
userOutput.AppendLine($"{user.Guid}\t{user.FIO}\t{user.Group.Name}");
userOutput.AppendLine($"{user.UserGuid}\t{user.FIO}\t{user.Group.GroupName}");
}
Console.WriteLine(userOutput);
}

View File

@ -13,10 +13,10 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Zurnal")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d8b97b4d4726ad4a4fb1b1f71d1f4e9c62ebd29b")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6882444548100e8c025d9e78806599aa8bb318a3")]
[assembly: System.Reflection.AssemblyProductAttribute("Zurnal")]
[assembly: System.Reflection.AssemblyTitleAttribute("Zurnal")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
// Создано классом WriteCodeFragment MSBuild.

View File

@ -1 +1 @@
c3dcf515a535c8feb2557d6f2ba5b36f9feac86b0ec88244007d55a701c20bcf
9dff231535641cdfc92aca08ac3ded2ec8946da291a33bf90e9cc5f880b09a03