реализация DataModels

This commit is contained in:
Альфия Тукаева 2023-04-03 17:46:26 +03:00
parent 5ad2aa2afa
commit e3a8abde5a
24 changed files with 153 additions and 33 deletions

View File

@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214 VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolContracts", "SchoolContracts\SchoolContracts.csproj", "{CE6AA228-4B99-4071-9791-D6117703F66A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchoolContracts", "SchoolContracts\SchoolContracts.csproj", "{CE6AA228-4B99-4071-9791-D6117703F66A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolDataModels", "SchoolDataModels\SchoolDataModels.csproj", "{8F1FD758-DD7C-4CA5-8371-6D242FB03278}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -15,6 +17,10 @@ Global
{CE6AA228-4B99-4071-9791-D6117703F66A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CE6AA228-4B99-4071-9791-D6117703F66A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE6AA228-4B99-4071-9791-D6117703F66A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CE6AA228-4B99-4071-9791-D6117703F66A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE6AA228-4B99-4071-9791-D6117703F66A}.Release|Any CPU.Build.0 = Release|Any CPU {CE6AA228-4B99-4071-9791-D6117703F66A}.Release|Any CPU.Build.0 = Release|Any CPU
{8F1FD758-DD7C-4CA5-8371-6D242FB03278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F1FD758-DD7C-4CA5-8371-6D242FB03278}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F1FD758-DD7C-4CA5-8371-6D242FB03278}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F1FD758-DD7C-4CA5-8371-6D242FB03278}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,7 +7,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.BindingModel namespace SchoolContracts.BindingModel
{ {
public class CircleBindingModel public class CircleBindingModel : ICircleModel
{ {
public int Id { get; set; } public int Id { get; set; }
public DateTime StartDate { get; set; } = DateTime.Now; public DateTime StartDate { get; set; } = DateTime.Now;

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,7 +7,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.BindingModel namespace SchoolContracts.BindingModel
{ {
public class ClientBindingModel public class ClientBindingModel :IClientModel
{ {
public int Id { get; set; } public int Id { get; set; }
public string ClientName { get; set; } = string.Empty; public string ClientName { get; set; } = string.Empty;

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,7 +7,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.BindingModel namespace SchoolContracts.BindingModel
{ {
public class EmployeeBindingModel public class EmployeeBindingModel : IEmployeeModel
{ {
public int Id { get; set; } public int Id { get; set; }
public string EmployeeName { get; set; } = string.Empty; public string EmployeeName { get; set; } = string.Empty;

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,11 +7,11 @@ using System.Threading.Tasks;
namespace SchoolContracts.BindingModel namespace SchoolContracts.BindingModel
{ {
public class LessonBindingModel public class LessonBindingModel : ILessonModel
{ {
public int Id { get; set; } public int Id { get; set; }
public string LessonName { get; set; } = string.Empty; public string LessonName { get; set; } = string.Empty;
public decimal LessonCost { get; set; } public decimal LessonCost { get; set; }
public int EmployeeId { get; set; } public int? EmployeeId { get; set; }
} }
} }

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,12 +7,12 @@ using System.Threading.Tasks;
namespace SchoolContracts.BindingModel namespace SchoolContracts.BindingModel
{ {
public class PaymentBindingModel public class PaymentBindingModel : IPaymentModel
{ {
public int Id { get; set; } public int Id { get; set; }
public decimal Sum { get; set; } public decimal Sum { get; set; }
public decimal Remains { get; set; } public decimal Remains { get; set; }
public DateTime DateOfPayment { get; set; } public DateTime? DateOfPayment { get; set; }
public int LessonId { get; set; } public int LessonId { get; set; }
} }

View File

@ -6,4 +6,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SchoolDataModels\SchoolDataModels.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,5 @@
using SchoolContracts.BindingModel; using SchoolContracts.BindingModel;
using SchoolContracts.SearchModel;
using SchoolContracts.ViewModels; using SchoolContracts.ViewModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
public interface ICircleStorage public interface ICircleStorage
{ {
List<CircleViewModel> GetFullList(); List<CircleViewModel> GetFullList();
List<CircleViewModel> GetFilteredList(CircleBindingModel model); List<CircleViewModel> GetFilteredList(CircleSearchModel model);
CircleViewModel GetElement(CircleBindingModel model); CircleViewModel GetElement(CircleSearchModel model);
CircleViewModel? Insert(CircleBindingModel model); CircleViewModel? Insert(CircleBindingModel model);
CircleViewModel? Update(CircleBindingModel model); CircleViewModel? Update(CircleBindingModel model);
CircleViewModel? Delete(CircleBindingModel model); CircleViewModel? Delete(CircleBindingModel model);

View File

@ -1,4 +1,5 @@
using SchoolContracts.BindingModel; using SchoolContracts.BindingModel;
using SchoolContracts.SearchModel;
using SchoolContracts.ViewModels; using SchoolContracts.ViewModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
public interface IClientStorage public interface IClientStorage
{ {
List<ClientViewModel> GetFullList(); List<ClientViewModel> GetFullList();
List<ClientViewModel> GetFilteredList(ClientBindingModel model); List<ClientViewModel> GetFilteredList(ClientSearchModel model);
ClientViewModel GetElement(ClientBindingModel model); ClientViewModel GetElement(ClientSearchModel model);
ClientViewModel? Insert(ClientBindingModel model); ClientViewModel? Insert(ClientBindingModel model);
ClientViewModel? Update(ClientBindingModel model); ClientViewModel? Update(ClientBindingModel model);
ClientViewModel? Delete(ClientBindingModel model); ClientViewModel? Delete(ClientBindingModel model);

View File

@ -1,4 +1,5 @@
using SchoolContracts.BindingModel; using SchoolContracts.BindingModel;
using SchoolContracts.SearchModel;
using SchoolContracts.ViewModels; using SchoolContracts.ViewModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
public interface IEmployeeStorage public interface IEmployeeStorage
{ {
List<EmployeeViewModel> GetFullList(); List<EmployeeViewModel> GetFullList();
List<EmployeeViewModel> GetFilteredList(EmployeeBindingModel model); List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model);
EmployeeViewModel GetElement(EmployeeBindingModel model); EmployeeViewModel GetElement(EmployeeSearchModel model);
EmployeeViewModel? Insert(EmployeeBindingModel model); EmployeeViewModel? Insert(EmployeeBindingModel model);
EmployeeViewModel? Update(EmployeeBindingModel model); EmployeeViewModel? Update(EmployeeBindingModel model);
EmployeeViewModel? Delete(EmployeeBindingModel model); EmployeeViewModel? Delete(EmployeeBindingModel model);

View File

@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using SchoolContracts.BindingModel; using SchoolContracts.BindingModel;
using SchoolContracts.SearchModel;
using SchoolContracts.ViewModels; using SchoolContracts.ViewModels;
namespace SchoolContracts.StoragesContracts namespace SchoolContracts.StoragesContracts
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
public interface ILessonStorage public interface ILessonStorage
{ {
List<LessonViewModel> GetFullList(); List<LessonViewModel> GetFullList();
List<LessonViewModel> GetFilteredList(LessonBindingModel model); List<LessonViewModel> GetFilteredList(LessonSearchModel model);
LessonViewModel GetElement(LessonBindingModel model); LessonViewModel GetElement(LessonSearchModel model);
LessonViewModel? Insert(LessonBindingModel model); LessonViewModel? Insert(LessonBindingModel model);
LessonViewModel? Update(LessonBindingModel model); LessonViewModel? Update(LessonBindingModel model);
LessonViewModel? Delete(LessonBindingModel model); LessonViewModel? Delete(LessonBindingModel model);

View File

@ -1,5 +1,6 @@
using SchoolContracts.BindingModel; using SchoolContracts.BindingModel;
using SchoolContracts.BindingModels; using SchoolContracts.BindingModels;
using SchoolContracts.SearchModel;
using SchoolContracts.ViewModels; using SchoolContracts.ViewModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -12,8 +13,8 @@ namespace SchoolContracts.StoragesContracts
public interface IPaymentStorage public interface IPaymentStorage
{ {
List<PaymentViewModel> GetFullList(); List<PaymentViewModel> GetFullList();
List<PaymentViewModel> GetFilteredList(PaymentBindingModel model); List<PaymentViewModel> GetFilteredList(PaymentSearchModel model);
PaymentViewModel GetElement(PaymentBindingModel model); PaymentViewModel GetElement(PaymentSearchModel model);
PaymentViewModel? Insert(PaymentBindingModel model); PaymentViewModel? Insert(PaymentBindingModel model);
PaymentViewModel? Update(PaymentBindingModel model); PaymentViewModel? Update(PaymentBindingModel model);
PaymentViewModel GetElementFirstLast(PaymentDateBindingModel model); PaymentViewModel GetElementFirstLast(PaymentDateBindingModel model);

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
@ -7,7 +8,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.ViewModels namespace SchoolContracts.ViewModels
{ {
public class CircleViewModel public class CircleViewModel : ICircleModel
{ {
public int Id { get; set; } public int Id { get; set; }
[DisplayName("Дата начала кружка")] [DisplayName("Дата начала кружка")]

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,7 +7,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.ViewModels namespace SchoolContracts.ViewModels
{ {
public class ClientViewModel public class ClientViewModel : IClientModel
{ {
public int Id { get; set; } public int Id { get; set; }
public string ClientName { get; set; } public string ClientName { get; set; }

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,7 +7,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.ViewModels namespace SchoolContracts.ViewModels
{ {
public class EmployeeViewModel public class EmployeeViewModel : IEmployeeModel
{ {
public int Id { get; set; } public int Id { get; set; }
public string EmployeeName { get; set; } public string EmployeeName { get; set; }

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
@ -7,7 +8,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.ViewModels namespace SchoolContracts.ViewModels
{ {
public class LessonViewModel public class LessonViewModel : ILessonModel
{ {
public int Id { get; set; } public int Id { get; set; }
[DisplayName("Название занятия")] [DisplayName("Название занятия")]

View File

@ -1,4 +1,5 @@
using System; using SchoolDataModels.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,7 +7,7 @@ using System.Threading.Tasks;
namespace SchoolContracts.ViewModels namespace SchoolContracts.ViewModels
{ {
public class PaymentViewModel public class PaymentViewModel : IPaymentModel
{ {
public int Id { get; set; } public int Id { get; set; }
public decimal Sum { get; set; } public decimal Sum { 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 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 ICircleModel : IId
{
public DateTime StartDate { get; set; }
public int ClientId { get; set; }
public int LessonId { get; set; }
public Dictionary<int, string> CircleLessons { get; set; }
}
}

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 IClientModel : IId
{
public string ClientName { get; set; }
public string ClientEmail { get; set; }
public string ClientPhone { get; set; }
public string ClientPassword { get; set; }
}
}

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 IEmployeeModel : IId
{
public string EmployeeName { get; set; }
public string EmployeePassword { get; set; }
public string EmployeeEmail { get; set; }
public string EmployeePhone { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace SchoolDataModels.Models
{
public interface ILessonModel : IId
{
public string LessonName { get; set; }
public decimal LessonCost { get; set; }
public int? EmployeeId { get; set; }
}
}

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 IPaymentModel : IId
{
public decimal Sum { get; set; }
public decimal Remains { get; set; }
public DateTime? DateOfPayment { get; set; }
public int LessonId { get; set; }
}
}

View File

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