Fix
This commit is contained in:
parent
2cc83f06cb
commit
50e7193a47
@ -97,7 +97,6 @@ namespace ComputerStoreBusinessLogic.BusinessLogic
|
||||
if (model == null) { return; }
|
||||
if (!withParams) { return; }
|
||||
if (model.Price <= 0) { throw new ArgumentNullException("Invalid consignment's price", nameof(model)); }
|
||||
if (string.IsNullOrEmpty(model.OrderID.ToString())) { throw new ArgumentNullException("Invalid Consignment's order ID", nameof(model)); }
|
||||
|
||||
_logger.LogInformation("Consignment. Consignment ID:{ ID}. Order ID:{ OrderID}.", model.ID, model.OrderID);
|
||||
}
|
||||
|
@ -97,7 +97,6 @@ namespace ComputerStoreBusinessLogic.BusinessLogic
|
||||
if (model == null) { return; }
|
||||
if (!withParams) { return; }
|
||||
if (model.Price <= 0) { throw new ArgumentNullException("Invalid request's price", nameof(model)); }
|
||||
if (string.IsNullOrEmpty(model.OrderID.ToString())) { throw new ArgumentNullException("Invalid Request's order ID", nameof(model)); }
|
||||
|
||||
_logger.LogInformation("Request. Request ID:{ ID}. Order ID: { OrderID}. PC ID: { PCID}", model.ID, model.OrderID, model.PCID);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ namespace ComputerStoreContracts.BindingModels
|
||||
public class ConsignmentBindingModel : IConsignmentModel
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int OrderID { get; set; }
|
||||
public int? OrderID { get; set; }
|
||||
public double Price { get; set; }
|
||||
public Dictionary<int, (IProductModel, int)> ConsignmentProducts { get; set; } = new();
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ namespace ComputerStoreContracts.BindingModels
|
||||
public class RequestBindingModel : IRequestModel
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int OrderID { get; set; }
|
||||
public int? OrderID { get; set; }
|
||||
public double Price { get; set; }
|
||||
public int? PCID { get; set; }
|
||||
|
||||
|
@ -13,7 +13,7 @@ namespace ComputerStoreContracts.ViewModels
|
||||
[DisplayName("Consignment ID")]
|
||||
public int ID { get; set; }
|
||||
[DisplayName("Order ID")]
|
||||
public int OrderID { get; set; }
|
||||
public int? OrderID { get; set; }
|
||||
[DisplayName("Price")]
|
||||
public double Price { get; set; }
|
||||
|
||||
|
@ -13,7 +13,7 @@ namespace ComputerStoreContracts.ViewModels
|
||||
[DisplayName("Request ID")]
|
||||
public int ID { get; set; }
|
||||
[DisplayName("Order ID")]
|
||||
public int OrderID { get; set; }
|
||||
public int? OrderID { get; set; }
|
||||
[DisplayName("Price")]
|
||||
public double Price { get; set; }
|
||||
|
||||
|
@ -8,7 +8,7 @@ namespace ComputerStoreDataModels.Models
|
||||
{
|
||||
public interface IConsignmentModel : IID
|
||||
{
|
||||
int OrderID { get; }
|
||||
int? OrderID { get; }
|
||||
double Price { get; }
|
||||
Dictionary<int, (IProductModel, int)> ConsignmentProducts { get; }
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ namespace ComputerStoreDataModels.Models
|
||||
{
|
||||
public interface IRequestModel : IID
|
||||
{
|
||||
int OrderID { get; }
|
||||
int? OrderID { get; }
|
||||
int? PCID { get; }
|
||||
double Price { get; }
|
||||
|
||||
|
@ -16,8 +16,7 @@ namespace ComputerStoreDatabaseImplement.Models
|
||||
{
|
||||
public int ID { get; private set; }
|
||||
|
||||
[Required]
|
||||
public int OrderID { get; private set; }
|
||||
public int? OrderID { get; private set; }
|
||||
public virtual Order Order { get; set; }
|
||||
|
||||
[Required]
|
||||
@ -68,6 +67,7 @@ namespace ComputerStoreDatabaseImplement.Models
|
||||
return;
|
||||
}
|
||||
Price = model.Price;
|
||||
OrderID = model.OrderID;
|
||||
}
|
||||
public ConsignmentViewModel GetViewModel => new()
|
||||
{
|
||||
|
@ -19,8 +19,7 @@ namespace ComputerStoreDatabaseImplement.Models
|
||||
{
|
||||
public int ID { get; private set; }
|
||||
|
||||
[Required]
|
||||
public int OrderID { get; private set; }
|
||||
public int? OrderID { get; private set; }
|
||||
public virtual Order Order { get; set; }
|
||||
|
||||
public int? PCID { get; private set; }
|
||||
@ -61,6 +60,7 @@ namespace ComputerStoreDatabaseImplement.Models
|
||||
}
|
||||
Price = model.Price;
|
||||
PCID = model.PCID;
|
||||
OrderID = model.OrderID;
|
||||
RequestComponents = model.RequestComponents;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user