Сделанные сущности + начало добавления контрактов

This commit is contained in:
DyCTaTOR 2024-04-17 20:29:15 +04:00
parent f29376d4d8
commit 21a359f78d
14 changed files with 117 additions and 13 deletions

View File

@ -0,0 +1,14 @@
using University.DataModels.Models;
namespace University.Contracts.BindingModel
{
public class StudentBindingModel : IStudentModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Familia { get; set; } = string.Empty;
public string? Patronomyc { get; set; }
public string PhoneNumber { get; set; } = string.Empty;
public IPlanOfStudyModel? planOfStudy { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using University.Contracts.BindingModel;
using University.Contracts.SearchModels;
using University.Contracts.ViewModels;
namespace University.Contracts.BusinessLogicsContracts
{
public interface IStudentLogic
{
List<StudentViewModel>? ReadList(StudentSearchModel? model);
StudentViewModel? ReadElement(StudentSearchModel model);
bool Create(StudentBindingModel model);
bool Update(StudentBindingModel model);
bool Delete(StudentBindingModel model);
}
}

View File

@ -0,0 +1,13 @@
using University.DataModels.Models;
namespace University.Contracts.SearchModels
{
public class StudentSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
public string? Familia { get; set; }
public IPlanOfStudyModel? planOfStudy { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using University.Contracts.BindingModel;
using University.Contracts.SearchModels;
using University.Contracts.ViewModels;
namespace University.Contracts.StorageContracts
{
public interface IStudentStorage
{
List<StudentViewModel> GetFullList();
List<StudentViewModel> GetFilteredList(StudentSearchModel model);
StudentViewModel? GetElement(StudentSearchModel model);
StudentViewModel? Insert(StudentBindingModel model);
StudentViewModel? Update(StudentBindingModel model);
StudentViewModel? Delete(StudentBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using System.ComponentModel;
using University.DataModels.Models;
namespace University.Contracts.ViewModels
{
public class StudentViewModel : IStudentModel
{
public int Id { get; set; }
[DisplayName("Имя")]
public string Name { get; set; } = string.Empty;
[DisplayName("Фамилия")]
public string Familia { get; set; } = string.Empty;
[DisplayName("Отчество")]
public string Patronomyc { get; set; } = string.Empty;
[DisplayName("Номер Телефона")]
public string PhoneNumber { get; set; } = string.Empty;
public IPlanOfStudyModel planOfStudy { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace University.DataModels.Models
{
public interface IAttestationModel : IId
{
string FormOfEvaluation { get; }
string Score { get; }
IStudentModel Student { get; }
}
}

View File

@ -1,6 +1,6 @@
namespace University.DataModels.Models
{
public interface IDiscipline : IId
public interface IDisciplineModel : IId
{
int TeacherId { get; }
string Name { get; set; }

View File

@ -0,0 +1,9 @@
namespace University.DataModels.Models
{
public interface IPlanOfStudyModel : IId
{
string Profile { get; }
string FormOfStudy { get; }
Dictionary<int, IWorkerModel> Workers { get; }
}
}

View File

@ -1,6 +1,6 @@
namespace University.DataModels.Models
{
public interface IStatement : IId
public interface IStatementModel : IId
{
int TeacherId { get; }
string Name { get; }

View File

@ -1,6 +1,6 @@
namespace University.DataModels.Models
{
public interface IStorekeeper : IPerson
public interface IStorekeeperModel : IPerson
{
}
}

View File

@ -1,9 +0,0 @@
namespace University.DataModels.Models
{
public interface IStudent : IId
{
string Name { get; }
public string PhoneNumber { get; }
Dictionary<int, (IDiscipline, int)> StudentDisciplines { get; }
}
}

View File

@ -0,0 +1,11 @@
namespace University.DataModels.Models
{
public interface IStudentModel : IId
{
string Name { get; }
string Familia { get; }
string Patronomyc { get; }
public string PhoneNumber { get; }
IPlanOfStudyModel planOfStudy { get; }
}
}

View File

@ -1,6 +1,6 @@
namespace University.DataModels.Models
{
public interface ITeacher : IId
public interface ITeacherModel : IId
{
int StorekeeperId { get; }
string Name { get; }

View File

@ -0,0 +1,6 @@
namespace University.DataModels.Models
{
public interface IWorkerModel : IPerson
{
}
}