예제 #1
0
        public BaseInternshipScholarshipsBLL GetByInternshipScholarshipID(int InternshipScholarshipID)
        {
            BaseInternshipScholarshipsBLL InternshipScholarshipBLL = null;
            InternshipScholarships        InternshipScholarship    = new InternshipScholarshipsDAL().GetByInternshipScholarshipID(InternshipScholarshipID);

            if (InternshipScholarship != null)
            {
                InternshipScholarshipBLL = MapInternshipScholarship(InternshipScholarship);
            }

            return(InternshipScholarshipBLL);
        }
예제 #2
0
        internal BaseInternshipScholarshipsBLL MapInternshipScholarship(InternshipScholarships InternshipScholarship)
        {
            try
            {
                BaseInternshipScholarshipsBLL InternshipScholarshipBLL = null;
                if (InternshipScholarship != null)
                {
                    KSACitiesBLL KSACity1 = InternshipScholarship.KSACities != null ? new KSACitiesBLL().MapKSACity(InternshipScholarship.KSACities) : null;
                    CountriesBLL Country1 = InternshipScholarship.Countries != null ? new CountriesBLL().MapCountry(InternshipScholarship.Countries) : null;
                    if (InternshipScholarship.InternshipScholarshipTypeID == (Int32)InternshipScholarshipsTypesEnum.Internal)
                    {
                        InternshipScholarshipBLL = new InternalInternshipScholarshipsBLL()
                        {
                            KSACity = KSACity1,
                        };
                    }
                    else if (InternshipScholarship.InternshipScholarshipTypeID == (int)InternshipScholarshipsTypesEnum.External)
                    {
                        InternshipScholarshipBLL = new ExternalInternshipScholarshipsBLL()
                        {
                            Country = Country1,
                        };
                    }

                    InternshipScholarshipBLL.InternshipScholarshipID        = InternshipScholarship.InternshipScholarshipID;
                    InternshipScholarshipBLL.InternshipScholarshipType      = new InternshipScholarshipsTypesBLL().MapInternshipScholarshipType(InternshipScholarship.InternshipScholarshipsTypes);
                    InternshipScholarshipBLL.InternshipScholarshipStartDate = InternshipScholarship.InternshipScholarshipStartDate;
                    InternshipScholarshipBLL.InternshipScholarshipEndDate   = InternshipScholarship.InternshipScholarshipEndDate;
                    InternshipScholarshipBLL.InternshipScholarshipReason    = InternshipScholarship.InternshipScholarshipReason;
                    InternshipScholarshipBLL.InternshipScholarshipLocation  = InternshipScholarship.InternshipScholarshipLocation;
                    InternshipScholarshipBLL.CreatedBy   = new EmployeesCodesBLL().MapEmployeeCode(InternshipScholarship.CreatedByNav);
                    InternshipScholarshipBLL.CreatedDate = InternshipScholarship.CreatedDate;
                    //InternshipScholarshipBLL.LastUpdatedBy = new EmployeesCodesBLL().MapEmployeeCode(InternshipScholarship.EmployeesCodes1);
                    //InternshipScholarshipBLL.LastUpdatedDate = InternshipScholarship.LastUpdatedDate;
                }
                return(InternshipScholarshipBLL);
            }
            catch
            {
                throw;
            }
        }
예제 #3
0
        public static Result IsNoConflictWithOtherProcess(int EmployeeCodeID, DateTime StartDate, DateTime EndDate, params BusinessSubCategoriesEnum[] ExcludeBusinessSubCategories)
        {
            Result result = null;

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.InternshipScholarships) == false)
            {
                #region Validaion for conflict with InternshipScholarship
                List <BaseInternshipScholarshipsBLL> BaseInternshipScholarshipBLLList = new BaseInternshipScholarshipsBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                if (BaseInternshipScholarshipBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithInternshipScholarship.ToString();
                    return(result);
                }
                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.OverTimes) == false)
            {
                #region Validaion for conflict with Overtime
                List <OverTimesBLL> OverTimesBLLList = new OverTimesBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                OverTimesBLL        nn = new OverTimesBLL();
                if (OverTimesBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithOverTime.ToString();
                    result.Entity     = nn;
                    return(result);
                }

                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.Delegations) == false)
            {
                #region Validaion for conflict with Delegation
                List <BaseDelegationsBLL> DelegationsBLLList = new BaseDelegationsBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                if (DelegationsBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithDelegation.ToString();
                    return(result);
                }

                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.Vacations) == false)
            {
                #region Validaion for conflict with vacation
                List <BaseVacationsBLL> VacationsBLLList = new BaseVacationsBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                if (VacationsBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithVacation.ToString();
                    return(result);
                }
                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.StopWork) == false)
            {
                #region Validaion for conflict with StopWorks
                List <StopWorksBLL> StopWorksBLLList = new StopWorksBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                if (StopWorksBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithStopWork.ToString();
                    return(result);
                }
                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.Scholarships) == false)
            {
                #region Validaion for conflict with Scholarship
                List <BaseScholarshipsBLL> BaseScholarshipsBLLList = new BaseScholarshipsBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                if (BaseScholarshipsBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithScholarship.ToString();
                    return(result);
                }
                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.Lenders) == false)
            {
                #region Validaion for conflict with Lenders
                List <LendersBLL> LendersBLLList = new LendersBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                if (LendersBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithLender.ToString();
                    return(result);
                }
                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.Assignings) == false)
            {
                #region Validaion for conflict with External Assigning
                List <ExternalAssigningBLL> ExternalAssigningBLLList = new ExternalAssigningBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                if (ExternalAssigningBLLList.Count() != 0)
                {
                    result            = new Result();
                    result.EnumType   = typeof(NoConflictWithOtherProcessValidationEnum);
                    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithExternalAssigning.ToString();
                    return(result);
                }
                #endregion
            }

            if (ExcludeBusinessSubCategories.Contains(BusinessSubCategoriesEnum.Teachers) == false)
            {
                #region Validaion for conflict with Teachers
                //List<TeachersBLL> TeachersBLLList = new TeachersBLL().GetByEmployeeCodeID(EmployeeCodeID, StartDate, EndDate);
                //if (TeachersBLLList.Count() != 0)
                //{
                //    result = new Result();
                //    result.EnumType = typeof(NoConflictWithOtherProcessValidationEnum);
                //    result.EnumMember = NoConflictWithOtherProcessValidationEnum.RejectedBecauseOfConflictWithTeacher.ToString();
                //    return result;
                //}
                #endregion
            }

            return(result);
        }