Compare commits

...

2 Commits

2 changed files with 8 additions and 5 deletions

View File

@@ -1570,9 +1570,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
createdWorkshop.InstitutionContractWorkshopGroupId,createdWorkshop.WorkshopGroup, createdWorkshop.InstitutionContractWorkshopGroupId,createdWorkshop.WorkshopGroup,
createdWorkshop.WorkshopId!.Value, createdWorkshop.id); createdWorkshop.WorkshopId!.Value, createdWorkshop.id);
institutionContract.WorkshopGroup.AddCurrentWorkshop(currentWorkshop); institutionContract.WorkshopGroup.AddCurrentWorkshop(currentWorkshop);
} }
if (institutionContract.WorkshopGroup.InitialWorkshops.All(x => x.WorkshopCreated && x.WorkshopId is > 0)) if (institutionContract.WorkshopGroup.InitialWorkshops.All(x => x.WorkshopCreated && x.WorkshopId is > 0))

View File

@@ -329,8 +329,10 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
InstitutionPlanSearchModel searchModel) InstitutionPlanSearchModel searchModel)
{ {
var planPercentage = await _context.PlanPercentages.FirstOrDefaultAsync(); var planPercentage = await _context.PlanPercentages.FirstOrDefaultAsync();
if (planPercentage == null) if (planPercentage == null)
return new PagedResult<InstitutionPlanListDto>(); return new PagedResult<InstitutionPlanListDto>();
var dailyWageYearlySalery = await _context.YearlySalaries.Include(i => i.YearlySalaryItemsList).FirstOrDefaultAsync(x => var dailyWageYearlySalery = await _context.YearlySalaries.Include(i => i.YearlySalaryItemsList).FirstOrDefaultAsync(x =>
x.StartDate.Date <= DateTime.Now.Date && x.EndDate >= DateTime.Now.Date); x.StartDate.Date <= DateTime.Now.Date && x.EndDate >= DateTime.Now.Date);
if (dailyWageYearlySalery == null) if (dailyWageYearlySalery == null)
@@ -340,9 +342,12 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
.Select(x => x.ItemValue).FirstOrDefault(); .Select(x => x.ItemValue).FirstOrDefault();
var plans = _context.InstitutionPlans.AsQueryable(); var plans = _context.InstitutionPlans.AsQueryable();
if (searchModel.CountPeron > 0) if (searchModel.CountPeron > 0)
plans = plans.Where(x => x.CountPerson == searchModel.CountPeron); plans = plans.Where(x => x.CountPerson == searchModel.CountPeron);
var count = await plans.CountAsync();
var planQueryFilter =await plans.ApplyPagination(searchModel.PageIndex, searchModel.PageSize).ToListAsync(); var planQueryFilter =await plans.ApplyPagination(searchModel.PageIndex, searchModel.PageSize).ToListAsync();
var planResult = planQueryFilter.Select(plan => var planResult = planQueryFilter.Select(plan =>
new InstitutionPlanViewModel new InstitutionPlanViewModel
@@ -403,7 +408,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
return new PagedResult<InstitutionPlanListDto>() return new PagedResult<InstitutionPlanListDto>()
{ {
TotalCount = finalResult.Count, TotalCount = count,
List = finalResult List = finalResult
}; };