You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.7 KiB
79 lines
2.7 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace BBWY.Client.Models
|
|
{
|
|
public class OrderDropShipping : NotifyObject, ICloneable
|
|
{
|
|
public OrderDropShipping()
|
|
{
|
|
PurchaseFreightStr = PurchaseFreight.ToString();
|
|
RelationPurchaseOrderSkuList = new ObservableCollection<RelationPurchaseOrderSku>();
|
|
}
|
|
public long Id { get; set; }
|
|
public string OrderId { get; set; }
|
|
public string BuyerAccount { get => buyerAccount; set { Set(ref buyerAccount, value); } }
|
|
public string SellerAccount { get => sellerAccount; set { Set(ref sellerAccount, value); } }
|
|
public decimal DeliveryFreight { get => deliveryFreight; set { Set(ref deliveryFreight, value); } }
|
|
public string PurchaseOrderId { get => purchaseOrderId; set { Set(ref purchaseOrderId, value); } }
|
|
public string MerchantOrderId { get => merchantOrderId; set { Set(ref merchantOrderId, value); } }
|
|
public Platform PurchasePlatform { get => purchasePlatform; set { Set(ref purchasePlatform, value); } }
|
|
public decimal PurchaseAmount { get => purchaseAmount; set { Set(ref purchaseAmount, value); } }
|
|
|
|
public decimal SkuAmount
|
|
{
|
|
get => skuAmount; set
|
|
{
|
|
if (Set(ref skuAmount, value))
|
|
OnAmountChanged();
|
|
}
|
|
}
|
|
public decimal PurchaseFreight
|
|
{
|
|
get => purchaseFreight; set
|
|
{
|
|
if (Set(ref purchaseFreight, value))
|
|
OnAmountChanged();
|
|
}
|
|
}
|
|
|
|
public string PurchaseFreightStr
|
|
{
|
|
get => purchaseFreightStr; set
|
|
{
|
|
if (Set(ref purchaseFreightStr, value))
|
|
{
|
|
if (decimal.TryParse(purchaseFreightStr, out decimal d))
|
|
PurchaseFreight = d;
|
|
}
|
|
}
|
|
}
|
|
|
|
private string buyerAccount;
|
|
private string sellerAccount;
|
|
private decimal deliveryFreight;
|
|
private string purchaseOrderId;
|
|
private string merchantOrderId;
|
|
private Platform purchasePlatform;
|
|
private decimal purchaseAmount;
|
|
private decimal skuAmount;
|
|
private decimal purchaseFreight;
|
|
private string purchaseFreightStr;
|
|
|
|
private void OnAmountChanged()
|
|
{
|
|
PurchaseAmount = SkuAmount + PurchaseFreight;
|
|
OnPurchaseAmountChanged?.Invoke();
|
|
}
|
|
|
|
public Action OnPurchaseAmountChanged { get; set; }
|
|
|
|
public object Clone()
|
|
{
|
|
return this.MemberwiseClone();
|
|
}
|
|
|
|
public IList<RelationPurchaseOrderSku> RelationPurchaseOrderSkuList { get; set; }
|
|
}
|
|
}
|
|
|