public AllowanceAllowEnum IsAllowanceActive(int AllowanceID) { AllowanceAllowEnum result = AllowanceAllowEnum.NotAllowedBecauseOfStoped; AllowancesBLL allowance = GetAllowances().SingleOrDefault(x => x.AllowanceID.Equals(AllowanceID) && x.IsActive); if (allowance != null) { if (allowance.AllowanceID > 0) { result = AllowanceAllowEnum.Done; } } return(result); }
public ActionResult HiringNewEmployee() { HiringNewEmployeesViewModel HiringNewEmployeesViewModel = new HiringNewEmployeesViewModel(); List <AllowancesBLL> allowances = new HCMBLL.AllowancesBLL().GetAllowances(); HiringNewEmployeesViewModel.Allowances = new List <AllowancesBLL>(); foreach (var allowance in allowances) { if (allowance.AllowanceID == (int)AllowancesEnum.AllowanceForTheNatureOfCadresWork || allowance.AllowanceID == (int)AllowancesEnum.AllowanceForWorkHoursDiffrence) { HiringNewEmployeesViewModel.Allowances.Add(allowance); } } return(View(HiringNewEmployeesViewModel)); }