From af940199a270ab2fd651ebb819f85b2e42cd913d Mon Sep 17 00:00:00 2001 From: bocchanskyy Date: Sat, 4 May 2024 05:27:45 +0400 Subject: [PATCH] also some quick fixes (i hope so...) --- .../Implements/ProcedureStorage.cs | 8 -------- .../Models/Procedure.cs | 12 ------------ 2 files changed, 20 deletions(-) diff --git a/BeautyStudio/BeautyStudioDatabaseImplement/Implements/ProcedureStorage.cs b/BeautyStudio/BeautyStudioDatabaseImplement/Implements/ProcedureStorage.cs index f1370a3..e6c359f 100644 --- a/BeautyStudio/BeautyStudioDatabaseImplement/Implements/ProcedureStorage.cs +++ b/BeautyStudio/BeautyStudioDatabaseImplement/Implements/ProcedureStorage.cs @@ -54,13 +54,6 @@ namespace BeautyStudioDatabaseImplement.Implements .Select(x => x.GetViewModel) .ToList(); } - if (model.ClientId.HasValue) - { - return context.Procedures - .Where(x => x.ClientId == model.ClientId) - .Select(x => x.GetViewModel) - .ToList(); - } return new(); } @@ -100,7 +93,6 @@ namespace BeautyStudioDatabaseImplement.Implements } procedure.Update(model); context.SaveChanges(); - procedure.UpdateCosmetics(context, model); transaction.Commit(); return procedure.GetViewModel; } diff --git a/BeautyStudio/BeautyStudioDatabaseImplement/Models/Procedure.cs b/BeautyStudio/BeautyStudioDatabaseImplement/Models/Procedure.cs index 6a59170..6301ea9 100644 --- a/BeautyStudio/BeautyStudioDatabaseImplement/Models/Procedure.cs +++ b/BeautyStudio/BeautyStudioDatabaseImplement/Models/Procedure.cs @@ -24,9 +24,6 @@ namespace BeautyStudioDatabaseImplement.Models [Required] public string ProcedureDescription { get; set; } - [Required] - public double ProcedureDescription { get; set; } - public int ClientId { get; set; } public virtual Client Client { get; set; } = null!; @@ -52,7 +49,6 @@ namespace BeautyStudioDatabaseImplement.Models [ForeignKey("ProcedureId")] public virtual List Services { get; set; } = new(); - public static Procedure Create(BeautyStudioDatabase context, ProcedureBindingModel model) { return new Procedure() @@ -61,12 +57,6 @@ namespace BeautyStudioDatabaseImplement.Models ProcedureName = model.ProcedureName, ProcedureCost = model.ProcedureCost, ProcedureDescription = model.ProcedureDescription, - Cosmetics = model.CosmeticProcedures.Select(x => new CosmeticProcedure() - { - Cosmetic = context.Cosmetics.First(y => y.Id == x.Cosmetic.Id), - ProcedureCosmeticCount = x.Count - }).ToList(), - ClientId = model.ClientId, }; } @@ -83,8 +73,6 @@ namespace BeautyStudioDatabaseImplement.Models ProcedureName = ProcedureName, ProcedureCost = ProcedureCost, ProcedureDescription = ProcedureDescription, - ProcedureCosmetics = CosmeticProcedures, - ClientId = ClientId }; }