using System;
using System.Linq;
using System.Data;


using System.Collections.Generic;


namespace HRM.BO
{
    #region Class TrustyInfo	
    [Serializable]	
    public class TrustyInfo : AuditTrailBase
    {
        

        #region Constructor
        public TrustyInfo()
        {
            Code = string.Empty;
            Name = string.Empty;
            Email = string.Empty;
            Contacts = string.Empty;
            Status = EnumTrustyStatus.None;
            ProjectID = 0;
        }
        #endregion
        
        #region properties
                
        #region Property Code : string
        
        public  string Code
        {
            get;set;
        }

        #endregion

        #region Property Name : string
        
        public string Name
        {
            get; set;
        }

        #endregion

        #region Property Email : string
        
        public string Email
        {
            get; set;
        }

        #endregion Property Email : string

        #region Property Contacts : string
        
        public string Contacts
        {
            get; set;
        }

        #endregion Property Contacts : string

        #region Property Status : TrustyStatusEnum
        
        public EnumTrustyStatus Status
        {
            get; set;
        }

        #endregion Property Status : TrustyStatusEnum

        #region Property ProjectID : ID
        
        public int ProjectID
        {
            get; set;
        }

        #endregion Property ProjectID : ID

        #endregion

        //#region IsInTrustee


        //public bool IsInMinutes(ID trusteeID)
        //{
        //    try
        //    {
        //        return TrustyInfo.Service.IsInMinutes(trusteeID);
        //    }
        //    catch (ServiceException e)
        //    {
        //        throw new ServiceException(e.Message, e);
        //    }
        //}
        //#endregion


        //#region IsExist
        //public static bool IsExist(string sCode)
        //{
        //    try
        //    {
        //        return TrustyInfo.Service.IsExist(sCode);
        //    }
        //    catch (ServiceException e)
        //    {
        //        throw new ServiceException(e.Message, e);
        //    }
        //} 
        //#endregion

        //#region Validation Function

        //public bool Validate(ref string sMessage, ref int messageNumber)
        //{
        //    if (this.Code == string.Empty)
        //    {
        //        sMessage = "Trustee code can not be empty";
        //        messageNumber = 1;
        //        return false;
        //    }
        //    if (this.IsNew)
        //    {
        //        if (TrustyInfo.IsExist(this.Code))
        //        {
        //            sMessage = "Duplicate code";
        //            messageNumber = 2;
        //            return false;
        //        }
        //    }
        //    if (this.Name == string.Empty)
        //    {
        //        sMessage = "Trustee name can not be empty";
        //        messageNumber = 3;
        //        return false;
        //    }

        //    if (this.Email == string.Empty)
        //    {
        //        sMessage = "Email address can not be empty";
        //        messageNumber = 5;
        //        return false;
        //    }
        //    if (this.Contacts == string.Empty)
        //    {
        //        sMessage = "Trustee contact address can not be empty";
        //        messageNumber = 6;
        //        return false;
        //    }
        //    if (this.Status == EnumTrustyStatus.None)
        //    {
        //        sMessage = "Trustee status can not be None.";
        //        messageNumber = 7;
        //        return false;
        //    }

        //    return true;

        //}
       // #endregion

    }

    #endregion

    #region Interface
    public interface ITrustyInfoService
    {
        void Save(TrustyInfo item);
        void Delete(int id);
        TrustyInfo Get(int id);
        List<TrustyInfo> Get();
        List<TrustyInfo> GetByProjectID(int projectID);
        List<TrustyInfo> GetByStatusAndProjectID(int projectID, EnumTrustyStatus status);
        DataTable GetTable();
        bool IsExist(string sCode);
        List<TrustyInfo> GetbyStatus(int Type);
        bool IsInMinutes(int trusteeID);
    }
    #endregion
}