Models fix

This commit is contained in:
Илья Федотов 2024-05-22 23:00:35 +04:00
parent ead38d06d3
commit 768dce69f1
61 changed files with 283 additions and 552 deletions

View File

@ -8,22 +8,22 @@ using Microsoft.Extensions.Logging;
namespace ElectronicsShopBusinessLogic.BusinessLogic
{
public class PayLogic : IPayLogic
public class PayLogic : IPaymentLogic
{
private readonly ILogger _logger;
private readonly IPayStorage _storage;
private readonly IPaymentStorage _storage;
public bool CreatePay(PayBindingModel model)
public bool CreatePay(PaymentBindingModel model)
{
throw new NotImplementedException();
}
public PayViewModel? ReadElement(PaySearchModel model)
public PaymentViewModel? ReadElement(PaymentSearchModel model)
{
throw new NotImplementedException();
}
public List<PayViewModel>? ReadList(PaySearchModel? model)
public List<PaymentViewModel>? ReadList(PaymentSearchModel? model)
{
throw new NotImplementedException();
}

View File

@ -1,16 +0,0 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels
{
public class CategoryProductBindingModel : ICategoryProductModel
{
public int ID { get; set; }
public string Name { get; set; } = string.Empty;
}
}

View File

@ -7,8 +7,12 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels {
public class ClientBindingModel : IClientModel {
public int UserID { get; set; }
public string ClientFIO { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public int ID { get; set; }
}
}

View File

@ -6,9 +6,13 @@ using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels {
public class ExpensesBindingModel : IExpensesModel {
public class CostItemBindingModel : ICostItemModel {
public int ID { get; set; }
public int ClientID { get; set; }
public int Sum { get; set; }
public int OrderCount { get; set; }
public string Name { get; set; } = string.Empty;
public double Price { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels {
public class EmployeeBindingModel : IEmployeeModel {
public int ID { get; set; }
public string EmployeeFIO { get; set; } = string.Empty;
public string Login { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
}
}

View File

@ -1,15 +0,0 @@
using ElectronicsShopDataModels.Enums;
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels {
public class ImplementerBindingModel : IImplementerModel {
public int UserID { get; set; }
public Quakifications Qualification { get; set; } = Quakifications.Отсутствует;
}
}

View File

@ -10,19 +10,16 @@ namespace ElectronicsShopContracts.BindingModels
{
public class OrderBindingModel : IOrderModel
{
public int ID { get; set; }
public int ClientID { get; set; }
public int? ImplementerID { get; set; }
public int PaymentID { get; set; }
public int ID { get; set; }
public int ClientID { get; set; }
public int? EmployeeID { get; set; }
public DateTime DateCreate { get; set; } = DateTime.Now;
public double Sum { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно;
public DateTime DateCreate { get; set; } = DateTime.Now;
public DateTime? DateImplement { get; set; }
public Dictionary<int, (IProductModel, int)> ProductList { get; set; } = new();
}
}

View File

@ -7,11 +7,16 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels
{
public class PayBindingModel : IPayModel
public class PaymentBindingModel : IPaymentModel
{
public int ID { get; set; }
public int ClientID { get; set; }
public double SummaPay { get; set; }
public DateTime DatePay { get; set; }
}
public int ProductID { get; set; }
public int OrderID { get; set; }
public double SumPayment { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using ElectronicsShopDataModels.Models;
using ElectronicsShopDataModels.Enums;
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
@ -7,16 +8,15 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels
{
public class ProductBindingModel : IProductModel
{
//ID категории продукта (товара)
public int CategoryID { get; set; }
//ID продукта (товара)
public int ID { get; set; }
public class ProductBindingModel : IProductModel {
public int ID { get; set; }
public int CostItemID { get; set; }
public string ProductName { get; set; } = string.Empty;
public double Price { get; set; }
}
public string ProductName { get; set; } = string.Empty;
public double Price { get; set; }
public PaymeantOption PayOption { get; set; } = PaymeantOption.Неоплачено;
}
}

View File

@ -1,16 +0,0 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels
{
public class RoleBindingModel : IRoleModel
{
public int ID { get; set; }
public string Name { get; set; } = string.Empty;
}
}

View File

@ -1,19 +0,0 @@
using ElectronicsShopDataModels;
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels
{
public class UserBindingModel : IUserModel {
public int ID { get; set; }
public int RoleID { get; set; }
public string UserFIO { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string Login { get; set; } = string.Empty;
}
}

View File

@ -1,20 +0,0 @@
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 ICategoryProductLogic
{
List<CategoryProductViewModel>? ReadList(CategoryProductSearchModel? model);
bool Create(CategoryProductBindingModel model);
bool Update(CategoryProductBindingModel model);
bool Delete(CategoryProductBindingModel model);
}
}

View File

@ -9,10 +9,10 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.BusinessLogicContracts {
public interface IClientLogic {
List<ClientViewModel>? ReadList(ClientSearchModel? model);
List<ClientViewModel>? ReadList(ClientSearchModel model);
ClientViewModel? ReadElemet(ClientSearchModel model);
bool Add(ClientBindingModel model);
bool Create(ClientBindingModel model);
bool Update(ClientBindingModel model);
bool Delete(ClientBindingModel model);
}

View File

@ -8,12 +8,12 @@ using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BusinessLogicContracts {
public interface IImplementerLogic {
List<ImplementerViewModel>? ReadList(ImplementerSearchModel? model);
ImplementerViewModel? ReadElemet(ImplementerSearchModel model);
public interface ICostItemLogic {
List<CostItemViewModel>? ReadList(CostItemSearchModel model);
CostItemViewModel? ReadElement(CostItemSearchModel model);
bool Add(ImplementerBindingModel model);
bool Update(ImplementerBindingModel model);
bool Delete(ImplementerBindingModel model);
bool Create(CostItemBindingModel model);
bool Update(CostItemBindingModel model);
bool Delete(CostItemBindingModel model);
}
}

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 IEmployeeLogic {
List<EmployeeViewModel>? ReadList(EmployeeSearchModel model);
EmployeeViewModel? ReadElemet(EmployeeSearchModel model);
bool Add(EmployeeBindingModel model);
bool Update(EmployeeBindingModel model);
bool Delete(EmployeeBindingModel model);
}
}

View File

@ -1,14 +0,0 @@
using ElectronicsShopContracts.BindingModels;
using ElectronicsShopContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BusinessLogicContracts {
public interface IExpensesLogic {
ExpensesViewModel? ReadElement(ExpensesBindingModel model);
ExpensesViewModel? Create(ExpensesBindingModel model);
}
}

View File

@ -15,8 +15,5 @@ namespace ElectronicsShopContracts.BusinessLogicContracts
OrderViewModel? ReadElement(OrderSearchModel model);
bool CreateOrder(OrderBindingModel model);
bool TakeOrderInWork(OrderBindingModel model);
bool FinishOrder(OrderBindingModel model);
bool DeliveryOrder(OrderBindingModel model);
}
}

View File

@ -9,11 +9,11 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.BusinessLogicContracts
{
public interface IPayLogic
public interface IPaymentLogic
{
List<PayViewModel>? ReadList(PaySearchModel? model);
PayViewModel? ReadElement(PaySearchModel model);
List<PaymentViewModel>? ReadList(PaymentSearchModel model);
PaymentViewModel? ReadElement(PaymentSearchModel model);
bool CreatePay(PayBindingModel model);
bool CreatePay(PaymentBindingModel model);
}
}

View File

@ -11,8 +11,8 @@ namespace ElectronicsShopContracts.BusinessLogicContracts
{
public interface IProductLogic
{
List<ProductViewModel>? ReadList(ProductSearchModel? model);
ProductViewModel? ReadElement(ProductSearchModel? model);
List<ProductViewModel>? ReadList(ProductSearchModel model);
ProductViewModel? ReadElement(ProductSearchModel model);
bool Create(ProductBindingModel model);
bool Update(ProductBindingModel model);

View File

@ -1,20 +0,0 @@
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 IRoleLogic
{
List<RoleViewModel>? ReadList(RoleSearchModel? model);
bool Create(RoleBindingModel model);
bool Update(RoleBindingModel model);
bool Delete(RoleBindingModel model);
}
}

View File

@ -1,21 +0,0 @@
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 IUserLogic
{
List<ClientViewModel>? ReadList(ClientSearchModel? model);
ClientViewModel? ReadElemet(ClientSearchModel model);
bool Add(UserBindingModel model);
bool Update(UserBindingModel model);
bool Delete(UserBindingModel model);
}
}

View File

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.SearchModels
{
public class CategoryProductSearchModel
{
public int? ID { get; set; }
public string? Name { get; set; }
}
}

View File

@ -9,6 +9,6 @@ namespace ElectronicsShopContracts.SearchModels
public class ClientSearchModel
{
public int? ID { get; set; }
public string? Login { get; set; }
public string? Email { get; set; }
}
}

View File

@ -5,7 +5,8 @@ using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.SearchModels {
public class ExpensesSearchModel {
public int ClientID { get; set; }
public class CostItemSearchModel {
public int? ID { get; set; }
public string? Name { get; set; }
}
}

View File

@ -7,9 +7,10 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.SearchModels
{
public class ImplementerSearchModel
public class EmployeeSearchModel
{
public int UserID { get; set; }
public Quakifications Quakifications { get; set; }
public int? ID { get; set; }
public string? EmployeFIO { get; set; }
public string? Login { get; set; }
}
}

View File

@ -11,12 +11,8 @@ namespace ElectronicsShopContracts.SearchModels
public class OrderSearchModel
{
public int? ID { get; set; }
//public int? OplataID { get; set; }
public int? ClientID { get; set; }
public OrderStatus OrderStatus { get; set; }
public PaymeantOption PaymeantOption { get; set; }
public int? EmployeeID { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set;}
public Dictionary<int, (IProductModel, int)> ProductList { get; set; } = new();
}
}

View File

@ -1,16 +0,0 @@
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

@ -6,10 +6,11 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.SearchModels
{
public class RoleSearchModel
public class PaymentSearchModel
{
public int? ID { get; set; }
public string? Name { get; set; } = string.Empty;
public int? ProductID { get; set; }
public int? OrderID { get; set; }
public double? SumPay { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using System;
using ElectronicsShopDataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -10,5 +11,7 @@ namespace ElectronicsShopContracts.SearchModels
{
public int? ID { get; set; }
public string? ProductName { get; set; }
public string? CostItem { get; set; }
public PaymeantOption? PayOption { get; set; }
}
}

View File

@ -1,21 +0,0 @@
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 ICategoryProductStorage
{
List<CategoryProductViewModel> GetFullList();
List<CategoryProductViewModel> GetFilteredList(CategoryProductSearchModel model);
CategoryProductViewModel? GetElement(CategoryProductSearchModel model);
CategoryProductViewModel? Insert(CategoryProductBindingModel model);
CategoryProductViewModel? Update(CategoryProductBindingModel model);
CategoryProductViewModel? Delete(CategoryProductBindingModel model);
}
}

View File

@ -13,6 +13,7 @@ namespace ElectronicsShopContracts.StorageContracts
{
List<ClientViewModel> GetFullList();
List<ClientViewModel> GetFilteredList(ClientSearchModel model);
ClientViewModel? GetElement(ClientSearchModel model);
ClientViewModel? Insert(ClientBindingModel model);
ClientViewModel? Update(ClientBindingModel model);

View File

@ -0,0 +1,20 @@
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 ICostItemModel {
List<CostItemViewModel> GetFullList();
List<CostItemViewModel> GetFillteredList(CostItemSearchModel model);
CostItemViewModel GetElement(CostItemSearchModel model);
CostItemViewModel? Insert(CostItemBindingModel model);
CostItemViewModel? Update(CostItemBindingModel model);
CostItemViewModel? Delete(CostItemBindingModel model);
}
}

View File

@ -0,0 +1,22 @@
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 IEmployeeStorage
{
List<EmployeeViewModel> GetFullList();
List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model);
EmployeeViewModel? GetElement(ClientSearchModel model);
EmployeeViewModel? Insert(EmployeeBindingModel model);
EmployeeViewModel? Update(EmployeeBindingModel model);
EmployeeViewModel? Delete(EmployeeBindingModel model);
}
}

View File

@ -1,16 +0,0 @@
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 IExpensesStorage {
ExpensesViewModel? GetElement(ExpensesSearchModel model);
ExpensesViewModel Create(ExpensesBindingModel model);
}
}

View File

@ -1,21 +0,0 @@
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 IImplementerStorage
{
List<ImplementerViewModel> GetFullList();
List<ImplementerViewModel> GetFilteredList(ImplementerSearchModel model);
ImplementerViewModel? GetElement(ClientSearchModel model);
ImplementerViewModel? Insert(ImplementerBindingModel model);
ImplementerViewModel? Update(ImplementerBindingModel model);
ImplementerViewModel? Delete(ImplementerBindingModel model);
}
}

View File

@ -13,9 +13,9 @@ namespace ElectronicsShopContracts.StorageContracts
{
List<OrderViewModel> GetFullList();
List<OrderViewModel> GetFilteredList(OrderSearchModel model);
OrderViewModel? GetElement(OrderSearchModel model);
OrderViewModel? Insert(OrderBindingModel model);
OrderViewModel? Update(OrderBindingModel model);
OrderViewModel? Delete(OrderBindingModel model);
}
}

View File

@ -9,10 +9,10 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.StorageContracts
{
public interface IPayStorage
public interface IPaymentStorage
{
List<PayViewModel> GetFullList();
PayViewModel? GetElement(PaySearchModel model);
PayViewModel? Insert(PayBindingModel model);
List<PaymentViewModel> GetFullList();
PaymentViewModel? GetElement(PaymentSearchModel model);
PaymentViewModel? Insert(PaymentBindingModel model);
}
}

View File

@ -1,21 +0,0 @@
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 IRoleStorage
{
List<RoleViewModel> GetFullList();
List<RoleViewModel> GetFilteredList(RoleSearchModel model);
RoleViewModel? GetElement(RoleSearchModel model);
RoleViewModel? Insert(RoleBindingModel model);
RoleViewModel? Update(RoleBindingModel model);
RoleViewModel? Delete(RoleBindingModel model);
}
}

View File

@ -1,18 +0,0 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class CategoryProductViewModel : ICategoryProductModel
{
public int ID { get; set; }
[DisplayName("Название категории продукта")]
public string Name { get; set; } = string.Empty;
}
}

View File

@ -9,12 +9,16 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class ClientViewModel : IClientModel
{
//ID пользователя
public int UserID { get; set; }
public class ClientViewModel : IClientModel {
public int ID { get; set; }
[DisplayName("Почта")]
public string Email { get; set; } = string.Empty;
}
[DisplayName("ФИО клиента")]
public string ClientFIO { get; set; } = string.Empty;
[DisplayName("Почта клиента")]
public string Email { get; set; } = string.Empty;
[DisplayName("Пароль клиента")]
public string Password { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,22 @@

using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels {
public class CostItemViewModel : ICostItemModel {
public int ID { get; set; }
public int ClientID { get; set; }
[DisplayName("Название статьи затрат")]
public string Name { get; set; } = string.Empty;
[DisplayName("Затраты")]
public double Price { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using ElectronicsShopDataModels.Enums;
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class EmployeeViewModel : IEmployeeModel {
public int ID { get; set; }
[DisplayName("ФИО сотрудника")]
public string EmployeeFIO { get; set; } = string.Empty;
[DisplayName("Логина сотрудника")]
public string Login { get; set; } = string.Empty;
[DisplayName("Пароль сотрудника")]
public string Password { get; set; } = string.Empty;
}
}

View File

@ -1,21 +0,0 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels {
public class ExpensesViewModel : IExpensesModel {
[DisplayName("Клиента ID")]
public int ClientID { get; set; }
[DisplayName("Сумма всех заказов")]
public int Sum { get; set; }
[DisplayName("Заказов всего")]
public int OrderCount { get; set; }
}
}

View File

@ -1,17 +0,0 @@
using ElectronicsShopDataModels.Enums;
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class ImplementerViewModel : IImplementerModel
{
public int UserID {get; set;}
public Quakifications Qualification { get; set; } = Quakifications.Отсутствует;
}
}

View File

@ -11,29 +11,19 @@ namespace ElectronicsShopContracts.ViewModels
{
public class OrderViewModel : IOrderModel
{
public int ID { get; set; }
[DisplayName("Клиент ID")]
public int ClientID { get; set; }
[DisplayName("Исполнитель ID")]
public int? ImplementerID { get; set; }
[DisplayName("Оплата ID")]
public int PaymentID { get; set; }
public int ID { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }
public int ClientID { get; set; }
[DisplayName("Статус")]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
public int? EmployeeID { get; set; }
[DisplayName("Стутус оплаты")]
public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно;
[DisplayName("Дата заказа")]
public DateTime DateCreate { get; set; } = DateTime.Now;
[DisplayName("Дата создания")]
public DateTime DateCreate { get; set; } = DateTime.Now;
[DisplayName("Сумма заказа")]
public double Sum { get; set; }
[DisplayName("Дата выполнения")]
public DateTime? DateImplement { get; set; }
[DisplayName("Корзина")]
[DisplayName("Список продуктов")]
public Dictionary<int, (IProductModel, int)> ProductList { get; set; } = new();
}
}

View File

@ -1,20 +0,0 @@
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,21 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class PaymentViewModel : IPaymentModel {
public int ID { get; set; }
public int ProductID { get; set; }
public int OrderID { get; set; }
[DisplayName("Cумма оплаты продукта")]
public double SumPayment { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using ElectronicsShopDataModels.Models;
using ElectronicsShopDataModels.Enums;
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -8,17 +9,18 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class ProductViewModel : IProductModel
{
//ID категории продукта (товара)
public int CategoryID { get; set; }
//ID продукта (товара)
public int ID { get; set; }
public class ProductViewModel : IProductModel {
public int ID { get; set; }
[DisplayName("Название товара")]
public string ProductName { get; set; } = string.Empty;
public int CostItemID { get; set; }
[DisplayName("Цена")]
public double Price { get; set; }
}
[DisplayName("Название продукта")]
public string ProductName { get; set; } = string.Empty;
[DisplayName("Стоимость продукта")]
public double Price { get; set; }
[DisplayName("Статус оплаты")]
public PaymeantOption PayOption { get; set; } = PaymeantOption.Неоплачено;
}
}

View File

@ -1,21 +0,0 @@
using ElectronicsShopDataModels;
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.ViewModels
{
public class RoleViewModel : IRoleModel
{
public int ID { get; set; }
[DisplayName("Название роли")]
public string Name { get; set; } = string.Empty;
}
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Enums
{
public enum OrderStatus
{
Неизвестен = -1,
Принят = 0,
Выполняется = 1,
Готов = 2,
Выдан = 3
}
}

View File

@ -8,7 +8,7 @@ namespace ElectronicsShopDataModels.Enums
{
public enum PaymeantOption
{
Неизвестно = -1,
Неоплачено = -1,
Полная_оплата = 0,

View File

@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Enums {
public enum Quakifications {
Отсутствует = -1
}
}

View File

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models
{
public interface ICategoryProductModel : IID
{
string Name { get; }
}
}

View File

@ -5,8 +5,9 @@ using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models {
public interface IClientModel {
int UserID { get; }
public interface IClientModel : IID {
string ClientFIO { get; }
string Email { get; }
string Password { get; }
}
}

View File

@ -5,9 +5,9 @@ using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models {
public interface IExpensesModel {
public interface ICostItemModel : IID{
int ClientID { get; }
int Sum { get; }
int OrderCount { get; }
string Name { get; }
double Price { get; }
}
}

View File

@ -6,8 +6,9 @@ using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models {
public interface IImplementerModel {
int UserID { get; }
Quakifications Qualification { get; }
public interface IEmployeeModel : IID {
string EmployeeFIO { get; }
string Login { get; }
string Password { get; }
}
}

View File

@ -10,13 +10,10 @@ namespace ElectronicsShopDataModels.Models
public interface IOrderModel : IID
{
int ClientID { get; }
int? ImplementerID { get; }
int PaymentID { get; }
OrderStatus Status { get; }
PaymeantOption PaymeantOption { get; }
int? EmployeeID { get; }
DateTime DateCreate { get; }
DateTime? DateImplement { get; }
double Sum { get; }
//список товаров в заказе
Dictionary<int, (IProductModel, int)> ProductList { get; }
}

View File

@ -7,10 +7,11 @@ using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models
{
public interface IPayModel: IID
public interface IPaymentModel: IID
{
int ClientID { get; }
double SummaPay { get; }
DateTime DatePay { get; }
int ProductID { get; }
int OrderID { get; }
double SumPayment { get; }
}
}

View File

@ -1,4 +1,5 @@
using System;
using ElectronicsShopDataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -10,6 +11,7 @@ namespace ElectronicsShopDataModels.Models
{
string ProductName { get; }
double Price { get; }
int CategoryID { get; }
int CostItemID { get; }
PaymeantOption PayOption { get; }
}
}

View File

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models
{
public interface IRoleModel : IID
{
string Name { get; }
}
}

View File

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels
{
public interface IUserModel : IID
{
int RoleID { get; }
string UserFIO { get; }
string Password { get; }
string Login { get; }
}
}