Esempio n. 1
0
        private CountriesViewModel GetByCountryID(int id)
        {
            CountriesBLL CountriesBLL = new HCMBLL.CountriesBLL();

            CountriesBLL = CountriesBLL.GetByCountryID(id);
            CountriesViewModel CountryVM = new CountriesViewModel();

            if (CountriesBLL != null)
            {
                CountryVM.CountryID   = CountriesBLL.CountryID;
                CountryVM.CountryName = CountriesBLL.CountryName;
            }
            return(CountryVM);
        }
Esempio n. 2
0
        internal BaseDelegationsBLL MapDelegation(Delegations Delegation)
        {
            try
            {
                BaseDelegationsBLL DelegationBLL = null;
                if (Delegation != null)
                {
                    KSACitiesBLL KSACity1 = Delegation.KSACities != null ? new KSACitiesBLL().MapKSACity(Delegation.KSACities) : null;
                    CountriesBLL Country1 = Delegation.Countries != null ? new CountriesBLL().MapCountry(Delegation.Countries) : null;
                    if (Delegation.DelegationTypeID == (Int32)DelegationsTypesEnum.Internal)
                    {
                        DelegationBLL = new InternalDelegationBLL()
                        {
                            KSACity = KSACity1,
                            DelegationDestination = KSACity1.KSACityName + "-" + KSACity1.KSARegion.KSARegionName
                        };
                    }
                    else if (Delegation.DelegationTypeID == (Int32)DelegationsTypesEnum.External)
                    {
                        DelegationBLL = new ExternalDelegationBLL()
                        {
                            Country = Country1,
                            DelegationDestination = Country1.CountryName
                        };
                    }

                    DelegationBLL.DelegationID        = Delegation.DelegationID;
                    DelegationBLL.DelegationKind      = new DelegationsKindsBLL().MapDelegationKind(Delegation.DelegationsKinds);
                    DelegationBLL.DelegationType      = new DelegationsTypesBLL().MapDelegationType(Delegation.DelegationsTypes);
                    DelegationBLL.DelegationStartDate = Delegation.DelegationStartDate.Date;
                    DelegationBLL.DelegationEndDate   = Delegation.DelegationEndDate.Date;
                    DelegationBLL.DelegationReason    = Delegation.DelegationReason;
                    DelegationBLL.Notes = Delegation.Notes;
                    DelegationBLL.DelegationDistancePeriod = Delegation.DelegationDistancePeriod;
                    DelegationBLL.CreatedBy    = new EmployeesCodesBLL().MapEmployeeCode(Delegation.CreatedByNav);
                    DelegationBLL.CreatedDate  = Delegation.CreatedDate;
                    DelegationBLL.IsApproved   = Delegation.IsApproved;
                    DelegationBLL.ApprovedBy   = Delegation.ApprovedBy;
                    DelegationBLL.ApprovedDate = Delegation.ApprovedDate;
                    //DelegationBLL.LastUpdatedBy = new EmployeesCodesBLL().MapEmployeeCode(Delegation.EmployeesCodes1);
                    //DelegationBLL.LastUpdatedDate = Delegation.LastUpdatedDate;
                }
                return(DelegationBLL);
            }
            catch
            {
                throw;
            }
        }
Esempio n. 3
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;
            }
        }
Esempio n. 4
0
 internal CountriesBLL MapCountry(Countries Country)
 {
     try
     {
         CountriesBLL CountryBLL = null;
         if (Country != null)
         {
             CountryBLL = new CountriesBLL()
             {
                 CountryID   = Country.CountryID,
                 CountryName = Country.CountryName
             };
         }
         return(CountryBLL);
     }
     catch
     {
         throw;
     }
 }