Пример #1
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;
            }
        }
Пример #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 KSACitiesBLL MapKSACity(KSACities KSACity)
 {
     try
     {
         KSACitiesBLL KSACityBLL = null;
         if (KSACity != null)
         {
             KSACityBLL = new KSACitiesBLL()
             {
                 KSACityID   = KSACity.KSACityID,
                 KSACityName = KSACity.KSACityName,
                 KSARegion   = new KSARegionsBLL().MapKSARegion(KSACity.KSARegions),
             };
         }
         return(KSACityBLL);
     }
     catch
     {
         throw;
     }
 }