Compare commits

...

5 Commits

Author SHA1 Message Date
revengel66
a750157cb8 end CosmeticStorage 2024-07-25 18:44:30 +04:00
f64f29a84b add searchmodels, edit storages 2024-07-24 21:04:21 +03:00
revengel66
9fb4943f9b edit models 2024-07-24 13:22:05 +04:00
revengel66
a4023d8aff created classes 2024-07-23 21:32:13 +04:00
revengel66
14d1d0eed3 begin 2024-07-23 20:18:55 +04:00
74 changed files with 1691 additions and 0 deletions

View File

@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34723.18
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySalonView", "BeautySalonView\BeautySalonView.csproj", "{3DA370D1-A702-425A-A7DE-D558514373A6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySalonContracts", "BeautySalonContracts\BeautySalonContracts.csproj", "{96010EED-D9BD-4238-941F-1D93459E5A63}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySalonBusinessLogic", "BeautySalonBusinessLogic\BeautySalonBusinessLogic.csproj", "{8E38BF54-E62B-43B6-970A-57D949CBF5A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySalonListImplement", "BeautySalonDatabaseImplement\BeautySalonListImplement.csproj", "{96FDD17C-1CDF-42F1-9A16-D6A90285F5DA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3DA370D1-A702-425A-A7DE-D558514373A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DA370D1-A702-425A-A7DE-D558514373A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DA370D1-A702-425A-A7DE-D558514373A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DA370D1-A702-425A-A7DE-D558514373A6}.Release|Any CPU.Build.0 = Release|Any CPU
{96010EED-D9BD-4238-941F-1D93459E5A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96010EED-D9BD-4238-941F-1D93459E5A63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96010EED-D9BD-4238-941F-1D93459E5A63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96010EED-D9BD-4238-941F-1D93459E5A63}.Release|Any CPU.Build.0 = Release|Any CPU
{8E38BF54-E62B-43B6-970A-57D949CBF5A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E38BF54-E62B-43B6-970A-57D949CBF5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E38BF54-E62B-43B6-970A-57D949CBF5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E38BF54-E62B-43B6-970A-57D949CBF5A9}.Release|Any CPU.Build.0 = Release|Any CPU
{96FDD17C-1CDF-42F1-9A16-D6A90285F5DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96FDD17C-1CDF-42F1-9A16-D6A90285F5DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96FDD17C-1CDF-42F1-9A16-D6A90285F5DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96FDD17C-1CDF-42F1-9A16-D6A90285F5DA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {450E6C17-1F74-4C88-B0D6-14306D0539D8}
EndGlobalSection
EndGlobal

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="..\BeautySalonContracts\BeautySalonContracts.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class ClientBusinessLogic : IClientBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class CosmeticBusinessLogic : ICosmeticBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class DistributionBusinessLogic : IDistributionBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class EmployeeBusinessLogic : IEmployeeBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class ProcedureBusinessLogic : IProcedureBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class PurchaseBusinessLogic : IPurchaseBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class ReceiptBusinessLogic : IReceiptBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonBusinessLogic.BusinessLogics
{
internal class VisitBusinessLogic : IVisitBusinessLogic
{
}
}

View File

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

View File

@ -0,0 +1,13 @@

namespace BeautySalonContracts.BindingModels
{
public class ClientBindingModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public string Login { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string Phone { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,10 @@

namespace BeautySalonContracts.BindingModels
{
public class CosmeticBindingModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public double Price { get; set; }
}
}

View File

@ -0,0 +1,10 @@

namespace BeautySalonContracts.BindingModels
{
public class DistributionBindingModel
{
public int Id { get; set; }
public DateTime Date { get; set; }
public double Sum { get; set; }
}
}

View File

@ -0,0 +1,14 @@

namespace BeautySalonContracts.BindingModels
{
public class EmployeeBindingModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public string Login { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string Phone { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,11 @@

namespace BeautySalonContracts.BindingModels
{
public class ProcedureBindingModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public double Price { get; set; }
public string FIO_Master { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,10 @@

namespace BeautySalonContracts.BindingModels
{
public class PurchaseBindingModel
{
public int Id { get; set; }
public DateTime Date { get; set; }
public double Sum { get; }
}
}

View File

@ -0,0 +1,10 @@

namespace BeautySalonContracts.BindingModels
{
public class ReceiptBindingModel
{
public int Id { get; set; }
public DateTime Date { get; set; }
public double Sum { get; set; }
}
}

View File

@ -0,0 +1,10 @@

namespace BeautySalonContracts.BindingModels
{
public class VisitBindingModel
{
public int Id { get; set; }
public DateTime Date { get; set; }
public double Sum { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface IClientBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface ICosmeticBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface IDistributionBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface IEmployeeBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface IProcedureBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface IPurchaseBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface IReceiptBusinessLogic
{
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeautySalonContracts.BusinessLogicsContracts
{
internal interface IVisitBusinessLogic
{
}
}

View File

@ -0,0 +1,9 @@

namespace BeautySalonContracts.SearchModels
{
public class ClientSearchModel
{
public int? Id { get; set; }
public string? Login { get; set; }
}
}

View File

@ -0,0 +1,9 @@

namespace BeautySalonContracts.SearchModels
{
public class CosmeticSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,8 @@

namespace BeautySalonContracts.SearchModels
{
public class DistributionSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,10 @@

namespace BeautySalonContracts.SearchModels
{
public class EmployeeSearchModel
{
public int? Id { get; set; }
public string? Login { get; set; }
}
}

View File

@ -0,0 +1,9 @@

namespace BeautySalonContracts.SearchModels
{
public class ProcedureSearchModel
{
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,8 @@

namespace BeautySalonContracts.SearchModels
{
public class PurchaseSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,8 @@

namespace BeautySalonContracts.SearchModels
{
public class ReceiptSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,8 @@

namespace BeautySalonContracts.SearchModels
{
public class VisitSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface IClientStorage
{
List<ClientViewModel> GetFullList();
List<ClientViewModel> GetFilteredList(ClientSearchModel model);
ClientViewModel GetElement(ClientSearchModel model);
ClientViewModel Insert(ClientBindingModel model);
ClientViewModel Update(ClientBindingModel model);
ClientViewModel Delete(ClientBindingModel model);
}
}

View File

@ -0,0 +1,19 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface ICosmeticStorage
{
List<CosmeticViewModel> GetFullList();
List<CosmeticViewModel> GetFilteredList(CosmeticSearchModel model);
CosmeticViewModel? GetElement(CosmeticSearchModel model);
CosmeticViewModel? Insert(CosmeticBindingModel model);
CosmeticViewModel? Update(CosmeticBindingModel model);
CosmeticViewModel? Delete(CosmeticBindingModel model);
}
}

View File

@ -0,0 +1,17 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface IDistributionStorage
{
List<DistributionViewModel> GetFullList();
List<DistributionViewModel> GetFilteredList(DistributionSearchModel model);
DistributionViewModel GetElement(DistributionSearchModel model);
DistributionViewModel Insert(DistributionBindingModel model);
DistributionViewModel Update(DistributionBindingModel model);
DistributionViewModel Delete(DistributionBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface IEmployeeStorage
{
List<EmployeeViewModel> GetFullList();
List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model);
EmployeeViewModel GetElement(EmployeeSearchModel model);
EmployeeViewModel Insert(EmployeeBindingModel model);
EmployeeViewModel Update(EmployeeBindingModel model);
EmployeeViewModel Delete(EmployeeBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface IProcedureStorage
{
List<ProcedureViewModel> GetFullList();
List<ProcedureViewModel> GetFilteredList(ProcedureSearchModel model);
ProcedureViewModel GetElement(ProcedureSearchModel model);
ProcedureViewModel Insert(ProcedureBindingModel model);
ProcedureViewModel Update(ProcedureBindingModel model);
ProcedureViewModel Delete(ProcedureBindingModel model);
}
}

View File

@ -0,0 +1,17 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface IPurchaseStorage
{
List<PurchaseViewModel> GetFullList();
List<PurchaseViewModel> GetFilteredList(PurchaseSearchModel model);
PurchaseViewModel GetElement(PurchaseSearchModel model);
PurchaseViewModel Insert(PurchaseBindingModel model);
PurchaseViewModel Update(PurchaseBindingModel model);
PurchaseViewModel Delete(PurchaseBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface IReceiptStorage
{
List<ReceiptViewModel> GetFullList();
List<ReceiptViewModel> GetFilteredList(ReceiptSearchModel model);
ReceiptViewModel GetElement(ReceiptSearchModel model);
ReceiptViewModel Insert(ReceiptBindingModel model);
ReceiptViewModel Update(ReceiptBindingModel model);
ReceiptViewModel Delete(ReceiptBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonContracts.StorageContracts
{
public interface IVisitStorage
{
List<VisitViewModel> GetFullList();
List<VisitViewModel> GetFilteredList(VisitSearchModel model);
VisitViewModel GetElement(VisitSearchModel model);
VisitViewModel Insert(VisitBindingModel model);
VisitViewModel Update(VisitBindingModel model);
VisitViewModel Delete(VisitBindingModel model);
}
}

View File

@ -0,0 +1,20 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class ClientViewModel
{
public int Id { get; set; }
[DisplayName("Имя")]
public string Name { get; set; } = string.Empty;
[DisplayName("Фамилия")]
public string Surname { get; set; } = string.Empty;
[DisplayName("Логин")]
public string Login { get; set; } = string.Empty;
[DisplayName("Пароль")]
public string Password { get; set; } = string.Empty;
[DisplayName("Телефон")]
public string Phone { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,14 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class CosmeticViewModel
{
public int Id { get; set; }
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Цена")]
public double Price { get; set; }
}
}

View File

@ -0,0 +1,14 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class DistributionViewModel
{
public int Id { get; set; }
[DisplayName("Дата выдачи")]
public DateTime Date { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }
}
}

View File

@ -0,0 +1,21 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class EmployeeViewModel
{
public int Id { get; set; }
[DisplayName("Имя")]
public string Name { get; set; } = string.Empty;
[DisplayName("Фамилия")]
public string Surname { get; set; } = string.Empty;
[DisplayName("Логин")]
public string Login { get; set; } = string.Empty;
[DisplayName("Пароль")]
public string Password { get; set; } = string.Empty;
[DisplayName("Телефон")]
public string Phone { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,16 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class ProcedureViewModel
{
public int Id { get; set; }
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Цена")]
public double Price { get; set; }
[DisplayName("ФИО мастера")]
public string FIO_Master { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,14 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class PurchaseViewModel
{
public int Id { get; set; }
[DisplayName("Дата покупки")]
public DateTime Date { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }
}
}

View File

@ -0,0 +1,14 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class ReceiptViewModel
{
public int Id { get; set; }
[DisplayName("Дата")]
public DateTime Date { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }
}
}

View File

@ -0,0 +1,14 @@

using System.ComponentModel;
namespace BeautySalonContracts.ViewModels
{
public class VisitViewModel
{
public int Id { get; set; }
[DisplayName("Дата посещения")]
public DateTime Date { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }
}
}

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="..\BeautySalonContracts\BeautySalonContracts.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,39 @@

using BeautySalonDatabaseImplement.Models;
namespace BeautySalonListImplement
{
public class DataListSingleton
{
private static DataListSingleton? _instance;
public List<Client> Clients { get; set; }
public List<Cosmetic> Cosmetics { get; set; }
public List<Distribution> Distributions { get; set; }
public List<Employee> Employees { get; set; }
public List<Procedure> Procedures { get; set; }
public List<Purchase> Purchases { get; set; }
public List<Receipt> Receipts { get; set; }
public List<Visit> Visits { get; set; }
private DataListSingleton()
{
Clients = new List<Client>();
Cosmetics = new List<Cosmetic>();
Distributions = new List<Distribution>();
Employees = new List<Employee>();
Procedures = new List<Procedure>();
Purchases = new List<Purchase>();
Receipts = new List<Receipt>();
Visits = new List<Visit>();
}
public static DataListSingleton GetInstance()
{
if (_instance == null)
{
_instance = new DataListSingleton();
}
return _instance;
}
}
}

View File

@ -0,0 +1,41 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Implements
{
internal class ClientStorage : IClientStorage
{
public ClientViewModel Delete(ClientBindingModel model)
{
throw new NotImplementedException();
}
public ClientViewModel GetElement(ClientSearchModel model)
{
throw new NotImplementedException();
}
public List<ClientViewModel> GetFilteredList(ClientSearchModel model)
{
throw new NotImplementedException();
}
public List<ClientViewModel> GetFullList()
{
throw new NotImplementedException();
}
public ClientViewModel Insert(ClientBindingModel model)
{
throw new NotImplementedException();
}
public ClientViewModel Update(ClientBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,111 @@
using System.ComponentModel;
using System.Reflection;
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
using BeautySalonDatabaseImplement.Models;
using BeautySalonListImplement;
namespace BeautySalonDatabaseImplement.Implements
{
public class CosmeticStorage : ICosmeticStorage
{
private readonly DataListSingleton _source;
public CosmeticStorage()
{
_source = DataListSingleton.GetInstance();
}
public List<CosmeticViewModel> GetFilteredList(CosmeticSearchModel model)
{
var result = new List<CosmeticViewModel>();
if (string.IsNullOrEmpty(model.Name))
{
return result;
}
foreach (var cosmetic in _source.Cosmetics)
{
if (cosmetic.Name.Contains(model.Name))
{
result.Add(cosmetic.GetViewModel);
}
}
return result;
}
public List<CosmeticViewModel> GetFullList()
{
var result = new List<CosmeticViewModel>();
foreach (var cosmetic in _source.Cosmetics)
{
result.Add(cosmetic.GetViewModel);
}
return result;
}
public CosmeticViewModel? GetElement(CosmeticSearchModel model)
{
if (string.IsNullOrEmpty(model.Name) && !model.Id.HasValue)
{
return null;
}
foreach(var cosmetic in _source.Cosmetics)
{
if ((!string.IsNullOrEmpty(model.Name) && cosmetic.Name == model.Name) || (cosmetic.Id == model.Id && model.Id.HasValue))
{
return cosmetic.GetViewModel;
}
}
return null;
}
public CosmeticViewModel? Insert(CosmeticBindingModel model)
{
model.Id = 1;
foreach (var cosmetic in _source.Cosmetics)
{
if (model.Id == cosmetic.Id)
{
model.Id = cosmetic.Id + 1;
}
}
var newCosmetic = Cosmetic.Create(model);
if (newCosmetic == null)
{
return null;
}
_source.Cosmetics.Add(newCosmetic);
return newCosmetic.GetViewModel;
}
public CosmeticViewModel? Update(CosmeticBindingModel model)
{
foreach (var cosmetic in _source.Cosmetics)
{
if (cosmetic.Id == model.Id)
{
cosmetic.Update(model);
return cosmetic.GetViewModel;
}
}
return null;
}
public CosmeticViewModel? Delete(CosmeticBindingModel model)
{
for (int i = 0; i < _source.Cosmetics.Count; ++i)
{
if (_source.Cosmetics[i].Id == model.Id)
{
var deleted = _source.Cosmetics[i];
_source.Cosmetics.RemoveAt(i);
return deleted.GetViewModel;
}
}
return null;
}
}
}

View File

@ -0,0 +1,40 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Implements
{
internal class DistributionStorage : IDistributionStorage
{
public DistributionViewModel Delete(DistributionBindingModel model)
{
throw new NotImplementedException();
}
public DistributionViewModel GetElement(DistributionSearchModel model)
{
throw new NotImplementedException();
}
public List<DistributionViewModel> GetFilteredList(DistributionSearchModel model)
{
throw new NotImplementedException();
}
public List<DistributionViewModel> GetFullList()
{
throw new NotImplementedException();
}
public DistributionViewModel Insert(DistributionBindingModel model)
{
throw new NotImplementedException();
}
public DistributionViewModel Update(DistributionBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,40 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Implements
{
internal class EmployeeStorage : IEmployeeStorage
{
public EmployeeViewModel Delete(EmployeeBindingModel model)
{
throw new NotImplementedException();
}
public EmployeeViewModel GetElement(EmployeeSearchModel model)
{
throw new NotImplementedException();
}
public List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model)
{
throw new NotImplementedException();
}
public List<EmployeeViewModel> GetFullList()
{
throw new NotImplementedException();
}
public EmployeeViewModel Insert(EmployeeBindingModel model)
{
throw new NotImplementedException();
}
public EmployeeViewModel Update(EmployeeBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,40 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Implements
{
internal class ProcedureStorage : IProcedureStorage
{
public ProcedureViewModel Delete(ProcedureBindingModel model)
{
throw new NotImplementedException();
}
public ProcedureViewModel GetElement(ProcedureSearchModel model)
{
throw new NotImplementedException();
}
public List<ProcedureViewModel> GetFilteredList(ProcedureSearchModel model)
{
throw new NotImplementedException();
}
public List<ProcedureViewModel> GetFullList()
{
throw new NotImplementedException();
}
public ProcedureViewModel Insert(ProcedureBindingModel model)
{
throw new NotImplementedException();
}
public ProcedureViewModel Update(ProcedureBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,40 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Implements
{
internal class PurchaseStorage : IPurchaseStorage
{
public PurchaseViewModel Delete(PurchaseBindingModel model)
{
throw new NotImplementedException();
}
public PurchaseViewModel GetElement(PurchaseSearchModel model)
{
throw new NotImplementedException();
}
public List<PurchaseViewModel> GetFilteredList(PurchaseSearchModel model)
{
throw new NotImplementedException();
}
public List<PurchaseViewModel> GetFullList()
{
throw new NotImplementedException();
}
public PurchaseViewModel Insert(PurchaseBindingModel model)
{
throw new NotImplementedException();
}
public PurchaseViewModel Update(PurchaseBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,40 @@
using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Implements
{
internal class ReceiptStorage : IReceiptStorage
{
public ReceiptViewModel Delete(ReceiptBindingModel model)
{
throw new NotImplementedException();
}
public ReceiptViewModel GetElement(ReceiptSearchModel model)
{
throw new NotImplementedException();
}
public List<ReceiptViewModel> GetFilteredList(ReceiptSearchModel model)
{
throw new NotImplementedException();
}
public List<ReceiptViewModel> GetFullList()
{
throw new NotImplementedException();
}
public ReceiptViewModel Insert(ReceiptBindingModel model)
{
throw new NotImplementedException();
}
public ReceiptViewModel Update(ReceiptBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,41 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.SearchModels;
using BeautySalonContracts.StorageContracts;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Implements
{
internal class VisitStorage : IVisitStorage
{
public VisitViewModel Delete(VisitBindingModel model)
{
throw new NotImplementedException();
}
public VisitViewModel GetElement(VisitSearchModel model)
{
throw new NotImplementedException();
}
public List<VisitViewModel> GetFilteredList(VisitSearchModel model)
{
throw new NotImplementedException();
}
public List<VisitViewModel> GetFullList()
{
throw new NotImplementedException();
}
public VisitViewModel Insert(VisitBindingModel model)
{
throw new NotImplementedException();
}
public VisitViewModel Update(VisitBindingModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,57 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
using System.Diagnostics;
namespace BeautySalonDatabaseImplement.Models
{
internal class Client
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public string Surname { get; private set; } = string.Empty;
public string Login { get; private set; } = string.Empty;
public string Password { get; private set; } = string.Empty;
public string Phone { get; private set; } = string.Empty;
public static Client? Create(ClientBindingModel model)
{
if (model == null)
{
return null;
}
return new Client
{
Id = model.Id,
Name = model.Name,
Surname = model.Surname,
Login = model.Login,
Password = model.Password,
Phone = model.Phone,
};
}
public void Update(ClientBindingModel model)
{
if (model == null)
{
return;
}
Name = model.Name;
Surname = model.Surname;
Login = model.Login;
Password = model.Password;
Phone = model.Phone;
}
public ClientViewModel GetViewModel => new()
{
Id = Id,
Name = Name,
Surname = Surname,
Login = Login,
Password = Password,
Phone = Phone
};
}
}

View File

@ -0,0 +1,44 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Models
{
internal class Cosmetic
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public double Price { get; private set; }
public static Cosmetic? Create(CosmeticBindingModel model)
{
if (model == null)
{
return null;
}
return new Cosmetic
{
Id = model.Id,
Name = model.Name,
Price = model.Price
};
}
public void Update(CosmeticBindingModel model)
{
if (model == null)
{
return;
}
Name = model.Name;
Price = model.Price;
}
public CosmeticViewModel GetViewModel => new()
{
Id = Id,
Name = Name,
Price = Price
};
}
}

View File

@ -0,0 +1,45 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
using System.Numerics;
using System.Reflection;
using System.Xml.Linq;
namespace BeautySalonDatabaseImplement.Models
{
internal class Distribution
{
public int Id { get; private set; }
public DateTime Date { get; private set; }
public double Sum { get; private set; }
public static Distribution? Create(DistributionBindingModel model)
{
if (model == null)
{
return null;
}
return new Distribution
{
Id = model.Id,
Date = model.Date,
Sum = model.Sum
};
}
public void Update(DistributionBindingModel model)
{
if (model == null)
{
return;
}
Date = model.Date;
Sum = model.Sum;
}
public DistributionViewModel GetViewModel => new()
{
Id = Id,
Date = Date,
Sum = Sum
};
}
}

View File

@ -0,0 +1,55 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Models
{
internal class Employee
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public string Surname { get; private set; } = string.Empty;
public string Login { get; private set; } = string.Empty;
public string Password { get; private set; } = string.Empty;
public string Phone { get; private set; } = string.Empty;
public static Employee? Create(EmployeeBindingModel model)
{
if (model == null)
{
return null;
}
return new Employee
{
Id = model.Id,
Name = model.Name,
Surname = model.Surname,
Login = model.Login,
Password = model.Password,
Phone = model.Phone,
};
}
public void Update(EmployeeBindingModel model)
{
if (model == null)
{
return;
}
Name = model.Name;
Surname = model.Surname;
Login = model.Login;
Password = model.Password;
Phone = model.Phone;
}
public EmployeeViewModel GetViewModel => new()
{
Id = Id,
Name = Name,
Surname = Surname,
Login = Login,
Password = Password,
Phone = Phone
};
}
}

View File

@ -0,0 +1,48 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
using System.Reflection;
namespace BeautySalonDatabaseImplement.Models
{
internal class Procedure
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public double Price { get; private set; }
public string FIO_Master { get; private set; } = string.Empty;
public static Procedure? Create(ProcedureBindingModel model)
{
if (model == null)
{
return null;
}
return new Procedure
{
Id = model.Id,
Name = model.Name,
Price = model.Price,
FIO_Master = model.FIO_Master
};
}
public void Update(ProcedureBindingModel model)
{
if (model == null)
{
return;
}
Name = model.Name;
Price = model.Price;
FIO_Master = model.FIO_Master;
}
public ProcedureViewModel GetViewModel => new()
{
Id = Id,
Name = Name,
Price = Price,
FIO_Master = FIO_Master
};
}
}

View File

@ -0,0 +1,42 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Models
{
internal class Purchase
{
public int Id { get; private set; }
public DateTime Date { get; private set; }
public double Sum { get; private set; }
public static Purchase? Create(PurchaseBindingModel model)
{
if (model == null)
{
return null;
}
return new Purchase
{
Id = model.Id,
Date = model.Date,
Sum = model.Sum
};
}
public void Update(PurchaseBindingModel model)
{
if (model == null)
{
return;
}
Date = model.Date;
Sum = model.Sum;
}
public PurchaseViewModel GetViewModel => new()
{
Id = Id,
Date = Date,
Sum = Sum
};
}
}

View File

@ -0,0 +1,42 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Models
{
internal class Receipt
{
public int Id { get; private set; }
public DateTime Date { get; private set; }
public double Sum { get; private set; }
public static Receipt? Create(ReceiptBindingModel model)
{
if (model == null)
{
return null;
}
return new Receipt
{
Id = model.Id,
Date = model.Date,
Sum = model.Sum
};
}
public void Update(ReceiptBindingModel model)
{
if (model == null)
{
return;
}
Date = model.Date;
Sum = model.Sum;
}
public ReceiptViewModel GetViewModel => new()
{
Id = Id,
Date = Date,
Sum = Sum
};
}
}

View File

@ -0,0 +1,43 @@

using BeautySalonContracts.BindingModels;
using BeautySalonContracts.ViewModels;
namespace BeautySalonDatabaseImplement.Models
{
internal class Visit
{
public int Id { get; private set; }
public DateTime Date { get; private set; }
public double Sum { get; private set; }
public static Visit? Create(VisitBindingModel model)
{
if (model == null)
{
return null;
}
return new Visit
{
Id = model.Id,
Date = model.Date,
Sum = model.Sum
};
}
public void Update(VisitBindingModel model)
{
if (model == null)
{
return;
}
Date = model.Date;
Sum = model.Sum;
}
public VisitViewModel GetViewModel => new()
{
Id = Id,
Date = Date,
Sum = Sum
};
}
}

View File

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,39 @@
namespace BeautySalonView
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@ -0,0 +1,10 @@
namespace BeautySalonView
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,17 @@
namespace BeautySalonView
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
}