реализация DataModels
This commit is contained in:
parent
5ad2aa2afa
commit
e3a8abde5a
@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33205.214
|
||||
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
|
||||
Global
|
||||
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}.Release|Any CPU.ActiveCfg = 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
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.BindingModel
|
||||
{
|
||||
public class CircleBindingModel
|
||||
public class CircleBindingModel : ICircleModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime StartDate { get; set; } = DateTime.Now;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.BindingModel
|
||||
{
|
||||
public class ClientBindingModel
|
||||
public class ClientBindingModel :IClientModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ClientName { get; set; } = string.Empty;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.BindingModel
|
||||
{
|
||||
public class EmployeeBindingModel
|
||||
public class EmployeeBindingModel : IEmployeeModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string EmployeeName { get; set; } = string.Empty;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,11 +7,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.BindingModel
|
||||
{
|
||||
public class LessonBindingModel
|
||||
public class LessonBindingModel : ILessonModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string LessonName { get; set; } = string.Empty;
|
||||
public decimal LessonCost { get; set; }
|
||||
public int EmployeeId { get; set; }
|
||||
public int? EmployeeId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,12 +7,12 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.BindingModel
|
||||
{
|
||||
public class PaymentBindingModel
|
||||
public class PaymentBindingModel : IPaymentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public decimal Sum { get; set; }
|
||||
public decimal Remains { get; set; }
|
||||
public DateTime DateOfPayment { get; set; }
|
||||
public DateTime? DateOfPayment { get; set; }
|
||||
public int LessonId { get; set; }
|
||||
}
|
||||
|
||||
|
@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SchoolDataModels\SchoolDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,4 +1,5 @@
|
||||
using SchoolContracts.BindingModel;
|
||||
using SchoolContracts.SearchModel;
|
||||
using SchoolContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
|
||||
public interface ICircleStorage
|
||||
{
|
||||
List<CircleViewModel> GetFullList();
|
||||
List<CircleViewModel> GetFilteredList(CircleBindingModel model);
|
||||
CircleViewModel GetElement(CircleBindingModel model);
|
||||
List<CircleViewModel> GetFilteredList(CircleSearchModel model);
|
||||
CircleViewModel GetElement(CircleSearchModel model);
|
||||
CircleViewModel? Insert(CircleBindingModel model);
|
||||
CircleViewModel? Update(CircleBindingModel model);
|
||||
CircleViewModel? Delete(CircleBindingModel model);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using SchoolContracts.BindingModel;
|
||||
using SchoolContracts.SearchModel;
|
||||
using SchoolContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
|
||||
public interface IClientStorage
|
||||
{
|
||||
List<ClientViewModel> GetFullList();
|
||||
List<ClientViewModel> GetFilteredList(ClientBindingModel model);
|
||||
ClientViewModel GetElement(ClientBindingModel model);
|
||||
List<ClientViewModel> GetFilteredList(ClientSearchModel model);
|
||||
ClientViewModel GetElement(ClientSearchModel model);
|
||||
ClientViewModel? Insert(ClientBindingModel model);
|
||||
ClientViewModel? Update(ClientBindingModel model);
|
||||
ClientViewModel? Delete(ClientBindingModel model);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using SchoolContracts.BindingModel;
|
||||
using SchoolContracts.SearchModel;
|
||||
using SchoolContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
|
||||
public interface IEmployeeStorage
|
||||
{
|
||||
List<EmployeeViewModel> GetFullList();
|
||||
List<EmployeeViewModel> GetFilteredList(EmployeeBindingModel model);
|
||||
EmployeeViewModel GetElement(EmployeeBindingModel model);
|
||||
List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model);
|
||||
EmployeeViewModel GetElement(EmployeeSearchModel model);
|
||||
EmployeeViewModel? Insert(EmployeeBindingModel model);
|
||||
EmployeeViewModel? Update(EmployeeBindingModel model);
|
||||
EmployeeViewModel? Delete(EmployeeBindingModel model);
|
||||
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SchoolContracts.BindingModel;
|
||||
using SchoolContracts.SearchModel;
|
||||
using SchoolContracts.ViewModels;
|
||||
|
||||
namespace SchoolContracts.StoragesContracts
|
||||
@ -11,8 +12,8 @@ namespace SchoolContracts.StoragesContracts
|
||||
public interface ILessonStorage
|
||||
{
|
||||
List<LessonViewModel> GetFullList();
|
||||
List<LessonViewModel> GetFilteredList(LessonBindingModel model);
|
||||
LessonViewModel GetElement(LessonBindingModel model);
|
||||
List<LessonViewModel> GetFilteredList(LessonSearchModel model);
|
||||
LessonViewModel GetElement(LessonSearchModel model);
|
||||
LessonViewModel? Insert(LessonBindingModel model);
|
||||
LessonViewModel? Update(LessonBindingModel model);
|
||||
LessonViewModel? Delete(LessonBindingModel model);
|
||||
|
@ -1,5 +1,6 @@
|
||||
using SchoolContracts.BindingModel;
|
||||
using SchoolContracts.BindingModels;
|
||||
using SchoolContracts.SearchModel;
|
||||
using SchoolContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -12,8 +13,8 @@ namespace SchoolContracts.StoragesContracts
|
||||
public interface IPaymentStorage
|
||||
{
|
||||
List<PaymentViewModel> GetFullList();
|
||||
List<PaymentViewModel> GetFilteredList(PaymentBindingModel model);
|
||||
PaymentViewModel GetElement(PaymentBindingModel model);
|
||||
List<PaymentViewModel> GetFilteredList(PaymentSearchModel model);
|
||||
PaymentViewModel GetElement(PaymentSearchModel model);
|
||||
PaymentViewModel? Insert(PaymentBindingModel model);
|
||||
PaymentViewModel? Update(PaymentBindingModel model);
|
||||
PaymentViewModel GetElementFirstLast(PaymentDateBindingModel model);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
@ -7,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.ViewModels
|
||||
{
|
||||
public class CircleViewModel
|
||||
public class CircleViewModel : ICircleModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Дата начала кружка")]
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.ViewModels
|
||||
{
|
||||
public class ClientViewModel
|
||||
public class ClientViewModel : IClientModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ClientName { get; set; }
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.ViewModels
|
||||
{
|
||||
public class EmployeeViewModel
|
||||
public class EmployeeViewModel : IEmployeeModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string EmployeeName { get; set; }
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
@ -7,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.ViewModels
|
||||
{
|
||||
public class LessonViewModel
|
||||
public class LessonViewModel : ILessonModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название занятия")]
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SchoolDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SchoolContracts.ViewModels
|
||||
{
|
||||
public class PaymentViewModel
|
||||
public class PaymentViewModel : IPaymentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public decimal Sum { get; set; }
|
||||
|
13
School/SchoolDataModels/IId.cs
Normal file
13
School/SchoolDataModels/IId.cs
Normal 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; }
|
||||
}
|
||||
}
|
16
School/SchoolDataModels/Models/ICircleModel.cs
Normal file
16
School/SchoolDataModels/Models/ICircleModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
16
School/SchoolDataModels/Models/IClientModel.cs
Normal file
16
School/SchoolDataModels/Models/IClientModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
16
School/SchoolDataModels/Models/IEmployeeModel.cs
Normal file
16
School/SchoolDataModels/Models/IEmployeeModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
9
School/SchoolDataModels/Models/ILessonModel.cs
Normal file
9
School/SchoolDataModels/Models/ILessonModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
16
School/SchoolDataModels/Models/IPaymentModel.cs
Normal file
16
School/SchoolDataModels/Models/IPaymentModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
9
School/SchoolDataModels/SchoolDataModels.csproj
Normal file
9
School/SchoolDataModels/SchoolDataModels.csproj
Normal file
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user