using BS.Shared;
using BS.Shared.DataContracts;
using System;

namespace BeWo.ViewModel
{
    public class EmployeeAPPCodeVM : AbstractDCMapperVM<EmployeeAPPCodeDC>
    {
        public static string PropertyName_EmployeeCode = "EmployeeCode";

        public static string PropertyName_EmployeeCodeGenDate = "EmployeeCodeGenDate";

        public static string PropertyName_IsChatAktive = "IsChatAktive";

        public static string PropertyName_NotfallStatement = "NotfallStatement";

        private string _EmployeeCode;

        private DateTime _EmployeeCodeGenDate;

        private long? _EmployeeOid;

        private int _IsChatAktive;

        private string _NotfallStatement; 


        public EmployeeAPPCodeVM(EmployeeAPPCodeDC pDC)
            : base(pDC, true)
        {
        }


        public virtual string EmployeeCode
        {
            get { return this._EmployeeCode; }

            set
            {
                if (this.AreDifferent(this._EmployeeCode, value))
                {
                    this._EmployeeCode = value;
                }
            }
        }

        public DateTime EmployeeCodeGenDate
        {
            get { return this._EmployeeCodeGenDate; }

            set
            {
                if (this.AreDifferent(this._EmployeeCodeGenDate, value))
                {
                    this._EmployeeCodeGenDate = value;
                    this.StoreDirtyInformation(this.AreDifferent(this.DataContract.EmployeeCodeGenDate, value), PropertyName_EmployeeCodeGenDate);
                    this.FirePropertyChanged(PropertyName_EmployeeCodeGenDate);
                }
            }
        }

        public virtual long? EmployeeOid
        {
            get
            {
                return this._EmployeeOid;
            }

            set
            {
                if (this.AreDifferent(this._EmployeeOid, value))
                {
                    this._EmployeeOid = value;
                }
            }
        }

        public virtual int IsChatAktive
        {
            get
            {
                return this._IsChatAktive;
            }

            set
            {
                if (this.AreDifferent(this._IsChatAktive, value))
                {
                    this._IsChatAktive = value;
                }
            }
        }

        public virtual string NotfallStatement
        {
            get { return this._NotfallStatement; }

            set
            {
                if (this.AreDifferent(this._NotfallStatement, value))
                {
                    this._NotfallStatement = value;
                }
            }
        }

        protected override void InitByDataContract(EmployeeAPPCodeDC pDataContract)
        {
            this._EmployeeCode = pDataContract.EmployeeCode;
            this._EmployeeCodeGenDate = pDataContract.EmployeeCodeGenDate;
            this._EmployeeOid = pDataContract.EmployeeOid;
            this._IsChatAktive = pDataContract.IsChatAktive;
            _NotfallStatement = pDataContract.NotfallStatement;
        }

        protected override EmployeeAPPCodeDC MapToDataContract(EmployeeAPPCodeDC pDataContract, bool doCommit)
        {
            pDataContract.EmployeeCode = _EmployeeCode;
            pDataContract.EmployeeCodeGenDate = _EmployeeCodeGenDate;
            pDataContract.EmployeeOid = _EmployeeOid;
            pDataContract.IsChatAktive = _IsChatAktive;
            pDataContract.NotfallStatement = _NotfallStatement;

            return pDataContract;
        }
    }
}