64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
using Newtonsoft.Json;
|
|
using Nop.Plugin.Misc.AuctionPlugin.Domains.Dtos;
|
|
using Nop.Web.Framework.Models;
|
|
using Nop.Web.Framework.Mvc.ModelBinding;
|
|
using Nop.Web.Models.Catalog;
|
|
|
|
namespace Nop.Plugin.Misc.AuctionPlugin.Models
|
|
{
|
|
public record LiveScreenViewModel : BaseNopModel
|
|
{
|
|
|
|
[JsonIgnore]
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public AuctionDto AuctionDto { get; set; }
|
|
|
|
[JsonIgnore]
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
|
public ProductToAuctionDto FirstProductToAuction { get; set; }
|
|
|
|
public ProductDetailsModel ProductDetails { get; set; }
|
|
|
|
public int ProductId { get; set; }
|
|
|
|
public int ProductToAuctionId { get; set; }
|
|
public bool IsAdmin { get; set; }
|
|
public bool IsGuest { get; set; }
|
|
|
|
public int AuctionId { get; set; }
|
|
public bool IsItemActive { get; set; }
|
|
public int CustomerId { get; set; }
|
|
|
|
public string WidgetZone { get; set; }
|
|
|
|
|
|
#region debug fields to be removed
|
|
|
|
public decimal? BasePrice { get; set; }
|
|
|
|
#endregion
|
|
|
|
#region visible
|
|
public decimal LicitStep { get; set; }
|
|
public decimal? CurrentPrice { get; set; }
|
|
public decimal BidPrice { get; set; }
|
|
|
|
#endregion visible
|
|
|
|
public LiveScreenViewModel() { }
|
|
|
|
public LiveScreenViewModel(AuctionDto auctionDto) : this()
|
|
{
|
|
AuctionDto = auctionDto;
|
|
FirstProductToAuction = AuctionDto.ProductToAuctionDtos.First();
|
|
|
|
AuctionId = auctionDto.Id;
|
|
ProductId = FirstProductToAuction.ProductId;
|
|
ProductToAuctionId = FirstProductToAuction.Id;
|
|
IsItemActive = FirstProductToAuction.IsActiveItem;
|
|
}
|
|
|
|
|
|
}
|
|
}
|