Exemple #1
0
        public HolidaysAttendanceDetailsBLL GetHolidayAttendanceDetailByEmployeeCodeIDAndHolidayTypeIDAndHolidaySettingID(int EmployeeCodeID, int MaturityYearID, int HolidayTypeID)
        {
            HolidaysSettingsBLL HolidaySetting = new HolidaysSettingsBLL().GetByMaturityYearIDAndHolidayTypeID(MaturityYearID, HolidayTypeID);

            if (HolidaySetting != null)
            {
                List <HolidaysAttendanceBLL> HolidayAttendanceList = new HolidaysAttendanceBLL().GetByHolidaySettingID(HolidaySetting.HolidaySettingID);
                //if
                List <HolidaysAttendanceDetailsBLL> HolidaysAttendanceDetailsList = new List <HolidaysAttendanceDetailsBLL>();
                HolidayAttendanceList.ForEach(c => HolidaysAttendanceDetailsList.AddRange(c.HolidaysAttendanceDetails.ToList()));
                //EmployeesCareersHistoryBLL EmployeeCareerHistory = new EmployeesCareersHistoryBLL().GetHiringRecordByEmployeeCodeID(EmployeeCodeID); //{ EmployeeCode = new EmployeesCodesBLL() { EmployeeCodeID = EmployeeCodeID }

                EmployeesCareersHistoryBLL EmployeeCareerHistory = new EmployeesCodesBLL().GetCareerHistoryByEmployeeCodeID(EmployeeCodeID).FirstOrDefault(c => c.IsActive == true); //{ EmployeeCode = new EmployeesCodesBLL() { EmployeeCodeID = EmployeeCodeID }
                var result = HolidaysAttendanceDetailsList.FirstOrDefault(x => x.EmployeeCareerHistory.EmployeeCode.EmployeeCodeID == EmployeeCodeID);
                return(result);
            }
            else
            {
                return(null);
            }
        }
 internal HolidaysAttendanceBLL MapHolidayAttendance(HolidaysAttendance HolidayAttendance)
 {
     try
     {
         HolidaysAttendanceBLL HolidayAttendanceBLL = null;
         if (HolidayAttendance != null)
         {
             HolidayAttendanceBLL = new HolidaysAttendanceBLL()
             {
                 HolidayAttendanceID = HolidayAttendance.HolidayAttendanceID,
                 HolidaySetting      = new HolidaysSettingsBLL().MapHolidaySetting(HolidayAttendance.HolidaysSettings),
                 Organization        = new OrganizationsStructuresBLL().MapOrganization(HolidayAttendance.OrganizationsStructures),
                 CreatedBy           = new EmployeesCodesBLL().MapEmployeeCode(HolidayAttendance.CreatedByNav),
                 CreatedDate         = HolidayAttendance.CreatedDate,
             };
             HolidayAttendanceBLL.HolidaysAttendanceDetails = new HolidaysAttendanceDetailsBLL().GetHolidaysAttendanceDetailsByHolidayAttendanceID(HolidayAttendance.HolidayAttendanceID);
         }
         return(HolidayAttendanceBLL);
     }
     catch
     {
         throw;
     }
 }