using Com.FirmLib.Entity;
using Com.FirmLib.UI.Common.Model;
using FWindSoft.SystemExtensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Com.FirmLib.UI.Seller.Model
{
    public static class SellerDataConverter
    {
        public static AssetShowItem ConvertShowItem(SellerAssetItem dataItem)
        {
            var showItem = new AssetShowItem();
            showItem.FamilyCode = dataItem.Family;
            showItem.Id = dataItem.Id;
            showItem.LocalName = dataItem.Asset.EquipLocalName;
            showItem.LocalCode = dataItem.Asset.EquipLocalId;
            showItem.Brand = dataItem.Asset.Brand;
            showItem.Product = dataItem.Asset.Product;
            showItem.Type = dataItem.Asset.Specification;

            showItem.AssetNo = dataItem.Asset.AssetId;


            showItem.SellerContractNo = dataItem.Asset.SupplierContractID;
            showItem.ProductionDate = dataItem.Asset.ProductDate;
            showItem.ProcurementPrice = dataItem.Asset.PurchasePrice.ToDouble();
            showItem.Warranty = dataItem.Asset.Warranty.ToDouble();
            showItem.ManufacturingNo = dataItem.Asset.SerialNum;
            return showItem;
        }
    }
}
