public List<Hre_ReportHDTJobEntity> GetReportHDTJob(DateTime? DateFrom, DateTime? DateTo, string lstOrgOrderNumber, string userLogin) { string status = string.Empty; List<Hre_ReportHDTJobEntity> lstReportHDTJobEntity = new List<Hre_ReportHDTJobEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var hdtJobServices = new Hre_HDTJobServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(lstOrgOrderNumber); listObjHDTJob.Add(DateFrom); listObjHDTJob.Add(DateTo); var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_RptHDTJob, userLogin, ref status).ToList(); if (lstHDTJob == null) { return lstReportHDTJobEntity; } var lstProfileByHDTJob = lstHDTJob.Select(s => s.ProfileID).ToList(); var repoProfile = new Hre_ProfileRepository(unitOfWork); var lstProfile = repoProfile.FindBy(s => lstProfileByHDTJob.Contains(s.ID)).ToList(); List<Guid> profileid = lstProfile.Select(m => m.ID).ToList(); var repoHDTJobType = new Cat_HDTJobTypeRepository(unitOfWork); var lstHDTJobType = repoHDTJobType.GetAll().ToList(); foreach (var ProfileID in profileid) { if (ProfileID == null) continue; var lstHDTJobbyProfile = lstHDTJob.Where(m => m.ProfileID == ProfileID).ToList(); foreach (var HDTJobbyProfile in lstHDTJobbyProfile) { Hre_ReportHDTJobEntity reportHDTJobEntity = new Hre_ReportHDTJobEntity(); var profile = lstProfile.Where(m => m.ID == ProfileID).Select(m => new { m.ProfileName, m.CodeEmp, m.PositionID, m.JobTitleID }).FirstOrDefault(); var HDTJobType = lstHDTJobType.Where(s => HDTJobbyProfile.HDTJobTypeID == s.ID).FirstOrDefault(); reportHDTJobEntity.ProfileName = profile.ProfileName; reportHDTJobEntity.CodeEmp = profile.CodeEmp; reportHDTJobEntity.HDTType = HDTJobType != null ? HDTJobType.HDTJobTypeName : null; reportHDTJobEntity.DateFrom = HDTJobbyProfile.DateFrom; reportHDTJobEntity.DateTo = HDTJobbyProfile.DateTo; lstReportHDTJobEntity.Add(reportHDTJobEntity); } } } return lstReportHDTJobEntity; }
public List<Hre_ReportDependantProfileQuitEntity> GetReportDependantProfileQuits(DateTime? dateFrom, DateTime? dateTo, Guid? workPlaceID, string orgStructureID, string userLogin) { string status = string.Empty; List<Hre_ReportDependantProfileQuitEntity> lstReportDependantProfileQuit = new List<Hre_ReportDependantProfileQuitEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); var ProfileServices = new Hre_ProfileServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(orgStructureID); listObjHDTJob.Add(workPlaceID); listObjHDTJob.Add(dateFrom); listObjHDTJob.Add(dateTo); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstDependant = hdtJobServices.GetData<Hre_DependantEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_ReportDependantProfileQuit, userLogin, ref status).ToList(); if (lstDependant.Count == 0) { return lstReportDependantProfileQuit; } Guid[] lstprofileIds = lstDependant.Select(x => Guid.Parse(x.ProfileID.ToString())).ToArray(); var repostopwoking = new Hre_StopWorkingRepository(unitOfWork); var profileids = repostopwoking.FindBy(s => s.IsDelete == null && s.ProfileID != null && lstprofileIds.Contains(s.ProfileID.Value) && (s.StopWorkType == HRM.Infrastructure.Utilities.EnumDropDown.StopWorkType.E_SUSPENSE.ToString() || s.StopWorkType == HRM.Infrastructure.Utilities.EnumDropDown.StopWorkType.E_STOP.ToString() )).Select(s => s.ProfileID).ToList(); if (profileids != null && profileids.Count > 0) { lstDependant = lstDependant.Where(s => profileids.Contains(s.ProfileID)).ToList(); } foreach (var Dependant in lstDependant) { Hre_ReportDependantProfileQuitEntity entity = new Hre_ReportDependantProfileQuitEntity(); entity.CodeEmp = Dependant.CodeEmp; entity.ProfileName = Dependant.ProfileName; entity.DependantName = Dependant.DependantName; entity.DateOfBirth = Dependant.DateOfBirth; entity.DateQuit = Dependant.DateQuit; entity.MonthOfEffect = Dependant.MonthOfEffect; lstReportDependantProfileQuit.Add(entity); } } return lstReportDependantProfileQuit; }
public DataTable GetReportUnusualHDT(DateTime? DateFrom, DateTime? DateTo, string lstOrgOrderNumber, bool _isCreateTemplate, string userLogin) { using (var context = new VnrHrmDataContext()) { string status = string.Empty; var unitOfWork = (UnitOfWork)(new UnitOfWork(context)); DataTable table = CreateReportUnusualHDTScheme(); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); var ProfileServices = new Hre_ProfileServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(lstOrgOrderNumber); listObjHDTJob.Add(DateFrom); listObjHDTJob.Add(DateTo); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstReportUnusualHDT = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList(); if (lstReportUnusualHDT.Count == 0) { return table; } lstReportUnusualHDT = ProfileServices.getHDTJobByPrice(lstReportUnusualHDT, DateFrom, DateTo); var lstprofileids = lstReportUnusualHDT.Select(s => s.ProfileID).Distinct().ToList(); var repoCan_MealRecord = new CustomBaseRepository<Can_MealRecord>(unitOfWork); var lstmealrecord = new List<Can_MealRecord>().Select(d => new { d.ProfileID, d.TimeLog, d.LineID, d.Amount }).ToList(); foreach (var item in lstprofileids.Chunk(1000)) { lstmealrecord.AddRange(repoCan_MealRecord.FindBy(s => s.IsDelete == null && lstprofileids.Contains(s.ProfileID) && s.TimeLog >= DateFrom && s.TimeLog <= DateTo).Select(d => new { d.ProfileID, d.TimeLog, d.LineID, d.Amount }).ToList()); } var lstlineids = lstmealrecord.Select(s => s.LineID).Distinct().ToList(); var repoCan_Line = new CustomBaseRepository<Can_Line>(unitOfWork); var lstline = repoCan_Line.FindBy(s => s.IsDelete == null && lstlineids.Contains(s.ID) && s.IsHDTJOB == true).ToList(); foreach (var item in lstReportUnusualHDT) { DataRow row = table.NewRow(); row[Hre_ReportUnusualHDTEntity.FieldNames.CodeEmp] = item.CodeEmp; row[Hre_ReportUnusualHDTEntity.FieldNames.ProfileName] = item.ProfileName; row[Hre_ReportUnusualHDTEntity.FieldNames.E_DEPARTMENT] = item.E_DEPARTMENT; row[Hre_ReportUnusualHDTEntity.FieldNames.E_DIVISION] = item.E_DIVISION; row[Hre_ReportUnusualHDTEntity.FieldNames.E_SECTION] = item.E_SECTION; row[Hre_ReportUnusualHDTEntity.FieldNames.E_TEAM] = item.E_TEAM; row[Hre_ReportUnusualHDTEntity.FieldNames.E_UNIT] = item.E_UNIT; row[Hre_ReportUnusualHDTEntity.FieldNames.HDTJobTypeCode] = item.HDTJobTypeCode; row[Hre_ReportUnusualHDTEntity.FieldNames.HDTJobTypeName] = item.HDTJobTypeName; if (item.Price != null) { row[Hre_ReportUnusualHDTEntity.FieldNames.Price] = item.Price; } var mealbypro = lstmealrecord.Where(s => s.ProfileID == item.ProfileID).FirstOrDefault(); if (mealbypro != null) { if (mealbypro.TimeLog != null) { row[Hre_ReportUnusualHDTEntity.FieldNames.TimeScan] = mealbypro.TimeLog.Value.ToString("dd/MM/yyyy hh:ss"); } var linebyhdt = lstline.Where(s => s.ID == mealbypro.LineID).FirstOrDefault(); if (linebyhdt != null && linebyhdt.Amount != null) { row[Hre_ReportUnusualHDTEntity.FieldNames.PriceRecieve] = linebyhdt.Amount; } if (linebyhdt != null && linebyhdt.Amount != null) { if (item.Price != (double)linebyhdt.Amount) { row[Hre_ReportUnusualHDTEntity.FieldNames.RevieveWrong] = true; } } if (item.Price != null && linebyhdt == null) { row[Hre_ReportUnusualHDTEntity.FieldNames.HaveRegister] = true; } if (item.Price == null && linebyhdt != null) { row[Hre_ReportUnusualHDTEntity.FieldNames.NotRegister] = true; } } table.Rows.Add(row); } return table.ConfigTable(true); } }
public List<Hre_ReportSumarySeniorHDTProfileEntity> GetReportSumarySeniorHDTProfile(DateTime? DateFrom, DateTime? DateTo, string profileName, string codeEmp, string OrgStructureID, string userLogin) { string status = string.Empty; List<Hre_ReportSumarySeniorHDTProfileEntity> lstReportSumarySeniorHDTProfile = new List<Hre_ReportSumarySeniorHDTProfileEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); var ProfileServices = new Hre_ProfileServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(profileName); listObjHDTJob.Add(codeEmp); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(OrgStructureID); listObjHDTJob.Add(DateFrom); listObjHDTJob.Add(DateTo); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_RptRecieveObjectByTime, userLogin, ref status).ToList(); if (lstHDTJob.Count == 0) { return lstReportSumarySeniorHDTProfile; } var lstProfileIds = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList(); string selectedIds = Common.DotNetToOracle(String.Join(",", lstHDTJob.Select(s => s.ProfileID.ToString()).ToList<string>())); var lstInsurance = new List<Ins_ProfileInsuranceMonthlyEntity>(); int _total = lstProfileIds.Count; int _totalPage = _total / 100 + 1; int _pageSize = 100; for (int _page = 1; _page <= _totalPage; _page++) { int _skip = _pageSize * (_page - 1); var _listCurrenPage = lstProfileIds.Skip(_skip).Take(_pageSize).ToList(); string _strselectedIDs = Common.DotNetToOracle(string.Join(",", _listCurrenPage)); var lstresultInsurance = basevices.GetData<Ins_ProfileInsuranceMonthlyEntity>(_strselectedIDs, ConstantSql.hrm_ins_sp_get_ProfileInsMonthlyByProfileIds, userLogin, ref status).ToList(); if (lstresultInsurance != null && lstresultInsurance.Count > 0) { lstInsurance.AddRange(lstresultInsurance); } } var lstHDTJobCut = ProfileServices.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo); var lstprofileNameDistince = lstHDTJob.Select(s => new { s.ProfileID, s.ProfileName, s.CodeEmp, s.E_DEPARTMENT }).Distinct().ToList(); foreach (var profile in lstprofileNameDistince) { Hre_ReportSumarySeniorHDTProfileEntity entity = new Hre_ReportSumarySeniorHDTProfileEntity(); entity.CodeEmp = profile.CodeEmp; entity.ProfileName = profile.ProfileName; entity.E_DEPARTMENT = profile.E_DEPARTMENT; var hdtbyProfile = lstHDTJobCut.Where(s => s.ProfileID == profile.ProfileID).ToList(); int counttype4 = 0; int counttype5 = 0; foreach (var item in hdtbyProfile) { var insuracebyHDT4 = lstInsurance.Where(s => s.HDTJobGroupCode == item.HDTJobGroupCode && s.ProfileID == item.ProfileID && s.AmountHDTIns > 0 && item.Type == "E_TYPE4").ToList(); if (insuracebyHDT4.Count > 0) { counttype4 += insuracebyHDT4.Count; } var insuracebyHDT5 = lstInsurance.Where(s => s.HDTJobGroupCode == item.HDTJobGroupCode && s.ProfileID == item.ProfileID && s.AmountHDTIns > 0 && item.Type == "E_TYPE5").ToList(); if (insuracebyHDT4.Count > 0) { counttype5 += insuracebyHDT5.Count; } } entity.MonthInsuranceType4 = counttype4; entity.MonthInsuranceType5 = counttype5; lstReportSumarySeniorHDTProfile.Add(entity); } } return lstReportSumarySeniorHDTProfile; }
public List<Hre_ReportHDTJobNotDateEndEntity> GetReportHDTJobNotDateEnd(DateTime? DateFrom, DateTime? DateTo, string lstOrgOrderNumber, string userLogin) { string status = string.Empty; List<Hre_ReportHDTJobNotDateEndEntity> lstReportHDTJobNotDateEndEntity = new List<Hre_ReportHDTJobNotDateEndEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); var ProfileServices = new Hre_ProfileServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(lstOrgOrderNumber); listObjHDTJob.Add(DateFrom); listObjHDTJob.Add(DateTo); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList(); if (lstHDTJob == null) { return lstReportHDTJobNotDateEndEntity; } var lstResultHDTJob = ProfileServices.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo); var profileinList = lstResultHDTJob.Select(s => s.ProfileID).Distinct().ToList(); foreach (var ids in profileinList) { bool isNull = false; var hdtbypro = lstResultHDTJob.Where(s => s.ProfileID == ids).OrderBy(s => s.DateFrom).ToList(); var hdt = lstResultHDTJob.Where(s => s.ProfileID == ids).FirstOrDefault(); foreach (var item in hdtbypro) { if (hdtbypro.Count == 1 && item.DateTo != null) { continue; } if (item.DateTo == null) { isNull = true; } if (isNull) { Hre_ReportHDTJobNotDateEndEntity entity = new Hre_ReportHDTJobNotDateEndEntity(); entity.CodeEmp = item.CodeEmp; entity.ProfileName = item.ProfileName; entity.E_UNIT = item.E_UNIT; entity.E_DIVISION = item.E_DIVISION; entity.E_DEPARTMENT = item.E_DEPARTMENT; entity.E_TEAM = item.E_TEAM; entity.E_SECTION = item.E_SECTION; entity.Dept = item.Dept; entity.HDTJobTypeCode = item.HDTJobTypeCode; entity.HDTJobTypeName = item.HDTJobTypeName; entity.HDTJobGroupName = item.HDTJobGroupName; entity.DateFrom = item.DateFrom; entity.DateTo = item.DateTo; entity.StatusView = item.StatusView; lstReportHDTJobNotDateEndEntity.Add(entity); } if (item.DateTo != null) { isNull = false; } } } } lstReportHDTJobNotDateEndEntity = lstReportHDTJobNotDateEndEntity.OrderBy(s => s.CodeEmp).ToList(); return lstReportHDTJobNotDateEndEntity; }
public List<Hre_ReportSumaryHDTProfileEntity> GetReportSumaryHDTProfile(DateTime? DateFrom, DateTime? DateTo, Guid? HDTJobGroupID, string CodeEmp, string userLogin) { string status = string.Empty; List<Hre_ReportSumaryHDTProfileEntity> lstReportSumaryHDTProfile = new List<Hre_ReportSumaryHDTProfileEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); var ProfileServices = new Hre_ProfileServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(null); listObjHDTJob.Add(CodeEmp); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(DateFrom); listObjHDTJob.Add(DateTo); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_ReportSumaryHDTProfile, userLogin, ref status).ToList(); if (lstHDTJob.Count == 0) { return lstReportSumaryHDTProfile; } if (HDTJobGroupID != null) { lstHDTJob = lstHDTJob.Where(s => s.HDTJobGroupID == HDTJobGroupID).ToList(); } var lstprofileids = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList(); string selectedIds = Common.DotNetToOracle(String.Join(",", lstHDTJob.Select(s => s.ProfileID.ToString()).ToList<string>())); var lstInsurance = new List<Ins_ProfileInsuranceMonthlyEntity>(); int _total = lstprofileids.Count; int _totalPage = _total / 100 + 1; int _pageSize = 100; for (int _page = 1; _page <= _totalPage; _page++) { int _skip = _pageSize * (_page - 1); var _listCurrenPage = lstprofileids.Skip(_skip).Take(_pageSize).ToList(); string _strselectedIDs = Common.DotNetToOracle(string.Join(",", _listCurrenPage)); var lstresultInsurance = basevices.GetData<Ins_ProfileInsuranceMonthlyEntity>(_strselectedIDs, ConstantSql.hrm_ins_sp_get_ProfileInsMonthlyByProfileIds, userLogin, ref status).ToList(); if (lstresultInsurance != null && lstresultInsurance.Count > 0) { lstInsurance.AddRange(lstresultInsurance); } } var lstHDTJobCut = ProfileServices.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo); foreach (var HDTJob in lstHDTJobCut) { Hre_ReportSumaryHDTProfileEntity entity = new Hre_ReportSumaryHDTProfileEntity(); entity.ProfileName = HDTJob.ProfileName; entity.CodeEmp = HDTJob.CodeEmp; entity.E_UNIT = HDTJob.E_UNIT; entity.E_DIVISION = HDTJob.E_DIVISION; entity.E_DEPARTMENT = HDTJob.E_DEPARTMENT; entity.E_TEAM = HDTJob.E_TEAM; entity.E_SECTION = HDTJob.E_SECTION; entity.Dept = HDTJob.Dept; entity.Type = HDTJob.Type != null ? HDTJob.Type.TranslateString() : null; entity.HDTJobGroupCode = HDTJob.HDTJobGroupCode; entity.HDTJobGroupName = HDTJob.HDTJobGroupName; entity.DateFrom = HDTJob.DateFrom; entity.DateTo = HDTJob.DateTo; var insuracebyHDT = lstInsurance.Where(s => s.HDTJobGroupCode == HDTJob.HDTJobGroupCode && s.ProfileID == HDTJob.ProfileID && s.AmountHDTIns > 0).ToList(); entity.MonthInsurance = insuracebyHDT != null ? insuracebyHDT.Count : 0; lstReportSumaryHDTProfile.Add(entity); } } return lstReportSumaryHDTProfile; }
public DataTable GetReportRecieveObjectByTime(string orgStructureIDs, DateTime dateFrom, DateTime dateTo, bool IsCreateTemplate, string userLogin) { DataTable table = GetSchemaReportRecieveObjectByTime(userLogin); if (IsCreateTemplate) { return table.ConfigTable(); } string status = string.Empty; using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.AddRange(new object[14]); listObjHDTJob[5] = orgStructureIDs; listObjHDTJob[6] = dateFrom; listObjHDTJob[7] = dateTo; listObjHDTJob[12] = 1; listObjHDTJob[13] = Int32.MaxValue - 1; var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_RptRecieveObjectByTime, userLogin, ref status).ToList(); if (lstHDTJob.Count == 0) { return table; } var lstProfileIDByHDTJob = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList(); #region Lấy WorkDay var workDayRepository = new Att_WorkDayRepository(unitOfWork); var lstworkDays = new List<Att_Workday>().Select(d => new { d.ProfileID, d.WorkDate, d.FirstInTime, d.LastOutTime }).ToList(); foreach (var item in lstProfileIDByHDTJob.Chunk(1000)) { lstworkDays.AddRange(workDayRepository.FindBy(s => s.IsDelete == null && s.WorkDate >= dateFrom && s.WorkDate <= dateTo && item.Contains(s.ProfileID)).Select(d => new { d.ProfileID, d.WorkDate, d.FirstInTime, d.LastOutTime }).ToList()); } if (lstworkDays.Count == 0) { return table; } #endregion #region Lấy MealRecord var mealRecordRepository = new Can_MealRecordRepository(unitOfWork); var lstmeadrecored = new List<Can_MealRecord>().Select(d => new { d.ProfileID, d.WorkDay, d.Amount }).ToList(); foreach (var item in lstProfileIDByHDTJob.Chunk(1000)) { lstmeadrecored.AddRange(mealRecordRepository.FindBy(s => s.IsDelete == null && s.WorkDay >= dateFrom && s.WorkDay <= dateTo && item.Contains(s.ProfileID)).Select(d => new { d.ProfileID, d.WorkDay, d.Amount }).ToList()); } #endregion List<object> listObjPrice = new List<object>(); listObjPrice.Add(null); listObjPrice.Add(null); listObjPrice.Add(null); listObjPrice.Add(1); listObjPrice.Add(Int32.MaxValue - 1); var lstHDTJobTypePrice = basevices.GetData<Cat_HDTJobTypePriceEntity>(listObjPrice, ConstantSql.hrm_cat_sp_get_HDTJobTypePrice, userLogin, ref status).Where(s => s.Price != null).Distinct().ToList(); var profileServices = new Hre_ProfileServices(); var listResult = profileServices.getHDTJobByPrice(lstHDTJob, dateFrom, dateTo); var ListProfileID = listResult.Select(m => m.ProfileID).Distinct().ToList(); foreach (var profileID in ListProfileID) { var firstProfile = listResult.Where(m => m.ProfileID == profileID).FirstOrDefault(); var lstWorkDaysByProfile = lstworkDays.Where(m => m.ProfileID == profileID && (m.FirstInTime != null || m.LastOutTime != null)).ToList(); var lstmeadlbypro = lstmeadrecored.Where(s => s.ProfileID == profileID).ToList(); if (firstProfile != null && lstWorkDaysByProfile.Count != 0) { bool isAdd = false; DataRow row = table.NewRow(); row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.ProfileName] = firstProfile.ProfileName; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.CodeEmp] = firstProfile.CodeEmp; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.E_DEPARTMENT] = firstProfile.E_DEPARTMENT; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.E_DIVISION] = firstProfile.E_DIVISION; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.E_SECTION] = firstProfile.E_SECTION; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.E_TEAM] = firstProfile.E_TEAM; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.E_UNIT] = firstProfile.E_UNIT; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.Dept] = firstProfile.Dept; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.Unit] = firstProfile.Unit; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.Part] = firstProfile.Part; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.Line] = firstProfile.Line; row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.Session] = firstProfile.Session; var hdtjobbyprofile = lstHDTJob.Where(s => s.ProfileID == profileID).ToList(); var workdaybyProfile = lstworkDays.Where(s => s.ProfileID == profileID).ToList(); foreach (var item in lstHDTJobTypePrice) { var resultByPrice = listResult.Where(m => m.ProfileID == profileID && m.Price == item.Price).ToList(); if (resultByPrice.Count == 0) { continue; } int? count = 0; foreach (var Price in resultByPrice) { if (Price.DateTo == null) { Price.DateTo = dateTo; } for (DateTime date = Price.DateFrom.Value; date <= Price.DateTo; date = date.AddDays(1)) { var workdaybyprice = workdaybyProfile.Where(s => s.WorkDate != null && s.WorkDate.Date == date.Date && s.FirstInTime != null && s.LastOutTime != null).FirstOrDefault(); var mealbyprice = lstmeadlbypro.Where(s => s.Amount != null && s.WorkDay != null && s.WorkDay.Value.Date == date.Date && (double)s.Amount == Price.Price).FirstOrDefault(); if (workdaybyprice != null && mealbyprice != null) { count++; } row[item.Price.ToString()] = count != 0 ? count : null; if (count != null && count != 0) { isAdd = true; } } } } if (isAdd == true) { table.Rows.Add(row); } } } } return table.ConfigTable(); }
public ActionResult CheckDataHDTJobIn(string selectedIds) { var service = new Hre_HDTJobServices(); int countInvalid = service.CheckDataHDTJobIn(selectedIds); return Json(countInvalid); }
public DataTable GetReportProfileHDTNotWork(DateTime DateFrom, DateTime DateTo, string lstOrgOrderNumber, string nameReport, bool isCreateTemplate,string userLogin) { string status = string.Empty; //List<Hre_ReportProfileHDTNotWorkEntity> lstReportProfileHDTNotWork = new List<Hre_ReportProfileHDTNotWorkEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); DataTable tb = GetSchema_ReportProfileHDTNotWork(nameReport); if (isCreateTemplate) { return tb.ConfigTable(); } var hdtJobServices = new Hre_HDTJobServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.AddRange(new object[14]); listObjHDTJob[5] = lstOrgOrderNumber; listObjHDTJob[6] = DateFrom; listObjHDTJob[7] = DateTo; listObjHDTJob[12] = 1; listObjHDTJob[13] = Int32.MaxValue - 1; var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList(); if (lstHDTJob == null || lstHDTJob.Count == 0) { return tb.ConfigTable(); } var lstProfileIDsByHDTJob = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList(); //var lstobjectProfileids = new List<object>(); //string strIDs = string.Empty; //foreach (var item in lstProfileIDsByHDTJob) //{ // strIDs += Common.DotNetToOracle(item.ToString()) + ","; //} //if (strIDs.IndexOf(",") > 0) // strIDs = strIDs.Substring(0, strIDs.Length - 1); //lstobjectProfileids.Add(strIDs); //var lstLeaveDay = basevices.GetData<Att_LeaveDayEntity>(strIDs, ConstantSql.hrm_att_sp_get_LeavedayByIds, ref status); List<object> para = new List<object>(); para.AddRange(new object[3]); para[0] = (object)lstOrgOrderNumber; para[1] = DateFrom; para[2] = DateTo; var lstLeaveDay = GetData<Att_LeaveDayEntity>(para, ConstantSql.hrm_att_getdata_LeaveDay, userLogin, ref status); if (lstLeaveDay.Count > 0) { lstLeaveDay = lstLeaveDay.Where(s => lstProfileIDsByHDTJob.Contains(s.ProfileID)).ToList(); } if (lstLeaveDay != null && lstLeaveDay.Count > 0) { lstLeaveDay = lstLeaveDay.Where(s => s.DateStart != null && s.DateEnd != null && s.DateStart <= DateTo && s.DateEnd >= DateFrom).ToList(); } if (lstLeaveDay == null) { return tb.ConfigTable(); } List<object> listObjLeaveDayType = new List<object>(); listObjLeaveDayType.Add(null); listObjLeaveDayType.Add(null); listObjLeaveDayType.Add(1); listObjLeaveDayType.Add(Int32.MaxValue - 1); var lstLeaveDayType = basevices.GetData<Cat_LeaveDayTypeEntity>(listObjLeaveDayType, ConstantSql.hrm_cat_sp_get_LeaveDayType, userLogin, ref status).ToList(); Hre_ProfileServices hreService = new Hre_ProfileServices(); lstHDTJob = hreService.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo); foreach (var HDTJob in lstHDTJob) { DataRow row = tb.NewRow(); row["ProfileName"] = HDTJob.ProfileName; row["CodeEmp"] = HDTJob.CodeEmp; row["E_DEPARTMENT"] = HDTJob.E_DEPARTMENT; row["E_DIVISION"] = HDTJob.E_DIVISION; row["E_SECTION"] = HDTJob.E_SECTION; row["E_TEAM"] = HDTJob.E_TEAM; row["E_UNIT"] = HDTJob.E_UNIT; row["HDTJobGroupCode"] = HDTJob.HDTJobGroupCode; row["HDTJobTypeCode"] = HDTJob.HDTJobTypeCode; if (HDTJob.DateFrom != null) row["HDTDateFrom"] = HDTJob.DateFrom; if (HDTJob.DateTo != null) row["HDTDateTo"] = HDTJob.DateTo; if (HDTJob.Price != null) row["Price"] = HDTJob.Price; if (HDTJob.DateTo != null && HDTJob.DateFrom != null) { var leavedaybyhdt = lstLeaveDay.Where(s => s.ProfileID == HDTJob.ProfileID && (s.DateStart != null && s.DateEnd != null && s.DateStart.Date <= HDTJob.DateTo.Value.Date && s.DateEnd.Date >= HDTJob.DateFrom.Value.Date)).FirstOrDefault(); if (lstLeaveDayType != null && leavedaybyhdt != null) { var leavedaytype = lstLeaveDayType.Where(s => s.ID == leavedaybyhdt.LeaveDayTypeID).FirstOrDefault(); row["LeaveDayTypeCode"] = leavedaytype != null ? leavedaytype.Code : null; } } else { var leavedaybyhdt = lstLeaveDay.Where(s => s.ProfileID == HDTJob.ProfileID && (s.DateStart != null && s.DateEnd != null && s.DateStart.Date <= HDTJob.DateFrom.Value.Date && s.DateEnd.Date >= HDTJob.DateFrom.Value.Date)).FirstOrDefault(); if (lstLeaveDayType != null && leavedaybyhdt != null) { var leavedaytype = lstLeaveDayType.Where(s => s.ID == leavedaybyhdt.LeaveDayTypeID).FirstOrDefault(); row["LeaveDayTypeCode"] = leavedaytype != null ? leavedaytype.Code : null; } } tb.Rows.Add(row); } return tb.ConfigTable(); } }
public ActionResult GetReportHDTJob([DataSourceRequest] DataSourceRequest request, Hre_ReportHDTJobModel model) { HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = DateTime.Now }; HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = DateTime.Now }; List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 }; if (model != null && model.IsCreateTemplate) { var path = Common.GetPath("Templates"); ExportService exportService = new ExportService(); ConfigExport cfgExport = new ConfigExport() { Object = new Hre_ReportHDTJobModel(), FileName = "Hre_ReportHDTJob", OutPutPath = path, HeaderInfo = listHeaderInfo, DownloadPath = Hrm_Main_Web + "Templates", IsDataTable = false }; var str = exportService.CreateTemplate(cfgExport); return Json(str); } #region Validate string message = string.Empty; var checkValidate = ValidatorService.OnValidateData<Hre_ReportHDTJobModel>(model, "Hre_ReportHDTJob", ref message); if (!checkValidate) { return Json(message); } #endregion var actionServices = new ActionService(UserLogin); var hrService = new Hre_ProfileServices(); DateTime From = SqlDateTime.MinValue.Value; DateTime To = SqlDateTime.MaxValue.Value; if (model.DateFrom != null) { From = model.DateFrom.Value; } if (model.DateTo != null) { To = model.DateTo.Value; } string status = string.Empty; var hdtJobServices = new Hre_HDTJobServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(model.OrgStructureID); listObjHDTJob.Add(model.DateFrom); listObjHDTJob.Add(model.DateTo); var result = actionServices.GetData<Hre_ReportHDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_RptHDTJob, ref status).ToList().Translate<Hre_ReportHDTJobModel>(); if (model.ExportID != Guid.Empty) { var fullPath = ExportService.Export(model.ExportID, result, listHeaderInfo, null, model.ExportType); return Json(fullPath); } return Json(result.ToDataSourceResult(request)); }
public List<Hre_ReportPayHDTJobEntity> GetPayHDTJob(DateTime DateFrom, DateTime DateTo, string lstOrgOrderNumber, string userLogin) { string status = string.Empty; List<Hre_ReportPayHDTJobEntity> lstReportHDTJobEntity = new List<Hre_ReportPayHDTJobEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(lstOrgOrderNumber); listObjHDTJob.Add(DateFrom); listObjHDTJob.Add(DateTo); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList(); if (lstHDTJob.Count == 0) { return lstReportHDTJobEntity; } var lstprofile = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList(); var repoHDTJobType = new Cat_HDTJobTypeRepository(unitOfWork); var lstHDTJobType = repoHDTJobType.GetAll().ToList(); List<object> lstParam = new List<object>(); lstParam.Add(null); lstParam.Add(DateFrom); lstParam.Add(DateTo); var workDays = GetData<Att_WorkdayEntity>(lstParam, ConstantSql.hrm_att_getdata_Workday, userLogin, ref status).ToList(); if (workDays.Count == 0) { return lstReportHDTJobEntity; } foreach (var Profileid in lstprofile) { Hre_ReportPayHDTJobEntity entity = new Hre_ReportPayHDTJobEntity(); var Profile = lstHDTJob.Where(s => s.ProfileID == Profileid).FirstOrDefault(); if (Profile != null) { entity.ProfileName = Profile.ProfileName; entity.CodeEmp = Profile.CodeEmp; entity.E_UNIT = Profile.E_UNIT; entity.E_DIVISION = Profile.E_DIVISION; entity.E_DEPARTMENT = Profile.E_DEPARTMENT; entity.E_TEAM = Profile.E_TEAM; entity.E_SECTION = Profile.E_SECTION; var hdtbyprofile = lstHDTJob.Where(s => s.ProfileID == Profile.ID).FirstOrDefault(); entity.OrgStructureName = hdtbyprofile != null ? hdtbyprofile.Dept : string.Empty; int counttype4 = 0; int counttype5 = 0; var lstWorkdayByProfile = workDays.Where(s => s.ProfileID == Profileid).ToList(); for (DateTime date = DateFrom; date <= DateTo; date = date.AddDays(1)) { var workdaybyprofile = lstWorkdayByProfile.Where(s => s.FirstInTime != null && s.LastOutTime != null && s.WorkDate != null && s.WorkDate.Date == date.Date).FirstOrDefault(); var countype4 = lstHDTJob.Where(s => s.ProfileID == Profileid && s.Type == "E_TYPE4" && s.DateFrom <= date && s.DateTo >= date).ToList(); if (countype4 != null && countype4.Count > 0 && workdaybyprofile != null) { counttype4++; } var countype5 = lstHDTJob.Where(s => s.ProfileID == Profileid && s.Type == "E_TYPE5" && s.DateFrom <= date && s.DateTo >= date).ToList(); if (countype5 != null && countype5.Count > 0 && workdaybyprofile != null) { counttype5++; } } entity.CountType4 = counttype4; entity.CountType5 = counttype5; lstReportHDTJobEntity.Add(entity); } } } return lstReportHDTJobEntity; }
public ActionResult ActionCancelHDT(string selectedIds) { var service = new Hre_HDTJobServices(); var message = service.ActionCancel(selectedIds); return Json(message); }
public ActionResult ApprovedHDTJobOut(string selectedIds) { var arrParam = selectedIds.Split('|').ToList(); var userLG = arrParam[0] ?? string.Empty; var Ids = arrParam[1]; var service = new Hre_HDTJobServices(); var message = service.ActionApprovedForHDTJobWaiting(Ids, userLG); return Json(message); }
public ActionResult CheckDataHDTJobOut(string selectedIds) { var service = new Hre_HDTJobServices(); var message = service.CheckDataHDTJobOut(selectedIds); return Json(message); }
public List<Hre_HDTJobEntity> GetReportHDTJobOut(DateTime? DateTo, string lstOrgOrderNumber, Guid? workPlaceID, string profileName, string CodeEmp, string userLogin) { string status = string.Empty; List<Hre_HDTJobEntity> lstReportHDTJobEntity = new List<Hre_HDTJobEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); var profileServices = new Hre_ProfileServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(profileName); listObjHDTJob.Add(CodeEmp); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(lstOrgOrderNumber); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList(); if (lstHDTJob.Count == 0) { return lstReportHDTJobEntity; } if (DateTo != null) { lstHDTJob = lstHDTJob.Where(s => s.DateTo != null && s.DateTo.Value.Date == DateTo.Value.Date).ToList(); } lstReportHDTJobEntity = profileServices.getHDTJobByPrice(lstHDTJob, null, DateTo); } return lstReportHDTJobEntity; }
public DataTable GetReportProfileHDTInMonth(DateTime Month, string lstOrgOrderNumber, List<string> lstUnit, List<string> lstDept, List<string> lstPart, bool IsCreateTemplate, string userLogin) { DataTable table = CreateReportProfileHDTInMonthSchema(); if (IsCreateTemplate) { return table.ConfigTable(); } DateTime monthStart = new DateTime(Month.Year, Month.Month, 1); DateTime monthEnd = monthStart.AddMonths(1).AddMilliseconds(-1); string status = string.Empty; using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.AddRange(new object[14]); listObjHDTJob[5] = lstOrgOrderNumber; listObjHDTJob[12] = 1; listObjHDTJob[13] = Int32.MaxValue - 1; var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList(); //Hieu.Van: HungLe yêu cầu thêm nghiệp vụ này idTask: 19234 //Chỉ xuất những người còn làm HDTJob trong tháng lstHDTJob = lstHDTJob.Where(s => s.DateFrom != null && s.DateFrom.Value.Month == Month.Month).ToList(); if (lstUnit.Count() > 0) { lstHDTJob = lstHDTJob.Where(s => lstUnit.Contains(s.Unit)).ToList(); } if (lstDept.Count() > 0) { lstHDTJob = lstHDTJob.Where(s => lstDept.Contains(s.Dept)).ToList(); } if (lstPart.Count() > 0) { lstHDTJob = lstHDTJob.Where(s => lstPart.Contains(s.Part)).ToList(); } if (lstHDTJob.Count == 0) { return table; } var lstProfileIDsByHDTJob = lstHDTJob.Select(s => s.ProfileID).ToList(); #region DS ngày công Theo ProfileIds var workDayRepository = new Att_WorkDayRepository(unitOfWork); var lstWorkDay = new List<Att_Workday>().Select(s => new { s.ID, s.ProfileID, s.WorkDate, s.ShiftActual }).ToList(); lstWorkDay.AddRange(workDayRepository.FindBy(s => s.IsDelete == null && s.FirstInTime != null && s.LastOutTime != null && s.WorkDate.Month == Month.Month && lstProfileIDsByHDTJob.Contains(s.ProfileID)).Select(s => new { s.ID, s.ProfileID, s.WorkDate, s.ShiftActual }).ToList()); #endregion #region DS ngày nghỉ Theo ProfileIds var leavedayRepository = new Att_LeavedayRepository(unitOfWork); var lstleaveday = new List<Att_LeaveDay>().Select(s => new { s.ID, s.ProfileID, s.DateStart, s.DateEnd }).ToList(); lstleaveday.AddRange(leavedayRepository.FindBy(s => s.IsDelete == null && s.DateStart.Month <= Month.Month && s.DateEnd.Month >= Month.Month && lstProfileIDsByHDTJob.Contains(s.ProfileID) && s.Status == LeaveDayStatus.E_APPROVED.ToString()).Select(s => new { s.ID, s.ProfileID, s.DateStart, s.DateEnd }).ToList()); #endregion #region DS ca làm việc var shiftRepository = new Cat_ShiftRepository(unitOfWork); var lstShift = new List<Cat_Shift>().Select(s => new { s.ID, s.Code }).ToList(); lstShift.AddRange(shiftRepository.FindBy(s => s.IsDelete == null ).Select(s => new { s.ID, s.Code }).ToList()); #endregion Hre_ProfileServices hreService = new Hre_ProfileServices(); lstHDTJob = hreService.getHDTJobByPrice(lstHDTJob, monthStart, monthEnd); foreach (var HDTJob in lstHDTJob) { DataRow row = table.NewRow(); row[Hre_ReportProfileHDTInMonthEntity.FieldNames.ProfileName] = HDTJob.ProfileName; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.CodeEmp] = HDTJob.CodeEmp; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.E_DEPARTMENT] = HDTJob.E_DEPARTMENT; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.E_DIVISION] = HDTJob.E_DIVISION; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.E_SECTION] = HDTJob.E_SECTION; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.E_TEAM] = HDTJob.E_TEAM; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.E_UNIT] = HDTJob.E_UNIT; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.Unit] = HDTJob.Unit; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.Dept] = HDTJob.Dept; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.Part] = HDTJob.Part; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.Line] = HDTJob.Line; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.Price] = HDTJob.Price != null ? HDTJob.Price : 0; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.Session] = HDTJob.Session; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.HDTJobTypeName] = HDTJob.HDTJobTypeName; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.HDTJobTypeNameHVN] = HDTJob.HDTJobTypeNameHVN; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.StandardElement] = HDTJob.StandardElement; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.EncryptJob] = HDTJob.EncryptJob; row[Hre_ReportProfileHDTInMonthEntity.FieldNames.HDTJobGroupName] = HDTJob.HDTJobGroupName; var workdaybypro = lstWorkDay.Where(s => s.ProfileID == HDTJob.ProfileID).ToList(); if (workdaybypro.Count == 0) { continue; } for (int i = 1; i <= 31; i++) { var workdaybydate = workdaybypro.Where(s => s.WorkDate != null && s.WorkDate.Day == i).FirstOrDefault(); if (workdaybydate == null) { continue; } else { var leavedaybydate = lstleaveday.Where(s => s.DateStart.Day <= i && s.DateEnd.Day >= i).FirstOrDefault(); if (leavedaybydate != null) { continue; } else { var shiftbydate = lstShift.Where(s => s.ID == workdaybydate.ShiftActual).FirstOrDefault(); row[Hre_ReportProfileHDTInMonthEntity.FieldNames.Data + i] = shiftbydate != null ? shiftbydate.Code : null; } } } table.Rows.Add(row); } } return table.ConfigTable(); }
public List<Hre_HDTJobEntity> GetReportHDTJobDecisionAssignWork(DateTime? Datesearch, string lstOrgOrderNumber, Guid? positionID, Guid? jobTitleID, string profileName, string CodeEmp, string userLogin) { string status = string.Empty; List<Hre_HDTJobEntity> lstReportHDTJobEntity = new List<Hre_HDTJobEntity>(); using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var basevices = new BaseService(); var hdtJobServices = new Hre_HDTJobServices(); var profileServices = new Hre_ProfileServices(); List<object> listObjHDTJob = new List<object>(); listObjHDTJob.Add(profileName); listObjHDTJob.Add(CodeEmp); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(lstOrgOrderNumber); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(null); listObjHDTJob.Add(1); listObjHDTJob.Add(Int32.MaxValue - 1); var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList(); if (lstHDTJob.Count == 0) { return lstReportHDTJobEntity; } if (Datesearch != null ) { lstHDTJob = lstHDTJob.Where(s => s.DateFrom != null && s.DateTo != null && (s.DateFrom.Value.Date == Datesearch.Value.Date || s.DateTo.Value.Date == Datesearch.Value.Date)).ToList(); } lstReportHDTJobEntity = profileServices.getHDTJobByPrice(lstHDTJob, null, null); lstReportHDTJobEntity = lstReportHDTJobEntity.OrderByDescending(s => s.CodeEmp).ThenBy(s => s.ProfileName).ThenBy(s => s.DateFrom).ToList(); } return lstReportHDTJobEntity; }
public ActionResult ApprovedHDTJob(string selectedIds) { var service = new Hre_HDTJobServices(); var message = service.ActionApproved(selectedIds); return Json(message); }