also some quick fixes (i hope so...)
This commit is contained in:
parent
485ed6e322
commit
af940199a2
@ -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;
|
||||
}
|
||||
|
@ -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<ServiceProcedure> 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
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user