internal BaseScholarshipsBLL MapScholarship(Scholarships Scholarship) { try { BaseScholarshipsBLL BaseScholarshipBLL = null; if (Scholarship != null) { if (Scholarship.ScholarshipTypeID == Convert.ToInt16(ScholarshipsTypesEnum.Internal)) { BaseScholarshipBLL = GenericFactoryPattern <BaseScholarshipsBLL, InternalScholarshipsBLL> .CreateInstance(); ((InternalScholarshipsBLL)BaseScholarshipBLL).KSACity = new KSACitiesBLL().MapKSACity(Scholarship.KSACities); ((InternalScholarshipsBLL)BaseScholarshipBLL).Location = Scholarship.Location; } else if (Scholarship.ScholarshipTypeID == Convert.ToInt16(ScholarshipsTypesEnum.External)) { BaseScholarshipBLL = GenericFactoryPattern <BaseScholarshipsBLL, ExternalScholarshipsBLL> .CreateInstance(); ((ExternalScholarshipsBLL)BaseScholarshipBLL).Country = new CountriesBLL().MapCountry(Scholarship.Countries); } else { BaseScholarshipBLL = new BaseScholarshipsBLL(); } BaseScholarshipBLL.ScholarshipType = new ScholarshipsTypesBLL().MapScholarshipType(Scholarship.ScholarshipsTypes); BaseScholarshipBLL.ScholarshipID = Scholarship.ScholarshipID; BaseScholarshipBLL.ScholarshipStartDate = Scholarship.ScholarshipStartDate.Date; BaseScholarshipBLL.ScholarshipEndDate = Scholarship.ScholarshipEndDate.Date; BaseScholarshipBLL.CreatedDate = Scholarship.CreatedDate; BaseScholarshipBLL.IsCanceled = Scholarship.IsCanceled; //BaseScholarshipBLL.Employee = new EmployeesCodesBLL().MapEmployeeCode(Scholarship.EmployeesCodes); BaseScholarshipBLL.CreatedBy = Scholarship.CreatedByNav != null ? new EmployeesCodesBLL().MapEmployeeCode(Scholarship.CreatedByNav) : null; BaseScholarshipBLL.Employee = Scholarship.EmployeesCodes != null ? new EmployeesCodesBLL().MapEmployeeCode(Scholarship.EmployeesCodes) : null;//new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(Vacation.EmployeesCareersHistory) : null; BaseScholarshipBLL.Qualification = new QualificationsBLL().MapQualification(Scholarship.Qualifications); BaseScholarshipBLL.ScholarshipTypeEnum = (ScholarshipsTypesEnum)Scholarship.ScholarshipTypeID; BaseScholarshipBLL.ScholarshipReason = Scholarship.ScholarshipReason; BaseScholarshipBLL.ScholarshipJoinDate = Scholarship.ScholarshipJoinDate; BaseScholarshipBLL.IsPassed = Scholarship.IsPassed; } return(BaseScholarshipBLL); } catch { throw; } }
internal BaseTransfersBLL MapTransfer(Transfers Transfer) { try { BaseTransfersBLL BaseTransfersBLL = null; if (Transfer != null) { if (Transfer.TransferTypeID == Convert.ToInt16(TransfersTypesEnum.TransferEmployeeWithJob)) { BaseTransfersBLL = GenericFactoryPattern <BaseTransfersBLL, TransferEmployeesWithJobBLL> .CreateInstance(); } else if (Transfer.TransferTypeID == Convert.ToInt16(TransfersTypesEnum.TransferEmployeeWithoutJob)) { BaseTransfersBLL = GenericFactoryPattern <BaseTransfersBLL, TransferEmployeesWithoutJobBLL> .CreateInstance(); ((TransferEmployeesWithoutJobBLL)BaseTransfersBLL).JobName = Transfer.JobName; ((TransferEmployeesWithoutJobBLL)BaseTransfersBLL).RankName = Transfer.RankName; ((TransferEmployeesWithoutJobBLL)BaseTransfersBLL).JobCode = Transfer.JobCode; ((TransferEmployeesWithoutJobBLL)BaseTransfersBLL).CareerDegreeName = Transfer.CareerDegreeName; ((TransferEmployeesWithoutJobBLL)BaseTransfersBLL).OrganizationName = Transfer.OrganizationName; } //BaseTransfersBLL = new BaseTransfersBLL(); BaseTransfersBLL.Destination = Transfer.Destination; BaseTransfersBLL.KSACity = new KSACitiesBLL() { KSACityID = Transfer.KSACityID }; BaseTransfersBLL.TransferID = Transfer.TransferID; BaseTransfersBLL.TransferType = new TransfersTypesBLL() { TransferTypeID = Transfer.TransferTypeID, TransferType = Transfer.TransfersTypes?.TransferTypeName }; BaseTransfersBLL.TransferDate = Transfer.TransferDate; BaseTransfersBLL.EmployeeCareerHistory = Transfer.EmployeesCareersHistory != null ? new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(Transfer.EmployeesCareersHistory) : null; BaseTransfersBLL.IsProcessed = Transfer.IsProcessed; BaseTransfersBLL.CreatedDate = Transfer.CreatedDate; BaseTransfersBLL.CreatedBy = Transfer.CreatedByNav != null ? new EmployeesCodesBLL().MapEmployeeCode(Transfer.CreatedByNav) : null; BaseTransfersBLL.LastUpdatedDate = Transfer.LastUpdatedDate; BaseTransfersBLL.LastUpdatedBy = Transfer.LastUpdatedByNav != null ? new EmployeesCodesBLL().MapEmployeeCode(Transfer.LastUpdatedByNav) : null; } return(BaseTransfersBLL); } catch (Exception ex) { throw ex; } }