сделала что смогла и к сожалению я вырубаюсь и иду спать

This commit is contained in:
malimova 2024-05-04 01:28:24 +04:00
parent b974a4b4b5
commit e1715dffb8
11 changed files with 35 additions and 10 deletions

View File

@ -18,6 +18,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ConfectioneryContracts\ConfectioneryContracts.csproj" /> <ProjectReference Include="..\ConfectioneryContracts\ConfectioneryContracts.csproj" />
<ProjectReference Include="..\ConfectioneryDataModels\ConfectioneryDataModels.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,9 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using ConfectioneryContracts.BindingModels;
using ConfectioneryContracts.BusinessLogicsContracts;
using ConfectioneryContracts.SearchModels;
using ConfectioneryContracts.StoragesContracts;
using ConfectioneryContracts.ViewModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -21,6 +21,23 @@ namespace ConfectioneryBusinessLogic
{ {
_logger = logger; _logger = logger;
_orderStorage = orderStorage; _orderStorage = orderStorage;
}
public OrderViewModel? ReadElement(OrderSearchModel model)
{
if (model == null)
{
throw new ArgumentNullException(nameof(model));
}
_logger.LogInformation("ReadElement. ClientId:{ClientId}.Status:{Status}.ImplementerId:{ImplementerId}.DateFrom:{DateFrom}.DateTo:{DateTo}OrderId:{Id}",
model.ClientId, model.Status, model.ImplementerId, 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);
return element;
} }
public List<OrderViewModel>? ReadList(OrderSearchModel? model) public List<OrderViewModel>? ReadList(OrderSearchModel? model)
{ {

View File

@ -1,4 +1,4 @@
using ConfectioneryDataModels; using ConfectioneryDataModels.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -13,6 +13,7 @@ namespace ConfectioneryContracts.BindingModels
public int Id { get; set; } public int Id { get; set; }
public int PastryId { get; set; } public int PastryId { get; set; }
public int ClientId { get; set; } public int ClientId { get; set; }
public int? ImplementerId { get; set; }
public int Count { get; set; } public int Count { get; set; }
public double Sum { get; set; } public double Sum { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;

View File

@ -1,4 +1,4 @@
using ConfectioneryDataModels; using ConfectioneryDataModels.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;

View File

@ -9,7 +9,7 @@ using ConfectioneryDataModels.Models;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace ConfectioneryDatabaseImplement namespace ConfectioneryDatabaseImplement.Models
{ {
public class Implementer : IImplementerModel public class Implementer : IImplementerModel
{ {

View File

@ -54,8 +54,6 @@ namespace ConfectioneryFileImplement.Models
}; };
} }
public void Update(ImplementerBindingModel model) public void Update(ImplementerBindingModel model)
{ {
if (model == null) if (model == null)

View File

@ -2,7 +2,7 @@
using ConfectioneryContracts.SearchModels; using ConfectioneryContracts.SearchModels;
using ConfectioneryContracts.StoragesContracts; using ConfectioneryContracts.StoragesContracts;
using ConfectioneryContracts.ViewModels; using ConfectioneryContracts.ViewModels;
using ConfectioneryDatabaseImplement; using ConfectioneryFileImplement.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -14,12 +14,14 @@ namespace ConfectioneryListImplement
public List<Order> Orders { get; set; } public List<Order> Orders { get; set; }
public List<Pastry> Pastrys { get; set; } public List<Pastry> Pastrys { get; set; }
public List<Client> Clients { get; set; } public List<Client> Clients { get; set; }
public List<Implementer> Implementers { get; set; }
private DataListSingleton() private DataListSingleton()
{ {
Components = new List<Component>(); Components = new List<Component>();
Orders = new List<Order>(); Orders = new List<Order>();
Pastrys = new List<Pastry>(); Pastrys = new List<Pastry>();
Clients = new List<Client>(); Clients = new List<Client>();
Implementers = new List<Implementer>();
} }
public static DataListSingleton GetInstance() public static DataListSingleton GetInstance()
{ {

View File

@ -2,6 +2,7 @@
using ConfectioneryContracts.SearchModels; using ConfectioneryContracts.SearchModels;
using ConfectioneryContracts.StoragesContracts; using ConfectioneryContracts.StoragesContracts;
using ConfectioneryContracts.ViewModels; using ConfectioneryContracts.ViewModels;
using ConfectioneryListImplement.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;