This commit is contained in:
Игорь Гордеев 2024-05-19 18:43:00 +04:00
parent be5db49184
commit d94b4cbe44
8 changed files with 143 additions and 1 deletions

View File

@ -83,7 +83,7 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
if (viewModel == null) {
throw new ArgumentNullException(nameof(model));
}
if (viewModel.Status + 1 != newOrderStatus) {
if (viewModel.OrderStatus + 1 != newOrderStatus) {
_logger.LogWarning("Status update to " + newOrderStatus.ToString() + " operation failed.");
return false;
}
@ -100,5 +100,10 @@ namespace ElectronicsShopBusinessLogic.BusinessLogic
}
return true;
}
public OrderViewModel? ReadElement(OrderSearchModel model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,31 @@
using ElectronicsShopContracts.BindingModels;
using ElectronicsShopContracts.BusinessLogicContracts;
using ElectronicsShopContracts.SearchModels;
using ElectronicsShopContracts.StorageContracts;
using ElectronicsShopContracts.ViewModels;
using Microsoft.Extensions.Logging;
namespace ElectronicsShopBusinessLogic.BusinessLogic
{
public class PayLogic : IPayLogic
{
private readonly ILogger _logger;
private readonly IPayStorage _storage;
public bool CreatePay(PayBindingModel model)
{
throw new NotImplementedException();
}
public PayViewModel? ReadElement(PaySearchModel model)
{
throw new NotImplementedException();
}
public List<PayViewModel>? ReadList(PaySearchModel? model)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,17 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels
{
public class PayBindingModel : IPayModel
{
public int ID { get; set; }
public int ClientID { get; set; }
public double SummaPay { get; set; }
public DateTime DatePay { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using ElectronicsShopContracts.BindingModels;
using ElectronicsShopContracts.SearchModels;
using ElectronicsShopContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BusinessLogicContracts
{
public interface IPayLogic
{
List<PayViewModel>? ReadList(PaySearchModel? model);
PayViewModel? ReadElement(PaySearchModel model);
bool CreatePay(PayBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.SearchModels
{
public class PaySearchModel
{
public int? ID { get; set; }
public int? ClientID { get; set; }
public double? SummaPay { get; set; }
public DateTime DatePay { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using ElectronicsShopContracts.BindingModels;
using ElectronicsShopContracts.SearchModels;
using ElectronicsShopContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.StorageContracts
{
public interface IPayStorage
{
List<PayViewModel> GetFullList();
PayViewModel? GetElement(PaySearchModel model);
PayViewModel? Insert(PayBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class PayViewModel : IPayModel
{
public int ID { get; set; }
public int ClientID {get;set;}
public double SummaPay { get; set; }
public DateTime DatePay { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models
{
public interface IPayModel: IID
{
int ClientID { get; }
double SummaPay { get; }
DateTime DatePay { get; }
}
}