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


using System.Collections.Generic;


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

        #region ActivityVoucherSetup
        public ActivityVoucherSetup()
        {
            ActivityID = 0;
            ProjectID = 0;
            ProcessID = 0;
            VoucherType = VoucherTypeEnum.None;
            IsMultipleDebit = false;
            IsMultipleCredit = false;
            DebitControl = 0;
            CreditControl = 0;
            DebitHISeq = string.Empty;
            CreditHISeq = string.Empty;
            DrGLID = 0;
            CrGLID = 0;
            DrGLCode = string.Empty;
            CrGLCode = string.Empty;
            TranElementID = 0;
            ActivityRelatedID = 0;
            ActivityRelatedValue = 0;
            ValueQuery = string.Empty;
            SeqNo = 0;
            Status = EnumVoucherSetupStatus.None;
            Version = 0;
            IsReqSubsidiary = false;
            ActivityRelated = null;
            IsReqNewUserRecordForDr = false;
            IsReqNewUserRecordForCr = false;
        }

        public ActivityVoucherSetup(int ProcessID, int ActivityID, int ProjectID, int ActivityRelatedID, int ActivityRelatedValue, int TranElementID)
        {
            ActivityID = 0;
            ProjectID = 0;
            ProcessID = 0;
            VoucherType = VoucherTypeEnum.None;
            IsMultipleDebit = false;
            IsMultipleCredit = false;
            DebitControl = 0;
            CreditControl = 0;
            DebitHISeq = string.Empty;
            CreditHISeq = string.Empty;
            DrGLID = 0;
            CrGLID = 0;
            DrGLCode = string.Empty;
            CrGLCode = string.Empty;
            TranElementID = 0;
            ActivityRelatedID = 0;
            ActivityRelatedValue = 0;
            ValueQuery = string.Empty;
            SeqNo = 0;
            Status = EnumVoucherSetupStatus.None;
            Version = 0;
            IsReqSubsidiary = false;
            ActivityRelated = null;
            IsReqNewUserRecordForDr = false;
            IsReqNewUserRecordForCr = false;
        }
        #endregion

        #region Property
        public int ActivityID { get; set; }

        public int ProjectID { get; set; }

        public int ProcessID { get; set; }

        public VoucherTypeEnum VoucherType { get; set; }

        public bool IsOptional { get; set; }


        public bool IsMultipleDebit { get; set; }

        public bool IsMultipleCredit { get; set; }

        public int DebitControl { get; set; }

        public int CreditControl { get; set; }

        public string DebitHISeq { get; set; }


        public string CreditHISeq { get; set; }

        public int DrGLID { get; set; }

        public int CrGLID { get; set; }


        //private GL _CrGL;
        //public GL CrGL
        //{
        //    get {
        //        if (_CrGL == null)
        //        {
        //            _CrGL = new GL();
        //            _CrGL = _CrGL.Get(Ease.Core.Framework.ID(this.CrGLID));
        //        }
        //        return _CrGL; 
        //    }
        //    set
        //    {
        //        _CrGL = value;
        //    }
        //}


        //private GL _DrGL;
        //public GL DrGL
        //{
        //    get
        //    {
        //        if (_DrGL == null)
        //        {
        //            _DrGL = new GL();
        //            _DrGL = _DrGL.Get(Ease.Core.Framework.ID(this.DrGLID));
        //        }
        //        return _DrGL;
        //    }
        //    set
        //    {
        //        _DrGL = value;
        //    }
        //}


        public string DrGLCode { get; set; }

        public string CrGLCode { get; set; }

        public EnumVoucherSetupStatus Status { get; set; }

        public int Version { get; set; }

        public bool IsReqSubsidiary { get; set; }

        //#region Property SelectedDrGL : string

        //[NonSerialized]
        //private EaseFAS.BO.GL   _selectedDrGL;

        //public EaseFAS.BO.GL SelectedDrGL
        //{
        //    get
        //    {
        //        if (_selectedDrGL == null && _DrGLCode != string.Empty)
        //        {
        //            _selectedDrGL= EaseFAS.BO.GL.Get(_DrGLCode);
        //        }
        //        return _selectedDrGL;
        //    }
        //    set
        //    {
        //        _selectedDrGL = value;
        //        _DrGLID = (_selectedDrGL == null ? null : int(_selectedDrGL.ID) );
        //        _DrGLCode = _selectedDrGL.GLCode;  
        //    }
        //}

        //#endregion

        //#region Property SelectedDrGL : string

        //[NonSerialized]
        //private EaseFAS.BO.GL _selectedCrGL;

        //public EaseFAS.BO.GL SelectedCrGL
        //{
        //    get
        //    {
        //        if (_selectedCrGL == null && _CrGLCode != string.Empty)
        //        {
        //            _selectedCrGL = EaseFAS.BO.GL.Get(_CrGLCode);
        //        }
        //        return _selectedCrGL;
        //    }
        //    set
        //    {
        //        _selectedCrGL = value;
        //        _CrGLID = (_selectedDrGL == null ? null : int(_selectedCrGL.ID) );
        //        _CrGLCode = _selectedCrGL.GLCode;
        //    }
        //}

        //#endregion

        #region Property TranElement : TranElement

        //[NonSerialized]
        //private TranElement _TranElement=null;        
        //public TranElement TranElement
        //{
        //    get
        //    {
        //        if (_TranElement == null && _TranElementID != 0)
        //        {
        //            _TranElement = new TranElement();
        //            _TranElement = TranElement.Get(_TranElementID);
        //        }
        //        return _TranElement;
        //    }
        //    set
        //    {
        //        _TranElement = value;
        //        _TranElementID = (_TranElement == null ? null : _TranElement.ID);
        //    }
        //}

        public int TranElementID { get; set; }

        #endregion

        public string ValueQuery { get; set; }

        public int SeqNo { get; set; }

        #region Property ActivityRelated : ActivityRelatedSource

        public ActivityRelatedSource ActivityRelated { get; set; }

        public int ActivityRelatedID { get; set; }

        #endregion

        public int ActivityRelatedValue { get; set; }

        public bool IsReqNewUserRecordForDr { get; set; }

        public bool IsReqNewUserRecordForCr { get; set; }
        #endregion

    }
    #endregion

    #region IActivityVoucherSetup
    public interface IActivityVoucherSetupService
    {
        void Save(ActivityVoucherSetup ActivityVoucherSetup);
        void Delete(int fundID);
        ActivityVoucherSetup Get(int ID);
        List<ActivityVoucherSetup> GetbyActivityid(int Activityid);
        List<ActivityVoucherSetup> GetbyProjectid(int Projectid);
        List<ActivityVoucherSetup> GetbyProcessid(int Processid);
        List<ActivityVoucherSetup> GetbyProcessidActivityid(int Processid, int Activityid);
        List<ActivityVoucherSetup> GetbyActivityProjectProcessID(int Activityid, int Projectid, int Processid);
        DataTable GetTable();
        List<ActivityVoucherSetup> Get();
        List<ActivityVoucherSetup> Get(string sSearch);
        List<ProcessActivity> GetActivityVoucherSetupByProcessActivityID(int ID);
    }
    #endregion
}