From 7c2da1ba42d48599baee6fd00d67bafe61d69eae Mon Sep 17 00:00:00 2001 From: K Date: Wed, 29 May 2024 16:37:52 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D1=8B=D1=80=D0=BE=D0=BA=20=D1=81=D1=8B?= =?UTF-8?q?=D1=80=D0=BE=D1=87=D0=B5=D0=BA=20=D1=87=D1=82=D0=BE=20=D0=B6?= =?UTF-8?q?=D0=B5=20=D1=81=20=D1=82=D0=BE=D0=B1=D0=BE=D0=B9=20=D1=81=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D0=B0=D0=BB=D0=B8..............?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/ClientLogic.cs | 7 +- .../BusinessLogic/OrderLogic.cs | 126 +++++++++++++----- .../OfficePackage/HelperModels/ExcelInfo.cs | 3 +- .../OfficePackage/HelperModels/PdfInfo.cs | 1 + .../BusinessLogicContracts/IReportLogic.cs | 3 - .../ViewModels/ClientViewModel.cs | 2 - .../ViewModels/ProcedureViewModel.cs | 4 +- .../Models/IProcedureModel.cs | 2 +- .../Implements/ClientStorage.cs | 75 +++++------ .../Models/Client.cs | 11 +- .../Models/CosmeticProcedure.cs | 2 +- .../Models/Evaluation.cs | 5 +- .../Models/Procedure.cs | 33 ++--- 13 files changed, 157 insertions(+), 117 deletions(-) diff --git a/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/ClientLogic.cs b/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/ClientLogic.cs index d62b299..e668fd1 100644 --- a/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/ClientLogic.cs +++ b/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/ClientLogic.cs @@ -4,6 +4,7 @@ using BeautySalonContracts.SearchModels; using BeautySalonContracts.StoragesContracts; using BeautySalonContracts.ViewModels; using Microsoft.Extensions.Logging; +using System.Text.RegularExpressions; namespace BeautySalonBusinessLogic.BusinessLogics { @@ -126,10 +127,10 @@ namespace BeautySalonBusinessLogic.BusinessLogics { throw new ArgumentNullException("Нет телефона клиента", nameof(model.ClientEmail)); } - if (string.IsNullOrEmpty(model.ClientEmail)) + if (!Regex.IsMatch(model.ClientEmail, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$")) { - throw new ArgumentNullException("Нет почты клиента", nameof(model.ClientEmail)); - } + throw new ArgumentException("Некорретно введенный email", nameof(model.ClientEmail)); + } if (string.IsNullOrEmpty(model.ClientPassword)) { throw new ArgumentNullException("Нет пароля", nameof(model.ClientPassword)); diff --git a/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/OrderLogic.cs b/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/OrderLogic.cs index 38611b2..2ff163e 100644 --- a/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/OrderLogic.cs +++ b/BeautySalonView/BeautySalonBusinessLogic/BusinessLogic/OrderLogic.cs @@ -1,8 +1,10 @@ -using BeautySalonContracts.BindingModels; +using BeautySalonBusinessLogic.MailWorker; +using BeautySalonContracts.BindingModels; using BeautySalonContracts.BusinessLogicContracts; using BeautySalonContracts.SearchModels; using BeautySalonContracts.StoragesContracts; using BeautySalonContracts.ViewModels; +using BeautySalonDataModels.Enums; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -16,71 +18,107 @@ namespace BeautySalonBusinessLogic.BusinessLogics { private readonly ILogger _logger; private readonly IOrderStorage _orderStorage; - public OrderLogic(ILogger logger, IOrderStorage orderStorage) + private readonly AbstractMailWorker _mailWorker; + private readonly IClientLogic _clientLogic; + public OrderLogic(ILogger logger, IOrderStorage orderStorage, AbstractMailWorker mailWorker, IClientLogic clientLogic) { _logger = logger; _orderStorage = orderStorage; + _mailWorker = mailWorker; + _clientLogic = clientLogic; } - public List? ReadList(OrderSearchModel? model) - { - _logger.LogInformation("Order. OrderID:{Id}", model?.Id); - var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model); - if (list == null) - { - _logger.LogWarning("ReadList return null list"); - return null; - } - _logger.LogInformation("ReadList. Count:{Count}", list.Count); - return list; - } - public OrderViewModel? ReadElement(OrderSearchModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } - _logger.LogInformation("ReadElement. OrderDate: {OrderDate}. Id: {Id}", - model.OrderDate, model.Id); + _logger.LogInformation("ReadElement. DateFrom:{DateFrom}. DateTo:{DateTo}. Id:{Id}", model.DateFrom, model.DateTo, model.Id); var element = _orderStorage.GetElement(model); if (element == null) { _logger.LogWarning("ReadElement element not found"); return null; } - _logger.LogInformation("ReadElement find. Id: {Id}", element.Id); + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); return element; } - public bool Create(OrderBindingModel model) + public List? ReadList(OrderSearchModel? model) + { + _logger.LogInformation("ReadList. Id: {Id}", model?.Id); + var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count: {Count}", list.Count); + return list; + } + public bool CreateOrder(OrderBindingModel model) { CheckModel(model); - if (_orderStorage.Insert(model) == null) + if (model.Status != OrderStatus.Неизвестен) { + _logger.LogWarning("Invalid order status"); + return false; + } + model.Status = OrderStatus.Принят; + var result = _orderStorage.Insert(model); + if (result == null) + { + model.Status = OrderStatus.Неизвестен; _logger.LogWarning("Insert operation failed"); return false; } + SendOrderStatusMail(result.ClientId, $"Новый заказ создан. Номер заказа #{result.Id}", $"Заказ #{result.Id} от {result.DateCreate} на сумму {result.OrderAmount:0.00} принят"); return true; } - public bool Update(OrderBindingModel model) + private bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus) { - CheckModel(model); - if (_orderStorage.Update(model) == null) + var viewModel = _orderStorage.GetElement(new OrderSearchModel { Id = model.Id }); + if (viewModel == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (viewModel.Status + 1 != newStatus) + { + _logger.LogWarning("Change status operation failed"); + throw new InvalidOperationException(); + } + model.Status = newStatus; + if (model.Status == OrderStatus.Готов) + { + model.DateImplement = DateTime.Now; + } + else + { + model.DateImplement = viewModel.DateImplement; + } + CheckModel(model, false); + var result = _orderStorage.Update(model); + if (result == null) { _logger.LogWarning("Update operation failed"); return false; } + //Отсылка письма при изменении статуса + SendOrderStatusMail(result.ClientId, $"Изменен статус заказа #{result.Id}", $"Заказ #{model.Id} изменен статус на {result.Status}"); return true; } - public bool Delete(OrderBindingModel model) + public bool TakeOrderInWork(OrderBindingModel model) { - CheckModel(model, false); - _logger.LogInformation("Delete. Id: {Id}", model.Id); - if (_orderStorage.Delete(model) == null) - { - _logger.LogWarning("Delete operation failed"); - return false; - } - return true; + return StatusUpdate(model, OrderStatus.Выполняется); + } + public bool FinishOrder(OrderBindingModel model) + { + model.DateImplement = DateTime.Now; + return StatusUpdate(model, OrderStatus.Готов); + } + public bool DeliveryOrder(OrderBindingModel model) + { + + return StatusUpdate(model, OrderStatus.Выдан); } private void CheckModel(OrderBindingModel model, bool withParams = true) { @@ -94,9 +132,29 @@ namespace BeautySalonBusinessLogic.BusinessLogics } if (model.OrderAmount <= 0) { - throw new ArgumentNullException("Cумма заказа должна быть больше 0", - nameof(model.OrderAmount)); + throw new ArgumentNullException("Стоимость должна быть больше 0", nameof(model.OrderAmount)); } + _logger.LogInformation("Order. Id: {Id}. Sum: {Sum}.", model.Id, model.OrderAmount); + var element = _orderStorage.GetElement(new OrderSearchModel { Id = model.Id }); + if (element != null && element.Id == model.Id) + { + throw new InvalidOperationException("Заказ с таким номером уже есть"); + } + } + private bool SendOrderStatusMail(int clientId, string subject, string text) + { + var client = _clientLogic.ReadElement(new() { Id = clientId }); + if (client == null) + { + return false; + } + _mailWorker.MailSendAsync(new() + { + MailAddress = client.Email, + Subject = subject, + Text = text + }); + return true; } } } diff --git a/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs index 47e064f..5c76286 100644 --- a/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs +++ b/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs @@ -11,6 +11,7 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage.HelperModels { public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; - public List ReinforcedComponents { get; set; } = new(); + public List CosmeticProcedures { get; set; } = new(); + public List ProcedureCosmetics { get; set; } = new(); } } diff --git a/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs b/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs index a67ae02..fdb6cbf 100644 --- a/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs +++ b/BeautySalonView/BeautySalonBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs @@ -14,5 +14,6 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage.HelperModels public DateTime DateFrom { get; set; } public DateTime DateTo { get; set; } public List Orders { get; set; } = new(); + public List Services { get; set; } = new(); } } diff --git a/BeautySalonView/BeautySalonContracts/BusinessLogicContracts/IReportLogic.cs b/BeautySalonView/BeautySalonContracts/BusinessLogicContracts/IReportLogic.cs index a5a3916..18c9159 100644 --- a/BeautySalonView/BeautySalonContracts/BusinessLogicContracts/IReportLogic.cs +++ b/BeautySalonView/BeautySalonContracts/BusinessLogicContracts/IReportLogic.cs @@ -22,9 +22,6 @@ namespace BeautySalonContracts.BusinessLogicsContracts // Получение списка заказов за определенный период List GetOrders(ReportBindingModel model); - // Сохранение компонент в файл-Word - void SaveCosmeticsToWordFile(ReportBindingModel model); - // Сохранение процедур по косметике в файл-Word void SaveCosmeticProceduresToWordFile(ReportBindingModel model); // Сохранение косметики по процедурам в файл-Word diff --git a/BeautySalonView/BeautySalonContracts/ViewModels/ClientViewModel.cs b/BeautySalonView/BeautySalonContracts/ViewModels/ClientViewModel.cs index 25ad0f2..a24f7f1 100644 --- a/BeautySalonView/BeautySalonContracts/ViewModels/ClientViewModel.cs +++ b/BeautySalonView/BeautySalonContracts/ViewModels/ClientViewModel.cs @@ -23,8 +23,6 @@ namespace BeautySalonContracts.ViewModels [DisplayName("Почта клиента")] public string ClientEmail { get; set; } = string.Empty; - - [DisplayName("Пароль клиента")] public string ClientPassword { get; set; } = string.Empty; diff --git a/BeautySalonView/BeautySalonContracts/ViewModels/ProcedureViewModel.cs b/BeautySalonView/BeautySalonContracts/ViewModels/ProcedureViewModel.cs index 8b837c7..77d1741 100644 --- a/BeautySalonView/BeautySalonContracts/ViewModels/ProcedureViewModel.cs +++ b/BeautySalonView/BeautySalonContracts/ViewModels/ProcedureViewModel.cs @@ -22,12 +22,10 @@ namespace BeautySalonContracts.ViewModels public double ProcedureDuration { get; set; } public int ClientId { get; set; } - public Dictionary CosmeticProcedures + public Dictionary ProcedureCosmetics { get; set; } = new(); - //public List OrderProcedures { get; set; } = new(); - //public List ServiceProcedure { get; set; } = new(); } } diff --git a/BeautySalonView/BeautySalonDataModels/Models/IProcedureModel.cs b/BeautySalonView/BeautySalonDataModels/Models/IProcedureModel.cs index d63b7ed..0bc09cb 100644 --- a/BeautySalonView/BeautySalonDataModels/Models/IProcedureModel.cs +++ b/BeautySalonView/BeautySalonDataModels/Models/IProcedureModel.cs @@ -8,6 +8,6 @@ namespace BeautySalonDataModels.Models double ProcedurePrice { get; } double ProcedureDuration { get; } int ClientId { get; } - + Dictionary ProcedureCosmetics { get; } //список косметики "участвующей" в заказе } } diff --git a/BeautySalonView/BeautySalonDatabaseImplement/Implements/ClientStorage.cs b/BeautySalonView/BeautySalonDatabaseImplement/Implements/ClientStorage.cs index 4feeb4a..2297f7f 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/Implements/ClientStorage.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/Implements/ClientStorage.cs @@ -24,82 +24,73 @@ namespace BeautySalonDatabaseImplement.Implements return element.GetViewModel; } - - return null; - } - - - public ClientViewModel? GetElement(ClientSearchModel model) - { - using var context = new BeautySalonDatabase(); - if (model.Id.HasValue) - return context.Clients - .FirstOrDefault(x => x.Id == model.Id)? - .GetViewModel; - - if (!string.IsNullOrEmpty(model.ClientLogin) && - !string.IsNullOrEmpty(model.ClientPassword)) - return context.Clients - .FirstOrDefault(x => - x.ClientLogin.Equals(model.ClientLogin) && - x.ClientPassword.Equals(model.ClientPassword))? - .GetViewModel; - - return null; - } - - public List GetFilteredList(ClientSearchModel model) - { - using var context = new BeautySalonDatabase(); if (model.Id.HasValue) { + var res = GetElement(model); + return res != null ? new() { res } : new(); + } + if (!string.IsNullOrEmpty(model.ClientEmail)) + { + using var context = new BeautySalonDatabase(); return context.Clients - .Where(x => x.Id == model.Id) + .Include(x => x.Orders) + .Where(x => x.ClientEmail.Contains(model.ClientEmail)) .Select(x => x.GetViewModel) .ToList(); } return new(); } - - public List GetFullList() + public ClientViewModel? GetElement(ClientSearchModel model) { using var context = new BeautySalonDatabase(); - return context.Clients - .Select(x => x.GetViewModel) - .ToList(); + if (model.Id.HasValue) + return context.Clients.FirstOrDefault(x => x.Id == model.Id)?.GetViewModel; + if (model.ClientEmail != null && model.ClientPassword != null) + return context.Clients.FirstOrDefault(x => x.ClientEmail.Equals(model.ClientEmail) + && x.ClientPassword.Equals(model.ClientPassword)) + ?.GetViewModel; + if (model.ClientEmail != null) + return context.Clients.FirstOrDefault(x => x.ClientEmail.Equals(model.ClientEmail))?.GetViewModel; + return null; } - public ClientViewModel? Insert(ClientBindingModel model) { - using var context = new BeautySalonDatabase(); - var newClient = Client.Create(model); - if (newClient == null) { return null; } + using var context = new BeautySalonDatabase(); context.Clients.Add(newClient); context.SaveChanges(); - return newClient.GetViewModel; } public ClientViewModel? Update(ClientBindingModel model) { using var context = new BeautySalonDatabase(); - var client = context.Clients.FirstOrDefault(x => x.Id == model.Id); - if (client == null) { return null; } - client.Update(model); context.SaveChanges(); - return client.GetViewModel; } + public ClientViewModel? Delete(ClientBindingModel model) + { + using var context = new BeautySalonDatabase(); + var element = context.Clients + .Include(x => x.Orders) + .FirstOrDefault(rec => rec.Id == model.Id); + if (element != null) + { + context.Clients.Remove(element); + context.SaveChanges(); + return element.GetViewModel; + } + return null; + } } } \ No newline at end of file diff --git a/BeautySalonView/BeautySalonDatabaseImplement/Models/Client.cs b/BeautySalonView/BeautySalonDatabaseImplement/Models/Client.cs index 79971dd..8a9ac46 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/Models/Client.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/Models/Client.cs @@ -1,6 +1,7 @@ using BeautySalonContracts.BindingModels; using BeautySalonContracts.ViewModels; using BeautySalonDataModels.Models; +using DocumentFormat.OpenXml.Drawing.Charts; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -20,17 +21,11 @@ namespace BeautySalonDatabaseImplement.Models [Required] public string ClientPhone { get; set; } = string.Empty; [Required] - public string ClientPassword { get; set; } = string.Empty; - [ForeignKey("ClientId")] - public virtual List Evaluations { get; set; } = new(); - + public virtual List Orders { get; set; } = new(); [ForeignKey("ClientId")] - public virtual List Orders { get; set; } = new(); - - [ForeignKey("ClientId")] - public virtual List Procedures { get; set; } = new(); + public virtual List Messages { get; set; } = new(); public static Client? Create(ClientBindingModel model) { diff --git a/BeautySalonView/BeautySalonDatabaseImplement/Models/CosmeticProcedure.cs b/BeautySalonView/BeautySalonDatabaseImplement/Models/CosmeticProcedure.cs index f8571a2..7b8e054 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/Models/CosmeticProcedure.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/Models/CosmeticProcedure.cs @@ -18,7 +18,7 @@ namespace BeautySalonDatabaseImplement.Models public int ProcedureId { get; set; } [Required] - public int ProcedureCosmeticCount { get; set; } + public int Count { get; set; } public virtual Cosmetic Cosmetic { get; set; } = new(); diff --git a/BeautySalonView/BeautySalonDatabaseImplement/Models/Evaluation.cs b/BeautySalonView/BeautySalonDatabaseImplement/Models/Evaluation.cs index 2a4f336..5d11634 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/Models/Evaluation.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/Models/Evaluation.cs @@ -23,12 +23,11 @@ namespace BeautySalonDatabaseImplement.Models [Required] public int ProcedureId { get; set; } + public virtual Procedure? Procedure { get; set; } - public virtual Procedure Procedure { get; set; } = new(); - [Required] public int ClientId { get; set; } - public virtual Client Client { get; set; } = new(); + public virtual Client? Client { get; set; } public static Evaluation? Create(EvaluationBindingModel? model) { diff --git a/BeautySalonView/BeautySalonDatabaseImplement/Models/Procedure.cs b/BeautySalonView/BeautySalonDatabaseImplement/Models/Procedure.cs index 3efd85c..81824ff 100644 --- a/BeautySalonView/BeautySalonDatabaseImplement/Models/Procedure.cs +++ b/BeautySalonView/BeautySalonDatabaseImplement/Models/Procedure.cs @@ -24,9 +24,11 @@ namespace BeautySalonDatabaseImplement.Models [Required] public double ProcedureDuration { get; set; } + [Required] public int ClientId { get; set; } - public virtual Client Client { get; set; } = null!; + public virtual Client Client { get; set; } + #region //// связь процедуры и оценок один - ко - многим //[ForeignKey("ProcedureId")] //public virtual List Evaluations { get; set; } = new(); @@ -60,19 +62,21 @@ namespace BeautySalonDatabaseImplement.Models // return _cosmeticProcedures; // } //} + #endregion - private Dictionary? _cosmeticProcedures = null;//Это поле для хранения словаря OrderCosmetics. + private Dictionary? _procedureCosmetics = null;//Это поле для хранения словаря OrderCosmetics. [NotMapped] - public Dictionary CosmeticProcedure//представляет список косметики, участвующей в заказе. Не присутствует в базе данных. + public Dictionary ProcedureCosmetics//представляет список косметики, участвующей в заказе. Не присутствует в базе данных. { get { - if (_cosmeticProcedures == null) + if (_procedureCosmetics == null) { - _cosmeticProcedures = Cosmetics - .ToDictionary(recPC => recPC.CosmeticId, recPC => recPC.Cosmetic.CosmeticName); + _procedureCosmetics = Cosmetics + .ToDictionary(recPC => recPC.CosmeticId, recPC => + (recPC.Cosmetic as ICosmeticModel, recPC.Count)); } - return _cosmeticProcedures; + return _procedureCosmetics; } } @@ -88,9 +92,6 @@ namespace BeautySalonDatabaseImplement.Models //[ForeignKey("ProcedureId")] //public virtual List Services { get; set; } = new(); - - - public static Procedure Create(BeautySalonDatabase context, ProcedureBindingModel model) { if (model == null) @@ -104,7 +105,7 @@ namespace BeautySalonDatabaseImplement.Models ProcedurePrice = model.ProcedurePrice, ProcedureDuration = model.ProcedureDuration, ClientId = model.ClientId, - Cosmetics = model.ProcedureCosmetics.Select(x => new ProcedureCosmetic + Cosmetics = model.ProcedureCosmetics.Select(x => new CosmeticProcedure { Cosmetic = context.Cosmetics.First(y => y.Id == x.Key) }).ToList(), @@ -126,7 +127,7 @@ namespace BeautySalonDatabaseImplement.Models ProcedureName = ProcedureName, ProcedurePrice = ProcedurePrice, ProcedureDuration = ProcedureDuration, - CosmeticProcedures = CosmeticProcedures, + ProcedureCosmetics = ProcedureCosmetics, ClientId = ClientId }; @@ -135,7 +136,7 @@ namespace BeautySalonDatabaseImplement.Models var procedureCosmetics = context.CosmeticProcedures.Where(rec => rec.ProcedureId == model.Id).ToList(); if (procedureCosmetics != null && procedureCosmetics.Count > 0) { // удалили те, которых нет в модели - context.CosmeticProcedures.RemoveRange(procedureCosmetics.Where(rec => !model.CosmeticProcedure.ContainsKey(rec.CosmeticId))); + context.CosmeticProcedures.RemoveRange(procedureCosmetics.Where(rec => !model.ProcedureCosmetics.ContainsKey(rec.CosmeticId))); context.SaveChanges(); // обновили количество у существующих записей foreach (var updateCosmetic in procedureCosmetics) @@ -144,17 +145,17 @@ namespace BeautySalonDatabaseImplement.Models } context.SaveChanges(); } - var service = context.Procedures.First(x => x.Id == Id); + var procedure = context.Procedures.First(x => x.Id == Id); foreach (var rp in model.ProcedureCosmetics) { - context.CosmeticProcedures.Add(new Procedure + context.CosmeticProcedures.Add(new CosmeticProcedure { Procedure = procedure, Cosmetic = context.Cosmetics.First(x => x.Id == rp.Key), }); context.SaveChanges(); } - _cosmeticProcedures = null; + _procedureCosmetics = null; }