using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace RDH.Data.Models
{
    [Serializable]
    [DataContract]
    public partial class StorageSpaceItem : BaseSnapshotModel// IModel , INotifyPropertyChanged
    {

        private bool _bIsDeleted;
        private bool _bIsChanged;
        private Guid _snapshotkey;
        private Guid? _key;
        private Guid? _storagespacekey;
        private DateTime? _starttime;
        private DateTime? _endtime;
        private Decimal? _maxquantity;
        private Decimal? _alartquantity;
        private Decimal? _currentquantity;
        private Guid? _createby;
        private DateTime? _createtime;
        private bool? _isallowmultilot;
        private Guid? _itemkey;
        private Guid? _devicekey;
        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 StorageSpace _storagespace;
        private List<StorageSpaceItemLot> _listItemLots;
        private DispensingDevice _dispensingdevice;
        private Item _item;

        #region Public Properties

        [DataMember]
        public virtual Guid SnapshotKey
        {
            get { return _snapshotkey; }
            set
            {
                _snapshotkey = value;
                OnPropertyChanged("SnapshotKey");
            }
        }
        [DataMember]
        public virtual Guid? Key
        {
            get { return _key; }
            set
            {
                _key = value;
                OnPropertyChanged("Key");
            }
        }
        [DataMember]
        public virtual Guid? StorageSpaceKey
        {
            get { return _storagespacekey; }
            set
            {
                _storagespacekey = value;
                OnPropertyChanged("StorageSpaceKey");
            }
        }
        [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 Decimal? MaxQuantity
        {
            get { return _maxquantity; }
            set
            {
                _maxquantity = value;
                OnPropertyChanged("MaxQuantity");
            }
        }
        [DataMember]
        public virtual Decimal? AlartQuantity
        {
            get { return _alartquantity; }
            set
            {
                _alartquantity = value;
                OnPropertyChanged("AlartQuantity");
            }
        }
        [DataMember]
        public virtual Decimal? CurrentQuantity
        {
            get { return _currentquantity; }
            set
            {
                _currentquantity = value;
                OnPropertyChanged("CurrentQuantity");
            }
        }
        [DataMember]
        public virtual Guid? CreateBy
        {
            get { return _createby; }
            set
            {
                _createby = value;
                OnPropertyChanged("CreateBy");
            }
        }
        [DataMember]
        public virtual DateTime? CreateTime
        {
            get { return _createtime; }
            set
            {
                _createtime = value;
                OnPropertyChanged("CreateTime");
            }
        }
        [DataMember]
        public virtual bool? IsAllowMultiLot
        {
            get { return _isallowmultilot; }
            set
            {
                _isallowmultilot = value;
                OnPropertyChanged("IsAllowMultiLot");
            }
        }
        [DataMember]
        public virtual Guid? ItemKey
        {
            get { return _itemkey; }
            set
            {
                _itemkey = value;
                OnPropertyChanged("ItemKey");
            }
        }
        [DataMember]
        public virtual Guid? DeviceKey
        {
            get { return _devicekey; }
            set
            {
                _devicekey = value;
                OnPropertyChanged("DeviceKey");
            }
        }
        [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 StorageSpace StorageSpace
        {
            get { return _storagespace; }
            set
            {
                _storagespace = value;
                OnPropertyChanged("StorageSpace");
            }
        }
        [DataMember]
        public DispensingDevice DispensingDevice
        {
            get { return _dispensingdevice; }
            set
            {
                _dispensingdevice = value;
                OnPropertyChanged("DispensingDevice");
            }
        }
        [DataMember]
        public Item Item
        {
            get { return _item; }
            set
            {
                _item = value;
                OnPropertyChanged("Item");
            }
        }
        public List<StorageSpaceItemLot> ListItemLots
        {
            get { return _listItemLots; }
            set
            {
                _listItemLots = value;
                OnPropertyChanged(nameof(ListItemLots));
            }
        }
        #endregion
        public StorageSpaceItem Clone()
        {
            return new StorageSpaceItem()
            {
                _alartquantity = this._alartquantity,
                _bIsChanged = this._bIsChanged,
                _bIsDeleted = this._bIsDeleted,
                _clienttime = this._clienttime,
                _createby = this._createby,
                _createtime = this._createtime,
                _currentquantity = this._currentquantity,
                _devicekey = this._devicekey,
                _dispensingdevice = this._dispensingdevice,
                _endtime = this._endtime,
                _ext01 = this._ext01,
                _ext02 = this._ext02,
                _ext03 = this._ext03,
                _ext04 = this._ext04,
                _ext05 = this._ext05,
                _ext06 = this._ext06,
                _ext07 = this._ext07,
                _ext08 = this._ext08,
                _ext09 = this._ext09,
                _ext10 = this._ext10,
                _flag = this._flag,
                _isallowmultilot = this._isallowmultilot,
                _item = this._item,
                _itemkey = this._itemkey,
                _key = this._key,
                _maxquantity = this._maxquantity,
                _servertime = this._servertime,
                _snapshotkey = this._snapshotkey,
                _starttime = this._starttime,
                _storagespace = this._storagespace,
                _storagespacekey = this._storagespacekey,
            };
        }

    }

}
