diff --git a/BeautySalon/BeautySalonContracts/BindingModels/ClientBindingModel.cs b/BeautySalon/BeautySalonContracts/BindingModels/ClientBindingModel.cs index 4e784db..132da33 100644 --- a/BeautySalon/BeautySalonContracts/BindingModels/ClientBindingModel.cs +++ b/BeautySalon/BeautySalonContracts/BindingModels/ClientBindingModel.cs @@ -4,10 +4,10 @@ namespace BeautySalonContracts.BindingModels public class ClientBindingModel { public int Id { get; set; } - public string? Name { get; set; } - public string? Surname { get; set; } - public string? Login { get; set; } - public string? Password { get; set; } - public string? Phone { 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; + } } diff --git a/BeautySalon/BeautySalonContracts/BindingModels/CosmeticBindingModel.cs b/BeautySalon/BeautySalonContracts/BindingModels/CosmeticBindingModel.cs index e23afec..f245b70 100644 --- a/BeautySalon/BeautySalonContracts/BindingModels/CosmeticBindingModel.cs +++ b/BeautySalon/BeautySalonContracts/BindingModels/CosmeticBindingModel.cs @@ -4,7 +4,7 @@ namespace BeautySalonContracts.BindingModels public class CosmeticBindingModel { public int Id { get; set; } - public string? Name { get; set; } - public double Price { get; set; } + public string Name { get; set; } = string.Empty; + public double Price { get; set; } } } diff --git a/BeautySalon/BeautySalonContracts/BindingModels/EmployeeBindingModel.cs b/BeautySalon/BeautySalonContracts/BindingModels/EmployeeBindingModel.cs index 248e9a7..f724bf7 100644 --- a/BeautySalon/BeautySalonContracts/BindingModels/EmployeeBindingModel.cs +++ b/BeautySalon/BeautySalonContracts/BindingModels/EmployeeBindingModel.cs @@ -5,10 +5,10 @@ namespace BeautySalonContracts.BindingModels public class EmployeeBindingModel { public int Id { get; set; } - public string? Name { get; set; } - public string? Surname { get; set; } - public string? Login { get; set; } - public string? Password { get; set; } - public string? Phone { 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; + } } diff --git a/BeautySalon/BeautySalonContracts/BindingModels/ProcedureBindingModel.cs b/BeautySalon/BeautySalonContracts/BindingModels/ProcedureBindingModel.cs index 07f881d..9f03e50 100644 --- a/BeautySalon/BeautySalonContracts/BindingModels/ProcedureBindingModel.cs +++ b/BeautySalon/BeautySalonContracts/BindingModels/ProcedureBindingModel.cs @@ -4,8 +4,8 @@ namespace BeautySalonContracts.BindingModels public class ProcedureBindingModel { public int Id { get; set; } - public string? Name { get; set; } - public double Price { get; set; } - public string? FIO_Master { get; set; } - } + public string Name { get; set; } = string.Empty; + public double Price { get; set; } + public string FIO_Master { get; set; } = string.Empty; + } } diff --git a/BeautySalon/BeautySalonContracts/SearchModels/ClientSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..2bc779a --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,9 @@ + +namespace BeautySalonContracts.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + public string? Login { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/SearchModels/CosmeticSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/CosmeticSearchModel.cs new file mode 100644 index 0000000..28193dd --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/CosmeticSearchModel.cs @@ -0,0 +1,9 @@ + +namespace BeautySalonContracts.SearchModels +{ + public class CosmeticSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/SearchModels/DistributionSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/DistributionSearchModel.cs new file mode 100644 index 0000000..dc8a58c --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/DistributionSearchModel.cs @@ -0,0 +1,8 @@ + +namespace BeautySalonContracts.SearchModels +{ + public class DistributionSearchModel + { + public int? Id { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/SearchModels/EmployeeSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/EmployeeSearchModel.cs new file mode 100644 index 0000000..2052cef --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/EmployeeSearchModel.cs @@ -0,0 +1,10 @@ + + +namespace BeautySalonContracts.SearchModels +{ + public class EmployeeSearchModel + { + public int? Id { get; set; } + public string? Login { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/SearchModels/ProcedureSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/ProcedureSearchModel.cs new file mode 100644 index 0000000..bc66795 --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/ProcedureSearchModel.cs @@ -0,0 +1,9 @@ + +namespace BeautySalonContracts.SearchModels +{ + public class ProcedureSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/SearchModels/PurchaseSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/PurchaseSearchModel.cs new file mode 100644 index 0000000..e07d365 --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/PurchaseSearchModel.cs @@ -0,0 +1,8 @@ + +namespace BeautySalonContracts.SearchModels +{ + public class PurchaseSearchModel + { + public int? Id { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/SearchModels/ReceiptSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/ReceiptSearchModel.cs new file mode 100644 index 0000000..82596b7 --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/ReceiptSearchModel.cs @@ -0,0 +1,8 @@ + +namespace BeautySalonContracts.SearchModels +{ + public class ReceiptSearchModel + { + public int? Id { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/SearchModels/VisitSearchModel.cs b/BeautySalon/BeautySalonContracts/SearchModels/VisitSearchModel.cs new file mode 100644 index 0000000..c0ddcda --- /dev/null +++ b/BeautySalon/BeautySalonContracts/SearchModels/VisitSearchModel.cs @@ -0,0 +1,8 @@ + +namespace BeautySalonContracts.SearchModels +{ + public class VisitSearchModel + { + public int? Id { get; set; } + } +} diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/IClientStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/IClientStorage.cs index 1e32c9a..ac8083b 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/IClientStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/IClientStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; namespace BeautySalonContracts.StorageContracts @@ -6,8 +7,8 @@ namespace BeautySalonContracts.StorageContracts public interface IClientStorage { List GetFullList(); - List GetFilteredList(ClientBindingModel model); - ClientViewModel GetElement(ClientBindingModel model); + List GetFilteredList(ClientSearchModel model); + ClientViewModel GetElement(ClientSearchModel model); ClientViewModel Insert(ClientBindingModel model); ClientViewModel Update(ClientBindingModel model); ClientViewModel Deleted(ClientBindingModel model); diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/ICosmeticStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/ICosmeticStorage.cs index 5e84853..3f3a45e 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/ICosmeticStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/ICosmeticStorage.cs @@ -1,5 +1,6 @@  using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; @@ -8,11 +9,11 @@ namespace BeautySalonContracts.StorageContracts public interface ICosmeticStorage { List GetFullList(); - List GetFilteredList(CosmeticBindingModel model); - CosmeticViewModel GetElement(CosmeticBindingModel model); - CosmeticViewModel Insert(CosmeticBindingModel model); - CosmeticViewModel Update(CosmeticBindingModel model); - CosmeticViewModel Deleted(CosmeticBindingModel model); + List GetFilteredList(CosmeticSearchModel model); + CosmeticViewModel? GetElement(CosmeticSearchModel model); + CosmeticViewModel? Insert(CosmeticBindingModel model); + CosmeticViewModel? Update(CosmeticBindingModel model); + CosmeticViewModel? Deleted(CosmeticBindingModel model); } } diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/IDistributionStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/IDistributionStorage.cs index 8b80bad..e02772a 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/IDistributionStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/IDistributionStorage.cs @@ -1,5 +1,6 @@  using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; namespace BeautySalonContracts.StorageContracts @@ -7,8 +8,8 @@ namespace BeautySalonContracts.StorageContracts public interface IDistributionStorage { List GetFullList(); - List GetFilteredList(DistributionBindingModel model); - DistributionViewModel GetElement(DistributionBindingModel model); + List GetFilteredList(DistributionSearchModel model); + DistributionViewModel GetElement(DistributionSearchModel model); DistributionViewModel Insert(DistributionBindingModel model); DistributionViewModel Update(DistributionBindingModel model); DistributionViewModel Deleted(DistributionBindingModel model); diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/IEmployeeStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/IEmployeeStorage.cs index f0b43c5..ed1f69a 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/IEmployeeStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/IEmployeeStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; namespace BeautySalonContracts.StorageContracts @@ -6,8 +7,8 @@ namespace BeautySalonContracts.StorageContracts public interface IEmployeeStorage { List GetFullList(); - List GetFilteredList(EmployeeBindingModel model); - EmployeeViewModel GetElement(EmployeeBindingModel model); + List GetFilteredList(EmployeeSearchModel model); + EmployeeViewModel GetElement(EmployeeSearchModel model); EmployeeViewModel Insert(EmployeeBindingModel model); EmployeeViewModel Update(EmployeeBindingModel model); EmployeeViewModel Deleted(EmployeeBindingModel model); diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/IProcedureStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/IProcedureStorage.cs index 6b74927..732a8e8 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/IProcedureStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/IProcedureStorage.cs @@ -1,12 +1,13 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; namespace BeautySalonContracts.StorageContracts { public interface IProcedureStorage { List GetFullList(); - List GetFilteredList(ProcedureBindingModel model); - ProcedureViewModel GetElement(ProcedureBindingModel model); + List GetFilteredList(ProcedureSearchModel model); + ProcedureViewModel GetElement(ProcedureSearchModel model); ProcedureViewModel Insert(ProcedureBindingModel model); ProcedureViewModel Update(ProcedureBindingModel model); ProcedureViewModel Deleted(ProcedureBindingModel model); diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/IPurchaseStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/IPurchaseStorage.cs index e5a28c8..155ad33 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/IPurchaseStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/IPurchaseStorage.cs @@ -1,5 +1,6 @@  using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; namespace BeautySalonContracts.StorageContracts @@ -7,8 +8,8 @@ namespace BeautySalonContracts.StorageContracts public interface IPurchaseStorage { List GetFullList(); - List GetFilteredList(PurchaseBindingModel model); - PurchaseViewModel GetElement(PurchaseBindingModel model); + List GetFilteredList(PurchaseSearchModel model); + PurchaseViewModel GetElement(PurchaseSearchModel model); PurchaseViewModel Insert(PurchaseBindingModel model); PurchaseViewModel Update(PurchaseBindingModel model); PurchaseViewModel Deleted(PurchaseBindingModel model); diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/IReceiptStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/IReceiptStorage.cs index 095c0a3..5e9e421 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/IReceiptStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/IReceiptStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; namespace BeautySalonContracts.StorageContracts @@ -6,8 +7,8 @@ namespace BeautySalonContracts.StorageContracts public interface IReceiptStorage { List GetFullList(); - List GetFilteredList(ReceiptBindingModel model); - ReceiptViewModel GetElement(ReceiptBindingModel model); + List GetFilteredList(ReceiptSearchModel model); + ReceiptViewModel GetElement(ReceiptSearchModel model); ReceiptViewModel Insert(ReceiptBindingModel model); ReceiptViewModel Update(ReceiptBindingModel model); ReceiptViewModel Deleted(ReceiptBindingModel model); diff --git a/BeautySalon/BeautySalonContracts/StorageContracts/IVisitStorage.cs b/BeautySalon/BeautySalonContracts/StorageContracts/IVisitStorage.cs index 1f6003b..d27bd8e 100644 --- a/BeautySalon/BeautySalonContracts/StorageContracts/IVisitStorage.cs +++ b/BeautySalon/BeautySalonContracts/StorageContracts/IVisitStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.ViewModels; namespace BeautySalonContracts.StorageContracts @@ -6,8 +7,8 @@ namespace BeautySalonContracts.StorageContracts public interface IVisitStorage { List GetFullList(); - List GetFilteredList(VisitBindingModel model); - VisitViewModel GetElement(VisitBindingModel model); + List GetFilteredList(VisitSearchModel model); + VisitViewModel GetElement(VisitSearchModel model); VisitViewModel Insert(VisitBindingModel model); VisitViewModel Update(VisitBindingModel model); VisitViewModel Deleted(VisitBindingModel model); diff --git a/BeautySalon/BeautySalonContracts/ViewModels/ClientViewModel.cs b/BeautySalon/BeautySalonContracts/ViewModels/ClientViewModel.cs index f803782..bace581 100644 --- a/BeautySalon/BeautySalonContracts/ViewModels/ClientViewModel.cs +++ b/BeautySalon/BeautySalonContracts/ViewModels/ClientViewModel.cs @@ -7,14 +7,14 @@ namespace BeautySalonContracts.ViewModels { public int Id { get; set; } [DisplayName("Имя")] - public string? Name { get; set; } - [DisplayName("Фамилия")] - public string? Surname { get; set; } - [DisplayName("Логин")] - public string? Login { get; set; } - [DisplayName("Пароль")] - public string? Password { get; set; } - [DisplayName("Телефон")] - public string? Phone { get; set; } - } + 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; + } } diff --git a/BeautySalon/BeautySalonContracts/ViewModels/CosmeticViewModel.cs b/BeautySalon/BeautySalonContracts/ViewModels/CosmeticViewModel.cs index e722f81..8d6780e 100644 --- a/BeautySalon/BeautySalonContracts/ViewModels/CosmeticViewModel.cs +++ b/BeautySalon/BeautySalonContracts/ViewModels/CosmeticViewModel.cs @@ -7,8 +7,8 @@ namespace BeautySalonContracts.ViewModels { public int Id { get; set; } [DisplayName("Название")] - public string? Name { get; set; } - [DisplayName("Цена")] + public string Name { get; set; } = string.Empty; + [DisplayName("Цена")] public double Price { get; set; } } } diff --git a/BeautySalon/BeautySalonContracts/ViewModels/EmployeeViewModel.cs b/BeautySalon/BeautySalonContracts/ViewModels/EmployeeViewModel.cs index 3d30db2..5ec87ef 100644 --- a/BeautySalon/BeautySalonContracts/ViewModels/EmployeeViewModel.cs +++ b/BeautySalon/BeautySalonContracts/ViewModels/EmployeeViewModel.cs @@ -8,14 +8,14 @@ namespace BeautySalonContracts.ViewModels { public int Id { get; set; } [DisplayName("Имя")] - public string? Name { get; set; } - [DisplayName("Фамилия")] - public string? Surname { get; set; } - [DisplayName("Логин")] - public string? Login { get; set; } - [DisplayName("Пароль")] - public string? Password { get; set; } - [DisplayName("Телефон")] - public string? Phone { get; set; } - } + 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; + } } diff --git a/BeautySalon/BeautySalonContracts/ViewModels/ProcedureViewModel.cs b/BeautySalon/BeautySalonContracts/ViewModels/ProcedureViewModel.cs index 6479d00..31e1e82 100644 --- a/BeautySalon/BeautySalonContracts/ViewModels/ProcedureViewModel.cs +++ b/BeautySalon/BeautySalonContracts/ViewModels/ProcedureViewModel.cs @@ -7,10 +7,10 @@ namespace BeautySalonContracts.ViewModels { public int Id { get; set; } [DisplayName("Название")] - public string? Name { get; set; } - [DisplayName("Цена")] + public string Name { get; set; } = string.Empty; + [DisplayName("Цена")] public double Price { get; set; } [DisplayName("ФИО мастера")] - public string? FIO_Master { get; set; } - } + public string FIO_Master { get; set; } = string.Empty; + } } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/ClientStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/ClientStorage.cs index b7accba..77fb629 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/ClientStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/ClientStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.StorageContracts; using BeautySalonContracts.ViewModels; @@ -12,12 +13,12 @@ namespace BeautySalonDatabaseImplement.Implements throw new NotImplementedException(); } - public ClientViewModel GetElement(ClientBindingModel model) + public ClientViewModel GetElement(ClientSearchModel model) { throw new NotImplementedException(); } - public List GetFilteredList(ClientBindingModel model) + public List GetFilteredList(ClientSearchModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs index 3d6daae..1e773b7 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/CosmeticStorage.cs @@ -1,6 +1,10 @@ -using BeautySalonContracts.BindingModels; +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 @@ -12,33 +16,75 @@ namespace BeautySalonDatabaseImplement.Implements { _source = DataListSingleton.GetInstance(); } - public CosmeticViewModel GetElement(CosmeticBindingModel model) - { + public List GetFilteredList(CosmeticSearchModel model) + { + var result = new List(); + 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 GetFullList() + { + var result = new List(); + + foreach (var cosmetic in _source.Cosmetics) + { + result.Add(cosmetic.GetViewModel); + } + return result; + } + public CosmeticViewModel? GetElement(CosmeticSearchModel model) + { + if (string.IsNullOrEmpty(model.Name)) + { + return null; + } foreach(var cosmetic in _source.Cosmetics) - - } + { + if ((!string.IsNullOrEmpty(model.Name) && cosmetic.Name == model.Name) || (cosmetic.Id == model.Id)) + { + return cosmetic.GetViewModel; + } + } + return null; + } - public List GetFilteredList(CosmeticBindingModel model) + 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 newComponent.GetViewModel; + } + + public CosmeticViewModel? Update(CosmeticBindingModel model) { throw new NotImplementedException(); } - public List GetFullList() - { - throw new NotImplementedException(); - } - - public CosmeticViewModel Insert(CosmeticBindingModel model) - { - throw new NotImplementedException(); - } - - public CosmeticViewModel Update(CosmeticBindingModel model) - { - throw new NotImplementedException(); - } - - public CosmeticViewModel Deleted(CosmeticBindingModel model) + public CosmeticViewModel? Deleted(CosmeticBindingModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/DistributionStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/DistributionStorage.cs index a1a136e..df05a92 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/DistributionStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/DistributionStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.StorageContracts; using BeautySalonContracts.ViewModels; @@ -11,12 +12,12 @@ namespace BeautySalonDatabaseImplement.Implements throw new NotImplementedException(); } - public DistributionViewModel GetElement(DistributionBindingModel model) + public DistributionViewModel GetElement(DistributionSearchModel model) { throw new NotImplementedException(); } - public List GetFilteredList(DistributionBindingModel model) + public List GetFilteredList(DistributionSearchModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/EmployeeStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/EmployeeStorage.cs index 6fa2f02..89ff62a 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/EmployeeStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/EmployeeStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.StorageContracts; using BeautySalonContracts.ViewModels; @@ -11,12 +12,12 @@ namespace BeautySalonDatabaseImplement.Implements throw new NotImplementedException(); } - public EmployeeViewModel GetElement(EmployeeBindingModel model) + public EmployeeViewModel GetElement(EmployeeSearchModel model) { throw new NotImplementedException(); } - public List GetFilteredList(EmployeeBindingModel model) + public List GetFilteredList(EmployeeSearchModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/ProcedureStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/ProcedureStorage.cs index b248a75..5fbdd69 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/ProcedureStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/ProcedureStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.StorageContracts; using BeautySalonContracts.ViewModels; @@ -9,14 +10,14 @@ namespace BeautySalonDatabaseImplement.Implements public ProcedureViewModel Deleted(ProcedureBindingModel model) { throw new NotImplementedException(); - } + } - public ProcedureViewModel GetElement(ProcedureBindingModel model) + public ProcedureViewModel GetElement(ProcedureSearchModel model) { throw new NotImplementedException(); } - public List GetFilteredList(ProcedureBindingModel model) + public List GetFilteredList(ProcedureSearchModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/PurchaseStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/PurchaseStorage.cs index 599042d..aafe14d 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/PurchaseStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/PurchaseStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.StorageContracts; using BeautySalonContracts.ViewModels; @@ -11,12 +12,12 @@ namespace BeautySalonDatabaseImplement.Implements throw new NotImplementedException(); } - public PurchaseViewModel GetElement(PurchaseBindingModel model) + public PurchaseViewModel GetElement(PurchaseSearchModel model) { throw new NotImplementedException(); } - public List GetFilteredList(PurchaseBindingModel model) + public List GetFilteredList(PurchaseSearchModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/ReceiptStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/ReceiptStorage.cs index 04aee07..a837f69 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/ReceiptStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/ReceiptStorage.cs @@ -1,4 +1,5 @@ using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.StorageContracts; using BeautySalonContracts.ViewModels; @@ -11,12 +12,12 @@ namespace BeautySalonDatabaseImplement.Implements throw new NotImplementedException(); } - public ReceiptViewModel GetElement(ReceiptBindingModel model) + public ReceiptViewModel GetElement(ReceiptSearchModel model) { throw new NotImplementedException(); } - public List GetFilteredList(ReceiptBindingModel model) + public List GetFilteredList(ReceiptSearchModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Implements/VisitStorage.cs b/BeautySalon/BeautySalonDatabaseImplement/Implements/VisitStorage.cs index 03f5d0c..c16a0d3 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Implements/VisitStorage.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Implements/VisitStorage.cs @@ -1,5 +1,6 @@  using BeautySalonContracts.BindingModels; +using BeautySalonContracts.SearchModels; using BeautySalonContracts.StorageContracts; using BeautySalonContracts.ViewModels; @@ -12,12 +13,12 @@ namespace BeautySalonDatabaseImplement.Implements throw new NotImplementedException(); } - public VisitViewModel GetElement(VisitBindingModel model) + public VisitViewModel GetElement(VisitSearchModel model) { throw new NotImplementedException(); } - public List GetFilteredList(VisitBindingModel model) + public List GetFilteredList(VisitSearchModel model) { throw new NotImplementedException(); } diff --git a/BeautySalon/BeautySalonDatabaseImplement/Models/Client.cs b/BeautySalon/BeautySalonDatabaseImplement/Models/Client.cs index e10acd9..b39eb09 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Models/Client.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Models/Client.cs @@ -8,13 +8,13 @@ namespace BeautySalonDatabaseImplement.Models public class Client { public int Id { get; set; } - public string? Name { get; set; } - public string? Surname { get; set; } - public string? Login { get; set; } - public string? Password { get; set; } - public string? Phone { 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; - public static Client? Create(ClientBindingModel model) + public static Client? Create(ClientBindingModel model) { if (model == null) { diff --git a/BeautySalon/BeautySalonDatabaseImplement/Models/Cosmetic.cs b/BeautySalon/BeautySalonDatabaseImplement/Models/Cosmetic.cs index 017d16a..16c04bb 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Models/Cosmetic.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Models/Cosmetic.cs @@ -7,8 +7,8 @@ namespace BeautySalonDatabaseImplement.Models public class Cosmetic { public int Id { get; set; } - public string? Name { get; set; } - public double Price { get; set; } + public string Name { get; set; } = string.Empty; + public double Price { get; set; } public static Cosmetic? Create(CosmeticBindingModel model) { diff --git a/BeautySalon/BeautySalonDatabaseImplement/Models/Employee.cs b/BeautySalon/BeautySalonDatabaseImplement/Models/Employee.cs index 4272280..e3905b2 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Models/Employee.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Models/Employee.cs @@ -7,12 +7,12 @@ namespace BeautySalonDatabaseImplement.Models public class Employee { public int Id { get; set; } - public string? Name { get; set; } - public string? Surname { get; set; } - public string? Login { get; set; } - public string? Password { get; set; } - public string? Phone { get; set; } - public static Employee? Create(EmployeeBindingModel model) + 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; + public static Employee? Create(EmployeeBindingModel model) { if (model == null) { diff --git a/BeautySalon/BeautySalonDatabaseImplement/Models/Procedure.cs b/BeautySalon/BeautySalonDatabaseImplement/Models/Procedure.cs index 766ceed..1e62e16 100644 --- a/BeautySalon/BeautySalonDatabaseImplement/Models/Procedure.cs +++ b/BeautySalon/BeautySalonDatabaseImplement/Models/Procedure.cs @@ -8,10 +8,10 @@ namespace BeautySalonDatabaseImplement.Models public class Procedure { public int Id { get; set; } - public string? Name { get; set; } - public double Price { get; set; } - public string? FIO_Master { get; set; } - public static Procedure? Create(ProcedureBindingModel model) + public string Name { get; set; } = string.Empty; + public double Price { get; set; } + public string FIO_Master { get; set; } = string.Empty; + public static Procedure? Create(ProcedureBindingModel model) { if (model == null) {