Mb not done

This commit is contained in:
Игорь Гордеев 2024-04-29 19:34:14 +04:00
parent d934652b6c
commit 4a958769f0
7 changed files with 12 additions and 3 deletions

View File

@ -11,6 +11,7 @@ namespace ElectronicsShopContracts.BindingModels
public class OrderBindingModel : IOrderModel
{
public int ID { get; set; }
public int UserID { get; set; }
public double Sum { get; set; }

View File

@ -10,6 +10,7 @@ namespace ElectronicsShopContracts.SearchModels
public class OrderSearchModel
{
public int? ID { get; set; }
public int? UserID { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set;}
}

View File

@ -12,6 +12,8 @@ namespace ElectronicsShopContracts.ViewModels
public class OrderViewModel : IOrderModel
{
public int ID { get; set; }
[DisplayName("Клиент ID")]
public int UserID { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }

View File

@ -11,7 +11,7 @@ namespace ElectronicsShopDataBaseImplement
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=ZooDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-E2VPEN3\SQLEXPRESS;Initial Catalog=ElectronicsShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}

View File

@ -19,6 +19,8 @@ namespace ElectronicsShopDataBaseImplement.Models
[Required]
public double Sum { get; set; }
[Required]
public int UserID { get; set; }
[Required]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[Required]
public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно;
@ -51,6 +53,7 @@ namespace ElectronicsShopDataBaseImplement.Models
return new Order()
{
ID = model.ID,
UserID=model.UserID,
Sum = model.Sum,
Status = model.Status,
PaymeantOption = model.PaymeantOption,
@ -69,6 +72,7 @@ namespace ElectronicsShopDataBaseImplement.Models
return;
}
ID = model.ID;
UserID = model.UserID;
Sum = model.Sum;
PaymeantOption = model.PaymeantOption;
Status = model.Status;
@ -83,11 +87,12 @@ namespace ElectronicsShopDataBaseImplement.Models
public OrderViewModel GetViewModel => new()
{
ID = ID,
UserID = UserID,
Sum = Sum,
PaymeantOption = PaymeantOption,
Status = Status,
DateCreate = DateCreate,
DateImplement=DateImplement,
DateImplement = DateImplement,
ProductList = ProductList
};
}

View File

@ -10,6 +10,7 @@ namespace ElectronicsShopDataModels.Models
public interface IOrderModel : IID
{
double Sum { get; }
int UserID { get; }
OrderStatus Status { get; }
PaymeantOption PaymeantOption { get; }
DateTime DateCreate { get; }

View File

@ -11,7 +11,6 @@ namespace ElectronicsShopDataModels
//ID role
int RoleID { get; }
string FirstName { get; }
string LastName { get; }
string Password { get; }