using System;
using System.Collections;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.Collections.Generic;

namespace RDH.Data.Models
{
	[Serializable]
	[DataContract]
	public partial class Item : BaseSnapshotModel// IModel , INotifyPropertyChanged
    {
        private Guid _snapshotkey;
        private DateTime _starttime;
        private DateTime? _endtime;
        private Guid? _createby;
        private string _itemid;
        private string _barcode;
        private string _itemcommonname;
        private string _itembrandname;
        private string _pinyinname;
        private bool _isactive;
        private bool _isdelete;
        private string _itemtype;
        private bool _ismedcine;
        private bool _issupply;
        private string _standard;
        private string _dosagecode;
        private string _dosagename;
        private Decimal? _weight;
        private Decimal? _volumn;
        private string _weightunit;
        private string _volumnunit;
        private string _useunit;
        private string _packstandard;
        private Decimal? _packsize;
        private string _packunit;
        private string _manufactory;
        private Guid? _key;
        private bool? _flag;
        private DateTime? _clienttime;
        private DateTime? _servertime;
        private string _ext01;
        private string _ext02;
        private string _ext03;
        private string _ext04;
        private string _ext05;
        private string _ext06;
        private string _ext07;
        private string _ext08;
        private string _ext09;
        private string _ext10;
        private string _chargetype;
        private List<ItemLot> _listItemLots;
        private Int32 _configedCount;

		#region Public Properties

