public string ActionCancel(string selectedIds, string userLogin) { using (var context = new VnrHrmDataContext()) { string message = string.Empty; var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var repo = new Hre_StopWorkingRepository(unitOfWork); var profileServices = new Hre_ProfileServices(); string status = string.Empty; List<Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList(); var lstStopWorkings = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList(); foreach (var StopWorking in lstStopWorkings) { var profile = profileServices.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(StopWorking.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault(); profile.StatusSyn = StopWorking.LastStatusSyn; StopWorking.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_CANCEL.ToString(); profile.StopWorkType = null; profile.TypeSuspense = null; profile.RequestDate = null; profile.DateQuit = null; profile.ResReasonID = null; profile.IsHoldSal = false; profile.ResignNo = null; profile.TypeOfStop = null; profileServices.Edit(profile); } repo.SaveChanges(); message = NotificationType.Success.ToString(); return message; } }
public string ActionCancel(string selectedIds, string userLogin) { using (var context = new VnrHrmDataContext()) { string message = string.Empty; var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var repo = new Hre_StopWorkingRepository(unitOfWork); var profileServices = new Hre_ProfileServices(); string status = string.Empty; List <Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList(); var lstStopWorkings = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList(); foreach (var StopWorking in lstStopWorkings) { var profile = profileServices.GetData <Hre_ProfileEntity>(Common.DotNetToOracle(StopWorking.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault(); profile.StatusSyn = StopWorking.LastStatusSyn; StopWorking.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_CANCEL.ToString(); profile.StopWorkType = null; profile.TypeSuspense = null; profile.RequestDate = null; profile.DateQuit = null; profile.ResReasonID = null; profile.IsHoldSal = false; profile.ResignNo = null; profile.TypeOfStop = null; profileServices.Edit(profile); } repo.SaveChanges(); message = NotificationType.Success.ToString(); return(message); } }
public string ActionCancelComback(string selectedIds) { using (var context = new VnrHrmDataContext()) { string message = string.Empty; var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var repo = new Hre_StopWorkingRepository(unitOfWork); var profileServices = new Hre_ProfileServices(); string status = string.Empty; List <Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList(); var lstSuspenses = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList(); foreach (var Suspense in lstSuspenses) { Suspense.DateComeBack = null; Suspense.RequestDateComeBack = null; Suspense.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_APPROVED.ToString(); } repo.SaveChanges(); message = NotificationType.Success.ToString(); return(message); } }
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 string ActionCancelComback(string selectedIds) { using (var context = new VnrHrmDataContext()) { string message = string.Empty; var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var repo = new Hre_StopWorkingRepository(unitOfWork); var profileServices = new Hre_ProfileServices(); string status = string.Empty; List<Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList(); var lstSuspenses = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList(); foreach (var Suspense in lstSuspenses) { Suspense.DateComeBack = null; Suspense.RequestDateComeBack = null; Suspense.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_APPROVED.ToString(); } repo.SaveChanges(); message = NotificationType.Success.ToString(); return message; } }