Client and implementer

This commit is contained in:
Илья Федотов 2024-05-19 16:01:45 +04:00
parent cba5b48efb
commit d58315a99e
13 changed files with 119 additions and 33 deletions

View File

@ -0,0 +1,14 @@
using ElectronicsShopDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels {
public class ClientBindingModel : IClientModel {
public int UserID { get; set; }
public string Email { get; set; } = string.Empty;
}
}

View File

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

@ -12,15 +12,14 @@ namespace ElectronicsShopContracts.BindingModels
{
public int ID { get; set; }
public int UserID { get; set; }
public int? ImplementerID { get; set; }
public int PaymentID { get; set; }
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

@ -8,25 +8,12 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels
{
public class UserBindingModel : IUserModel
{
//ID пользователя
public class UserBindingModel : IUserModel {
public int ID { get; set; }
//ID роли (клиент)
public int RoleID { get; set; }
public string FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
public string Login { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string UserFIO { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string PhoneNumber { get; set; } = string.Empty;
public string Login { get; set; } = string.Empty;
}
}

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 IClientLogic {
List<ClientViewModel>? ReadList(ClientSearchModel? model);
ClientViewModel? ReadElemet(ClientSearchModel model);
bool Add(ClientBindingModel model);
bool Update(ClientBindingModel model);
bool Delete(ClientBindingModel 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 IImplementerLogic {
List<ImplementerViewModel>? ReadList(ImplementerSearchModel? model);
ImplementerViewModel? ReadElemet(ImplementerSearchModel model);
bool Add(ImplementerBindingModel model);
bool Update(ImplementerBindingModel model);
bool Delete(ImplementerBindingModel model);
}
}

View File

@ -12,6 +12,7 @@ namespace ElectronicsShopContracts.BusinessLogicContracts
public interface IOrderLogic
{
List<OrderViewModel>? ReadList(OrderSearchModel? model);
OrderViewModel? ReadElement(OrderSearchModel model);
bool CreateOrder(OrderBindingModel model);
bool TakeOrderInWork(OrderBindingModel model);

View File

@ -12,7 +12,7 @@ namespace ElectronicsShopContracts.BusinessLogicContracts
public interface IUserLogic
{
List<UserViewModel>? ReadList(UserSearchModel? model);
UserViewModel? ReadElemet(UserSearchModel? model);
UserViewModel? ReadElemet(UserSearchModel model);
bool Add(UserBindingModel model);
bool Update(UserBindingModel model);

View File

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

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models {
public interface IClientModel {
int UserID { get; }
string Email { get; }
}
}

View File

@ -0,0 +1,13 @@
using ElectronicsShopDataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataModels.Models {
public interface IImplementerModel {
int UserID { get; }
Quakifications Qualification { get; }
}
}

View File

@ -10,9 +10,9 @@ namespace ElectronicsShopDataModels.Models
public interface IOrderModel : IID
{
int UserID { get; }
int ImplementerID { get; }
int? ImplementerID { get; }
int PaymentID { get; }
OrderStatus OrderStatus { get; }
OrderStatus Status { get; }
PaymeantOption PaymeantOption { get; }
DateTime DateCreate { get; }
DateTime? DateImplement { get; }

View File

@ -8,14 +8,10 @@ namespace ElectronicsShopDataModels
{
public interface IUserModel : IID
{
//ID role
int RoleID { get; }
string FirstName { get; }
string LastName { get; }
string UserFIO { get; }
string Password { get; }
string PhoneNumber { get; }
string Login { get; }
string Email { get; }
}
}