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 }; }