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,18 +12,17 @@ namespace ElectronicsShopContracts.BindingModels
{ {
public int ID { get; set; } public int ID { get; set; }
public int UserID { get; set; } public int UserID { get; set; }
public int? ImplementerID { get; set; }
public double Sum { get; set; } public int PaymentID { get; set; }
public double Sum { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно; public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно;
public DateTime DateCreate { get; set; } = DateTime.Now; public DateTime DateCreate { get; set; } = DateTime.Now;
public DateTime? DateImplement { get; set; } public DateTime? DateImplement { get; set; }
public Dictionary<int, (IProductModel, int)> ProductList { get; set; } = new(); public Dictionary<int, (IProductModel, int)> ProductList { get; set; } = new();
} }
} }

View File

@ -8,25 +8,12 @@ using System.Threading.Tasks;
namespace ElectronicsShopContracts.BindingModels namespace ElectronicsShopContracts.BindingModels
{ {
public class UserBindingModel : IUserModel public class UserBindingModel : IUserModel {
{ public int ID { get; set; }
//ID пользователя
public int ID { get; set; }
//ID роли (клиент)
public int RoleID { get; set; }
public int RoleID { get; set; }
public string FirstName { get; set; } = string.Empty; public string UserFIO { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty; public string Login { get; set; } = string.Empty;
}
public string Login { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string PhoneNumber { 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 public interface IOrderLogic
{ {
List<OrderViewModel>? ReadList(OrderSearchModel? model); List<OrderViewModel>? ReadList(OrderSearchModel? model);
OrderViewModel? ReadElement(OrderSearchModel model);
bool CreateOrder(OrderBindingModel model); bool CreateOrder(OrderBindingModel model);
bool TakeOrderInWork(OrderBindingModel model); bool TakeOrderInWork(OrderBindingModel model);

View File

@ -12,7 +12,7 @@ namespace ElectronicsShopContracts.BusinessLogicContracts
public interface IUserLogic public interface IUserLogic
{ {
List<UserViewModel>? ReadList(UserSearchModel? model); List<UserViewModel>? ReadList(UserSearchModel? model);
UserViewModel? ReadElemet(UserSearchModel? model); UserViewModel? ReadElemet(UserSearchModel model);
bool Add(UserBindingModel model); bool Add(UserBindingModel model);
bool Update(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 public interface IOrderModel : IID
{ {
int UserID { get; } int UserID { get; }
int ImplementerID { get; } int? ImplementerID { get; }
int PaymentID { get; } int PaymentID { get; }
OrderStatus OrderStatus { get; } OrderStatus Status { get; }
PaymeantOption PaymeantOption { get; } PaymeantOption PaymeantOption { get; }
DateTime DateCreate { get; } DateTime DateCreate { get; }
DateTime? DateImplement { get; } DateTime? DateImplement { get; }

View File

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