///////////////////////////////////////////////////////////////////////////////
//Copyright (c) 2016, 北京探索者软件公司
//All rights reserved.       
//文件名称: BaseAssetItem.cs
//文件描述: BaseAssetItem.cs
//创 建 者: xls
//创建日期: 2018/5/30 9:11:57
//版 本 号：1.0.0.0
////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Com.FirmLib.UI.Common;
using FWindSoft.Data;

namespace Com.FirmLib.UI
{
    /// <summary>
    /// 资产相关信息
    /// </summary>
    public class BaseAssetItem:BasePropertyChanged
    {
        public BaseAssetItem()
        {
            CacheParameters = new WatchParameters();
        }
        /// <summary>
        /// id值
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 本地名称
        /// </summary>
        public string EquipName { get; set; }

        private string m_LocalName;
        /// <summary>
        ///  本地名称
        /// </summary>
        public string LocalName
        {
            //本地名称为null,则返回设备值
            get { return string.IsNullOrEmpty(this.m_LocalName)?EquipName:this.m_LocalName; }
            set
            {
                this.m_LocalName = value;
                RaisePropertyChanged(() => this.LocalName);
            }
        }


        private string m_LocalCode;
        /// <summary>
        /// 本地编码
        /// </summary>
        public string LocalCode
        {
            get { return this.m_LocalCode; }
            set
            {
                this.m_LocalCode = value;
                RaisePropertyChanged(() => this.LocalCode);
            }
        }


        private string m_Brand;
        /// <summary>
        /// 品牌
        /// </summary>
        public string Brand
        {
            get { return this.m_Brand; }
            set
            {
                this.m_Brand = value;
                RaisePropertyChanged(() => this.Brand);
            }
        }


        private string m_Product;
        /// <summary>
        /// 产品
        /// </summary>
        public string Product
        {
            get
            {
                if (!string.IsNullOrWhiteSpace(TypeId) && string.IsNullOrWhiteSpace(this.m_Product))
                {
                    m_Product = ProductTypeManager.GetProductName(TypeId);
                }

                return this.m_Product;
            }
            set
            {
                this.m_Product = value;
                RaisePropertyChanged(() => this.Product);
            }
        }


        private string m_Type;
        /// <summary>
        /// 型号
        /// </summary>
        public string Type
        {
            get
            {              
                return this.m_Type;
            }
            set
            {
                this.m_Type = value;
                RaisePropertyChanged(() => this.Type);
            }
        }

        /// <summary>
        /// 关联的类型Id
        /// </summary>
        public string TypeId { get; set; }
        #region 厂商id
        /// <summary>
        /// 生产商Id
        /// </summary>
        public string ManufacturerId { get; set; }
        /// <summary>
        /// 保险商id
        /// </summary>
        public string InsuerId { get; set; }
        /// <summary>
        /// 供应商id
        /// </summary>
        public string SellerId { get; set; }
        /// <summary>
        /// 维修商Id
        /// </summary>
        public string MaintainerId { get; set; }
        #endregion

        #region 缓存信息
        public WatchParameters CacheParameters { get; private set; }
        #endregion
    }
}
