public Ins_InsuranceSalaryPaybackModel DeleteOrRemove(string id) { //ActionService service = new ActionService(UserLogin); //var result = service.DeleteOrRemove<Ins_InsuranceSalaryPaybackEntity, Ins_InsuranceSalaryPaybackModel>(id); var model = new Ins_InsuranceSalaryPaybackModel { ActionStatus = "Success" }; InsuranceServices service = new InsuranceServices(); service.DeleteInsurancePayBack(id); return model; }
public ActionResult AnalyzeInsurance([DataSourceRequest] DataSourceRequest request, Ins_ProfileInsuranceMonthlySearchModel model) { var messageReturn = "Success"; var insService = new InsuranceServices(); var dateCheck = DateTime.Now; string orgs = null; var periodInsurance = string.Empty; var codeEmp = string.Empty; if (model != null) { if (model.MonthYear.HasValue) { dateCheck = model.MonthYear.Value; } orgs = model.OrgStructureID; periodInsurance = Request["PeriodInsurance"] != null ? Request["PeriodInsurance"].ToString() : string.Empty; codeEmp = Request[Ins_ProfileInsuranceMonthlyModel.FieldNames.CodeEmp] != null ? Request[Ins_ProfileInsuranceMonthlyModel.FieldNames.CodeEmp].ToString() : string.Empty; } try { if (_isProcessing == false) { _isProcessing = true; insService.AnalyzeAndSaveInsuranceByMonth(orgs, dateCheck, periodInsurance, codeEmp, model.SocialInsPlaceIDs,UserLogin); } else { messageReturn = "IsProcessing"; } } catch (Exception) { _isProcessing = false; } _isProcessing = false; return Json(messageReturn); }
public ActionResult InsuranceReceiveSocialInsSelected(string selectedIds) { var profileIds = selectedIds.Split(',') .Where(g => { Guid temp; return Guid.TryParse(g, out temp); }) .Select(s => Guid.Parse(s)).ToList(); var service = new InsuranceServices(); var result = service.InsuranceReceiveSocialInsSelected(profileIds); return Json(result, JsonRequestBehavior.AllowGet); }
public ActionResult GetProfileMonthly(Guid profileId, DateTime fromMonthEffect) { var insService = new InsuranceServices(); var profileMonthly = insService.GetProfileMonthly(profileId, fromMonthEffect); var result = new { AmoutHDTIns = 0.0, InsSalary = 0.0, JobName = string.Empty, SocialInsPlaceID = Guid.Empty, IsSocialInsurance = false, IsHealthInsurance = false, IsUnEmpInsurance = false }; if (profileMonthly != null) { result = new { AmoutHDTIns = profileMonthly.AmountHDTIns ?? 0, InsSalary = profileMonthly.SalaryInsurance ?? 0, JobName=profileMonthly.JobName , SocialInsPlaceID = profileMonthly.SocialInsPlaceID??Guid.Empty, IsSocialInsurance = profileMonthly.IsSocialInsurance??false, IsHealthInsurance = profileMonthly.IsHealthInsurance??false, IsUnEmpInsurance = profileMonthly.IsUnEmpInsurance??false }; } return Json(result); }
public ActionResult CalculateInsurancePayBack(List<Guid> payBackIds,DateTime monthYear) { var messageReturn = "Success"; var insService = new InsuranceServices(); insService.CalculateInsurancePayBack(payBackIds, monthYear, UserLogin); return Json(messageReturn); }
public JsonResult GetMultiTypeD02CommentCode(string text) { string status = string.Empty; var service = new InsuranceServices(); var get = service.GetTypeD02CommentList(text); if (get != null) { var result = get.Select(item => new Ins_TypeD02MultiEntity() { ID = item.ID, Code = item.Code, Name = item.Name }); return Json(result, JsonRequestBehavior.AllowGet); } return Json(null); }
/// <summary>Thai Sản</summary> /// <param name="MonthYear"></param> /// <param name="lstLeaveDayPregByProfile"></param> /// <param name="lstInsuranceRecordPregByProfile"></param> /// <returns></returns> public bool HasPregnant(DateTime MonthYear, List<Att_LeaveDay> lstLeaveDayPregByProfile, List<Ins_InsuranceRecord> lstInsuranceRecordPregByProfile) { InsuranceServices service = new InsuranceServices(); var isPreg = service.HasPregnant(MonthYear, lstLeaveDayPregByProfile, lstInsuranceRecordPregByProfile); return isPreg; }
public List<Ins_ReportEmpHardJob2ndEntity> ReportEmpHardJob2nd(string orgs, DateTime monthCheck, string userLogin) { using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); string status = string.Empty; #region ds NV đóng Bảo Hiểm theo phòng ban và tháng (Ins_ProfileInsuranceMonthly) var listInsMonthlyObj = new List<object> { orgs, monthCheck, null, 1, int.MaxValue - 1 }; if (Common.UseDataBaseName == DATABASETYPE.SQLSERVER.ToString()) { listInsMonthlyObj.Add("id"); } var lstProfileInsuranceMonthlyInDb = GetData<Ins_ProfileInsuranceMonthlyEntity>(listInsMonthlyObj, ConstantSql.hrm_ins_sp_get_ProfileInsMonthly, userLogin, ref status).Translate<Ins_ProfileInsuranceMonthly>(); #endregion var hreProfileIds = lstProfileInsuranceMonthlyInDb.Select(m => m.ProfileID).ToList(); var hreProfiles = unitOfWork.CreateQueryable<Hre_Profile>(Guid.Empty, m => hreProfileIds.Contains(m.ID)).Select(m => new { ProfileID = m.ID, ProfileName = m.ProfileName, CodeEmp = m.CodeEmp }).ToList(); List<Ins_ReportEmpHardJob2ndEntity> reportEmpHardJob2nds = new List<Ins_ReportEmpHardJob2ndEntity>(); var stt = 1; #region hdtJOb string E_APPROVE = HDTJobStatus.E_APPROVE.ToString(); var profileIDs = lstProfileInsuranceMonthlyInDb.Select(m => m.ProfileID).Distinct().ToList(); var approved = RosterStatus.E_APPROVED.ToString(); string app = LeaveDayStatus.E_APPROVED.ToString(); var beginMonth = new DateTime(monthCheck.Year, monthCheck.Month, 1); var endMonth = beginMonth.AddMonths(1).AddMinutes(-1); InsuranceServices insService = new InsuranceServices(); List<string> lstLeaveInsuranceType = String.Join(",", insService.leaveDayInsuranceTypes).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); var leaveDayTypeIDs = unitOfWork.CreateQueryable<Cat_LeaveDayType>(Guid.Empty, m => m.PaidRate == 0 || lstLeaveInsuranceType.Contains(m.InsuranceType)).Select(m => m.ID).ToList(); var rosters = unitOfWork.CreateQueryable<Att_Roster>(Guid.Empty, p => p.Status == approved && (p.DateStart <= endMonth && p.DateEnd >= beginMonth) && profileIDs.Contains(p.ProfileID)) .Select(m => new CustomRosterEntity() { ProfileID = m.ProfileID, DateStart = m.DateStart, DateEnd = m.DateEnd, MonShiftID = m.MonShiftID, TueShiftID = m.TueShiftID, WedShiftID = m.WedShiftID, ThuShiftID = m.ThuShiftID, FriShiftID = m.FriShiftID, SatShiftID = m.SatShiftID, SunShiftID = m.SunShift2ID }) .ToList(); var lstLeaveDay = unitOfWork.CreateQueryable<Att_LeaveDay>(Guid.Empty, m => m.Status == app && m.DateStart <= endMonth && m.DateEnd >= beginMonth && profileIDs.Contains(m.ProfileID)) .Select(m => new CustomLeavedayEntity() { ProfileID = m.ProfileID, DateStart = m.DateStart, DateEnd = m.DateEnd, LeaveDayTypeID = m.LeaveDayTypeID }).ToList(); lstLeaveDay = lstLeaveDay.Where(m => m.LeaveDayTypeID != null && leaveDayTypeIDs.Contains(m.LeaveDayTypeID.Value)).ToList(); var lstHDTJob = unitOfWork.CreateQueryable<Hre_HDTJob>(Guid.Empty, m => m.Status == E_APPROVE && m.DateFrom <= endMonth && m.DateTo >= beginMonth && m.ProfileID.HasValue && profileIDs.Contains(m.ProfileID.Value)).ToList(); var lstProfileEntitiesTemp = lstProfileInsuranceMonthlyInDb.Where(m => m.ProfileID.HasValue && profileIDs.Contains(m.ProfileID)).Select(m => new Hre_ProfileEntity { ID = m.ProfileID.Value, IsDecreaseWorkingDays = m.IsDecreaseWorkingDays, NumdayNonHDTJob = 0, NumdayHDTJobTypeIV = 0, NumdayHDTJobTypeV = 0 }).ToList(); InsuranceServices.GetHDTJobDayByProfile(lstProfileEntitiesTemp, leaveDayTypeIDs, monthCheck, rosters, lstLeaveDay, lstHDTJob); #endregion foreach (var profileMonthly in lstProfileInsuranceMonthlyInDb) { var empHard2nd = new Ins_ReportEmpHardJob2ndEntity(); empHard2nd.Stt = stt++; var profileObj = hreProfiles.Where(m => m.ProfileID == profileMonthly.ProfileID).FirstOrDefault(); var profileHdtJob = lstProfileEntitiesTemp.Where(m => m.ID == profileMonthly.ProfileID).FirstOrDefault(); if (profileObj != null) { empHard2nd.CodeEmp = profileObj.CodeEmp; empHard2nd.ProfileName = profileObj.ProfileName; } if (profileObj != null) { if (profileHdtJob.NumdayNonHDTJob.HasValue && profileHdtJob.NumdayNonHDTJob.Value == int.MaxValue) { profileHdtJob.NumdayNonHDTJob = 0; } empHard2nd.DaysNonHDTJob = profileHdtJob.NumdayNonHDTJob ?? 0; if (profileHdtJob.NumdayHDTJobTypeV >= profileHdtJob.NumdayHDTJobTypeIV) { empHard2nd.HDTJobType = EnumDropDown.HDTJobType.E_TYPE5.ToString(); } else { empHard2nd.HDTJobType = EnumDropDown.HDTJobType.E_TYPE4.ToString(); } } empHard2nd.JobName = profileMonthly.JobName; empHard2nd.AmountHDTIns = profileMonthly.AmountHDTIns; reportEmpHardJob2nds.Add(empHard2nd); } return reportEmpHardJob2nds; } return null; }