аааааааааааа
This commit is contained in:
parent
d27881cec2
commit
0f7e5f6b6c
@ -8,7 +8,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BeautySalonDataModels\BeautySalonDataModels.csproj" />
|
||||
<ProjectReference Include="..\BeautySalonContracts\BusinessLogicContracts.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -14,9 +14,6 @@ namespace BeautySalonContracts.BindingModels
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
public double ServicePrice { get; set; }
|
||||
public int StaffMemberId { get; set; }
|
||||
//public List<ServiceCosmeticViewModel> ServiceCosmetic { get; set; } = new();
|
||||
//public List<ServiceProcedureViewModel> ServiceProcedure { get; set; } = new();
|
||||
//public List<OrderServiceViewModel> OrderService { get; set; } = new();
|
||||
public Dictionary<int, (ICosmeticModel, int)> ServiceCosmetics
|
||||
{
|
||||
get;
|
||||
|
@ -7,5 +7,7 @@ namespace BeautySalonContracts.SearchModels
|
||||
public int? Id { get; set; }
|
||||
public string? ServiceName { get; set; }
|
||||
public int? StaffMemberId { get; set; }
|
||||
public List<int>? CosmeticIds { get; set; }
|
||||
public List<int>? PeocedureIds { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -22,10 +22,15 @@ namespace BeautySalonContracts.ViewModels
|
||||
|
||||
[DisplayName("Сотрудник")]
|
||||
public string StaffMemberName { get; set; } = string.Empty;
|
||||
|
||||
Dictionary<int, (ICosmeticModel, int)> ServiceCosmetics { get; } //список косметики "участвующей" в заказе
|
||||
Dictionary<int, (IProcedureModel, int)> ServiceProcedures { get; } //список процедур "участвующих" в заказе
|
||||
//public List<OrderServiceViewModel> OrderService { get; set; } = new();
|
||||
|
||||
public Dictionary<int, (ICosmeticModel, int)> ServiceCosmetics//список косметики "участвующей" в заказе
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
public Dictionary<int, (IProcedureModel, int)> ServiceProcedures//список процедур "участвующих" в заказе
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
}
|
||||
}
|
||||
|
@ -11,5 +11,7 @@ namespace BeautySalonDataModels.Models
|
||||
string ServiceName { get; }
|
||||
double ServicePrice { get; }
|
||||
int StaffMemberId { get; }
|
||||
Dictionary<int, (ICosmeticModel, int)> ServiceCosmetics { get; } //список косметики "участвующей" в заказе
|
||||
Dictionary<int, (IProcedureModel, int)> ServiceProcedures { get; } //список процедур "участвующих" в заказе
|
||||
}
|
||||
}
|
||||
|
@ -27,35 +27,37 @@ namespace BeautySalonDatabaseImplement.Models
|
||||
public int StaffMemberId { get; set; }
|
||||
public virtual StaffMember StaffMember { get; set; }
|
||||
|
||||
private Dictionary<int, string>? _serviceCosmetics = null;//Это поле для хранения словаря OrderCosmetics.
|
||||
private Dictionary<int, (ICosmeticModel, int)>? _serviceCosmetics = null;//Это поле для хранения словаря OrderCosmetics.
|
||||
[NotMapped]
|
||||
public Dictionary<int, string> ServiceCosmetics//представляет список косметики, участвующей в заказе. Не присутствует в базе данных.
|
||||
public Dictionary<int, (ICosmeticModel, int)> ServiceCosmetics//представляет список косметики, участвующей в заказе. Не присутствует в базе данных.
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_serviceCosmetics == null)
|
||||
{
|
||||
_serviceCosmetics = Cosmetics
|
||||
.ToDictionary(recPC => recPC.CosmeticId, recPC => recPC.Cosmetic.CosmeticName);
|
||||
.ToDictionary(recPC => recPC.CosmeticId, recPC =>
|
||||
(recPC.Cosmetic as ICosmeticModel, recPC.Count));
|
||||
}
|
||||
return _serviceCosmetics;
|
||||
}
|
||||
}
|
||||
[ForeignKey("serviceId")]
|
||||
public virtual List<OrderCosmetic> Cosmetics { get; set; } = new();//представляет список косметических товаров для данного заказа.
|
||||
public virtual List<ServiceCosmetic> Cosmetics { get; set; } = new();//представляет список косметических товаров для данного заказа.
|
||||
|
||||
|
||||
|
||||
private Dictionary<int, string>? _serviceProcedures = null;//Это поле для хранения словаря OrderCosmetics.
|
||||
private Dictionary<int, (IProcedureModel, int)>? _serviceProcedures = null;//Это поле для хранения словаря OrderCosmetics.
|
||||
[NotMapped]
|
||||
public Dictionary<int, string> ServiceProcedures//представляет список косметики, участвующей в заказе. Не присутствует в базе данных.
|
||||
public Dictionary<int, (IProcedureModel, int)> ServiceProcedures//представляет список косметики, участвующей в заказе. Не присутствует в базе данных.
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_serviceProcedures == null)
|
||||
{
|
||||
_serviceProcedures = Procedures
|
||||
.ToDictionary(recPC => recPC.ProcedureId, recPC => recPC.Procedure.ProcedureName);
|
||||
.ToDictionary(recPC => recPC.ProcedureId, recPC =>
|
||||
(recPC.Procedure as IProcedureModel, recPC.Count));
|
||||
}
|
||||
return _serviceProcedures;
|
||||
}
|
||||
@ -103,8 +105,8 @@ namespace BeautySalonDatabaseImplement.Models
|
||||
Id = Id,
|
||||
ServiceName = ServiceName,
|
||||
ServicePrice = ServicePrice,
|
||||
ServiceCosmetic = ServiceCosmetics,
|
||||
ServiceProcedure = ServiceProcedures,
|
||||
ServiceCosmetics = ServiceCosmetics,
|
||||
ServiceProcedures= ServiceProcedures,
|
||||
StaffMemberId = StaffMemberId,
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace BeautySalonDatabaseImplement.Models
|
||||
public int ServiceId { get; set; }
|
||||
|
||||
[Required]
|
||||
public int ServiceCosmeticCount { get; set; }
|
||||
public int Count { get; set; }
|
||||
|
||||
public virtual Cosmetic Cosmetic { get; set; } = new();
|
||||
|
||||
|
@ -18,7 +18,7 @@ namespace BeautySalonDatabaseImplement.Models
|
||||
public int ProcedureId { get; set; }
|
||||
|
||||
[Required]
|
||||
public int ServiceProcedureCount { get; set; }
|
||||
public int Count { get; set; }
|
||||
|
||||
public virtual Service Service { get; set; } = new();
|
||||
|
||||
|
@ -5,6 +5,7 @@ using BeutySalonClientApp;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Diagnostics;
|
||||
using ClientWebApp.Models;
|
||||
using PrecastConcretePlantContracts.ViewModels;
|
||||
|
||||
namespace BeutySalonClientApp.Controllers
|
||||
{
|
||||
@ -146,13 +147,13 @@ namespace BeutySalonClientApp.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public int[]? ServiceList([FromBody] ServiceListBindingModel listModel)
|
||||
public int[]? ServiceList([FromBody] ServiceBindingModel listModel)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Array.Empty<int>();
|
||||
}
|
||||
byte[]? file = APIClient.PostRequestWithResult<ServiceListBindingModel, byte[]>
|
||||
byte[]? file = APIClient.PostRequestWithResult<ServiceBindingModel, byte[]>
|
||||
("api/client/ListServices", listModel);
|
||||
return file!.Select(b => (int)b).ToArray();
|
||||
}
|
||||
@ -174,7 +175,7 @@ namespace BeutySalonClientApp.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public List<ReportOrderServicesViewModel>? Report([FromBody] ReportClientBindingModel reportModel)
|
||||
public List<ReportOrdersViewModel>? Report([FromBody] ReportClientBindingModel reportModel)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user