Compare commits

...

4 Commits

Author SHA1 Message Date
Kirill
0434c5f14c Контракты закончены 2024-04-30 16:11:58 +04:00
Kirill
550ec77222 View models вроде готовы 2024-04-30 13:16:38 +04:00
Kirill
cb98039241 Binding models сделаны вроде 2024-04-30 12:53:31 +04:00
Kirill
78ffb8ff1b Созданы модели сущностей 2024-04-29 22:18:38 +04:00
28 changed files with 514 additions and 1 deletions

View File

@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32602.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolApp", "SchoolApp\SchoolApp.csproj", "{9E7F8CCA-B349-49EC-B85E-D54299CC2759}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchoolApp", "SchoolApp\SchoolApp.csproj", "{9E7F8CCA-B349-49EC-B85E-D54299CC2759}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchoolDataModels", "SchoolsDataModels\SchoolDataModels.csproj", "{ADBB4992-BE2F-4B10-83CC-335E5B92EA35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolContracts", "SchoolContracts\SchoolContracts.csproj", "{D58B0AFE-E28D-4583-B9F1-C0EDF443243F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -15,6 +19,14 @@ Global
{9E7F8CCA-B349-49EC-B85E-D54299CC2759}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E7F8CCA-B349-49EC-B85E-D54299CC2759}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E7F8CCA-B349-49EC-B85E-D54299CC2759}.Release|Any CPU.Build.0 = Release|Any CPU
{ADBB4992-BE2F-4B10-83CC-335E5B92EA35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADBB4992-BE2F-4B10-83CC-335E5B92EA35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADBB4992-BE2F-4B10-83CC-335E5B92EA35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADBB4992-BE2F-4B10-83CC-335E5B92EA35}.Release|Any CPU.Build.0 = Release|Any CPU
{D58B0AFE-E28D-4583-B9F1-C0EDF443243F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D58B0AFE-E28D-4583-B9F1-C0EDF443243F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D58B0AFE-E28D-4583-B9F1-C0EDF443243F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D58B0AFE-E28D-4583-B9F1-C0EDF443243F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,20 @@
using SchoolDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.BindingModels
{
public class AchievementBindingModel : IAchievementModel
{
public int Id { get; set; }
public int LessonId { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public DateTime ReceiptDate { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SchoolDataModels.Models;
namespace SchoolContracts.BindingModels
{
public class InterestBindingModel : IInterestModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Direction { get; set; } = string.Empty;
public string Discription { get; set; } = string.Empty;
public Dictionary<int, (ILessonModel, int)> InterestLessons
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,21 @@
using SchoolDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.BindingModels
{
public class LessonBindingModel : ILessonModel
{
public int Id { get; set; }
public int UserId { get; set; }
public DateTime TimeStart { get; set; }
public DateTime TimeEnd { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SchoolDataModels.Models;
namespace SchoolContracts.BindingModels
{
public class UserBindingModel : IUserModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public DateTime BirthDate { get; set; }
public string Mail { get; set; } = string.Empty;
public string PhoneNumber { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,20 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.BusinessLogicsContracts
{
public interface IAchievementLogic
{
List<AchievementViewModel>? ReadList(AchievementSearchModel? model);
AchievementViewModel? ReadElement(AchievementSearchModel model);
bool Create(AchievementBindingModel model);
bool Update(AchievementBindingModel model);
bool Delete(AchievementBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.BusinessLogicsContracts
{
public interface IInterestLogic
{
List<InterestViewModel>? ReadList(InterestSearchModel? model);
InterestViewModel? ReadElement(InterestSearchModel model);
bool Create(InterestBindingModel model);
bool Update(InterestBindingModel model);
bool Delete(InterestBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.BusinessLogicsContracts
{
public interface ILessonLogic
{
List<LessonViewModel>? ReadList(LessonSearchModel? model);
LessonViewModel? ReadElement(LessonSearchModel model);
bool Create(LessonBindingModel model);
bool Update(LessonBindingModel model);
bool Delete(LessonBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.BusinessLogicsContracts
{
public interface IUserLogic
{
List<UserViewModel>? ReadList(UserSearchModel? model);
UserViewModel? ReadElement(UserSearchModel model);
bool Create(UserBindingModel model);
bool Update(UserBindingModel model);
bool Delete(UserBindingModel model);
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SchoolsDataModels\SchoolDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.SearchModels
{
public class AchievementSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.SearchModels
{
public class InterestSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.SearchModels
{
public class LessonSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.SearchModels
{
public class UserSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.StoragesContracts
{
public interface IAchievementStorage
{
List<AchievementViewModel> GetFullList();
List<AchievementViewModel> GetFilteredList(AchievementSearchModel model);
AchievementViewModel? GetElement(AchievementSearchModel model);
AchievementViewModel? Insert(AchievementBindingModel model);
AchievementViewModel? Update(AchievementBindingModel model);
AchievementViewModel? Delete(AchievementBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.StoragesContracts
{
public interface IInterestStorage
{
List<InterestViewModel> GetFullList();
List<InterestViewModel> GetFilteredList(InterestSearchModel model);
InterestViewModel? GetElement(InterestSearchModel model);
InterestViewModel? Insert(InterestBindingModel model);
InterestViewModel? Update(InterestBindingModel model);
InterestViewModel? Delete(InterestBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.StoragesContracts
{
public interface ILessonStorage
{
List<LessonViewModel> GetFullList();
List<LessonViewModel> GetFilteredList(LessonSearchModel model);
LessonViewModel? GetElement(LessonSearchModel model);
LessonViewModel? Insert(LessonBindingModel model);
LessonViewModel? Update(LessonBindingModel model);
LessonViewModel? Delete(LessonBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SchoolContracts.BindingModels;
using SchoolContracts.SearchModels;
using SchoolContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolContracts.StoragesContracts
{
public interface IUserStorage
{
List<UserViewModel> GetFullList();
List<UserViewModel> GetFilteredList(UserSearchModel model);
UserViewModel? GetElement(UserSearchModel model);
UserViewModel? Insert(UserBindingModel model);
UserViewModel? Update(UserBindingModel model);
UserViewModel? Delete(UserBindingModel model);
}
}

View File

@ -0,0 +1,22 @@
using SchoolDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace SchoolContracts.ViewModels
{
public class AchievementViewModel : IAchievementModel
{
public int Id { get; set; }
public int LessonId { get; set; }
[DisplayName("Название достижения")]
public string Name { get; set; } = string.Empty;
[DisplayName("Описание достижения")]
public string Description { get; set; } = string.Empty;
[DisplayName("Дата время получения")]
public DateTime ReceiptDate { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using SchoolDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace SchoolContracts.ViewModels
{
public class InterestViewModel : IInterestModel
{
public int Id { get; set; }
[DisplayName("Название интереса")]
public string Name { get; set; } = string.Empty;
[DisplayName("Направление интереса")]
public string Direction { get; set; } = string.Empty;
[DisplayName("Описание интереса")]
public string Discription { get; set; } = string.Empty;
public Dictionary<int, (ILessonModel, int)> InterestLessons
{
get;
set;
} = new();
}
}

View File

@ -0,0 +1,20 @@
using SchoolDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace SchoolContracts.ViewModels
{
public class LessonViewModel : ILessonModel
{
public int Id { get; set; }
public int UserId { get; set; }
[DisplayName("Время начала занятие")]
public DateTime TimeStart { get; set; }
[DisplayName("Время конца занятия")]
public DateTime TimeEnd { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using SchoolDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace SchoolContracts.ViewModels
{
public class UserViewModel : IUserModel
{
public int Id { get; set; }
[DisplayName("Имя пользователя")]
public string Name { get; set; } = string.Empty;
[DisplayName("Дата рождения")]
public DateTime BirthDate { get; set; }
[DisplayName("Электронная почта")]
public string Mail { get; set; } = string.Empty;
[DisplayName("Номер телефона")]
public string PhoneNumber { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolDataModels
{
public interface IId
{
int Id { get; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolDataModels.Models
{
public interface IAchievementModel : IId
{
int LessonId { get; }
string Name { get; }
string Description { get; }
DateTime ReceiptDate { get; }
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolDataModels.Models
{
public interface IInterestModel : IId
{
string Name { get; }
string Direction { get; }
string Discription { get; }
Dictionary<int, (ILessonModel, int)> InterestLessons { get; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolDataModels.Models
{
public interface ILessonModel : IId
{
int UserId { get; }
DateTime TimeStart { get; }
DateTime TimeEnd { get; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolDataModels.Models
{
public interface IUserModel : IId
{
string Name { get; }
DateTime BirthDate { get; }
string Mail { get; }
string PhoneNumber { get; }
string Password { get; }
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>