using System.Collections.Generic;

using BS.Shared;

namespace BeWo.Data.Entities
{
    public class Mail : BeWoEntityBase
    {
        public static string PropertyName_AttachmentList = "AttachmentList";

        public static string PropertyName_Mail2Receiver = "Mail2Receiver";

        public static string PropertyName_Message = "Message";

        public static string PropertyName_Sender = "Sender";

        public static string PropertyName_Subject = "Subject";

        private IList<FileAttachmentInfo> _AttachmentList;

        private IList<Mail2Receiver> _Mail2Receiver;

        private string _Message;

        private Employee _Sender;

        private string _Subject;

        public Mail()
        {
            this._Tid = TableID.Mail;
        }

        public virtual IList<FileAttachmentInfo> AttachmentList
        {
            get
            {
                return this._AttachmentList ?? (this._AttachmentList = new List<FileAttachmentInfo>());
            }

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

        public virtual string Message
        {
            get
            {
                return this._Message;
            }

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

        public virtual IList<Mail2Receiver> ReceiverList
        {
            get
            {
                return this._Mail2Receiver ?? (this._Mail2Receiver = new List<Mail2Receiver>());
            }

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

        public virtual Employee Sender
        {
            get
            {
                return this._Sender;
            }

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

        public virtual string Subject
        {
            get
            {
                return this._Subject;
            }

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

        public override string ToString()
        {
            return this.Subject;
        }
    }
}