        [DataMember]
        public virtual Guid SnapshotKey
        {
            get { return _snapshotkey; }
            set 
            {
                _snapshotkey = value;
                OnPropertyChanged("SnapshotKey");
            }
        }
        [DataMember]
        public virtual DateTime StartTime
        {
            get { return _starttime; }
            set 
            {
                _starttime = value;
                OnPropertyChanged("StartTime");
            }
        }
        [DataMember]
        public virtual DateTime? EndTime
        {
            get { return _endtime; }
            set 
            {
                _endtime = value;
                OnPropertyChanged("EndTime");
                EndFlag = value == null ? 0 : 1;
            }
        }
        [DataMember]
        public virtual Guid? CreateBy
        {
            get { return _createby; }
            set 
            {
                _createby = value;
                OnPropertyChanged("CreateBy");
            }
        }
        [DataMember]
        public virtual string ItemId
        {
            get { return _itemid; }
            set 
            {
                _itemid = value;
                OnPropertyChanged("ItemId");
            }
        }
        [DataMember]
        public virtual string BarCode
        {
            get { return _barcode; }
            set 
            {
                _barcode = value;
                OnPropertyChanged("BarCode");
            }
        }
        [DataMember]
        public virtual string ItemCommonName
        {
            get { return _itemcommonname; }
            set 
            {
                _itemcommonname = value;
                OnPropertyChanged("ItemCommonName");
            }
        }
        [DataMember]
        public virtual string ItemBrandName
        {
            get { return _itembrandname; }
            set 
            {
                _itembrandname = value;
                OnPropertyChanged("ItemBrandName");
            }
        }
        [DataMember]
        public virtual string PinYinName
        {
            get { return _pinyinname; }
            set 
            {
                _pinyinname = value;
                OnPropertyChanged("PinYinName");
            }
        }
        [DataMember]
        public virtual bool IsActive
        {
            get { return _isactive; }
            set 
            {
                _isactive = value;
                OnPropertyChanged("IsActive");
            }
        }
        [DataMember]
        public virtual bool IsDelete
        {
            get { return _isdelete; }
            set 
            {
                _isdelete = value;
                OnPropertyChanged("IsDelete");
            }
        }
        [DataMember]
        public virtual string ItemType
        {
            get { return _itemtype; }
            set 
            {
                _itemtype = value;
                OnPropertyChanged("ItemType");
            }
        }
        [DataMember]
        public virtual bool IsMedcine
        {
            get { return _ismedcine; }
            set 
            {
                _ismedcine = value;
                OnPropertyChanged("IsMedcine");
            }
        }
        [DataMember]
        public virtual bool IsSupply
        {
            get { return _issupply; }
            set 
            {
                _issupply = value;
                OnPropertyChanged("IsSupply");
            }
        }
        [DataMember]
        public virtual string Standard
        {
            get { return _standard; }
            set 
            {
                _standard = value;
                OnPropertyChanged("Standard");
            }
        }
        [DataMember]
        public virtual string DosageCode
        {
            get { return _dosagecode; }
            set 
            {
                _dosagecode = value;
                OnPropertyChanged("DosageCode");
            }
        }
        [DataMember]
        public virtual string DosageName
        {
            get { return _dosagename; }
            set 
            {
                _dosagename = value;
                OnPropertyChanged("DosageName");
            }
        }
        [DataMember]
        public virtual Decimal? Weight
        {
            get { return _weight; }
            set 
            {
                _weight = value;
                OnPropertyChanged("Weight");
            }
        }
        [DataMember]
        public virtual Decimal? Volumn
        {
            get { return _volumn; }
            set 
            {
                _volumn = value;
                OnPropertyChanged("Volumn");
            }
        }
        [DataMember]
        public virtual string WeightUnit
        {
            get { return _weightunit; }
            set 
            {
                _weightunit = value;
                OnPropertyChanged("WeightUnit");
            }
        }
        [DataMember]
        public virtual string VolumnUnit
        {
            get { return _volumnunit; }
            set 
            {
                _volumnunit = value;
                OnPropertyChanged("VolumnUnit");
            }
        }
        [DataMember]
        public virtual string UseUnit
        {
            get { return _useunit; }
            set 
            {
                _useunit = value;
                OnPropertyChanged("UseUnit");
            }
        }
        [DataMember]
        public virtual string PackStandard
        {
            get { return _packstandard; }
            set 
            {
                _packstandard = value;
                OnPropertyChanged("PackStandard");
            }
        }
        [DataMember]
        public virtual Decimal? PackSize
        {
            get { return _packsize; }
            set 
            {
                _packsize = value;
                OnPropertyChanged("PackSize");
            }
        }
        [DataMember]
        public virtual string PackUnit
        {
            get { return _packunit; }
            set 
            {
                _packunit = value;
                OnPropertyChanged("PackUnit");
            }
        }
        [DataMember]
        public virtual string Manufactory
        {
            get { return _manufactory; }
            set 
            {
                _manufactory = value;
                OnPropertyChanged("Manufactory");
            }
        }
        [DataMember]
        public virtual Guid? Key
        {
            get { return _key; }
            set 
            {
                _key = value;
                OnPropertyChanged("Key");
            }
        }
        [DataMember]
        public virtual bool? Flag
        {
            get { return _flag; }
            set 
            {
                _flag = value;
                OnPropertyChanged("Flag");
            }
        }
        [DataMember]
        public virtual DateTime? ClientTime
        {
            get { return _clienttime; }
            set 
            {
                _clienttime = value;
                OnPropertyChanged("ClientTime");
            }
        }
        [DataMember]
        public virtual DateTime? ServerTime
        {
            get { return _servertime; }
            set 
            {
                _servertime = value;
                OnPropertyChanged("ServerTime");
            }
        }
        [DataMember]
        public virtual string Ext01
        {
            get { return _ext01; }
            set 
            {
                _ext01 = value;
                OnPropertyChanged("Ext01");
            }
        }
        [DataMember]
        public virtual string Ext02
        {
            get { return _ext02; }
            set 
            {
                _ext02 = value;
                OnPropertyChanged("Ext02");
            }
        }
        [DataMember]
        public virtual string Ext03
        {
            get { return _ext03; }
            set 
            {
                _ext03 = value;
                OnPropertyChanged("Ext03");
            }
        }
        [DataMember]
        public virtual string Ext04
        {
            get { return _ext04; }
            set 
            {
                _ext04 = value;
                OnPropertyChanged("Ext04");
            }
        }
        [DataMember]
        public virtual string Ext05
        {
            get { return _ext05; }
            set 
            {
                _ext05 = value;
                OnPropertyChanged("Ext05");
            }
        }
        [DataMember]
        public virtual string Ext06
        {
            get { return _ext06; }
            set 
            {
                _ext06 = value;
                OnPropertyChanged("Ext06");
            }
        }
        [DataMember]
        public virtual string Ext07
        {
            get { return _ext07; }
            set 
            {
                _ext07 = value;
                OnPropertyChanged("Ext07");
            }
        }
        [DataMember]
        public virtual string Ext08
        {
            get { return _ext08; }
            set 
            {
                _ext08 = value;
                OnPropertyChanged("Ext08");
            }
        }
        [DataMember]
        public virtual string Ext09
        {
            get { return _ext09; }
            set 
            {
                _ext09 = value;
                OnPropertyChanged("Ext09");
            }
        }
        [DataMember]
        public virtual string Ext10
        {
            get { return _ext10; }
            set 
            {
                _ext10 = value;
                OnPropertyChanged("Ext10");
            }
        }
        [DataMember]
        public virtual string ChargeType
        {
            get { return _chargetype; }
            set 
            {
                _chargetype = value;
                OnPropertyChanged("ChargeType");
            }
        }
        public List<ItemLot> ListItemLots 
        {
            get { return _listItemLots; }
            set 
            {
                _listItemLots = value;
                OnPropertyChanged("ListItemLots");
            }    
        }
        public Int32 ConfigedCount
        {
            get { return _configedCount; }
            set 
            {
                _configedCount = value;
                OnPropertyChanged(nameof(ConfigedCount));
            }
        }
        #endregion
        public override string ToString()
        {
            return String.Concat(this._itemcommonname, "|", this._standard);
        }
    }
	
}