diff --git a/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs b/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs index df269fee..0c58f8cd 100644 --- a/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs +++ b/Query/AdminReports/Handlers/GetWorkshopWithRollCallHandler.cs @@ -107,7 +107,7 @@ namespace Query.AdminReports.Handlers ActiveEmployeesWithRollCallInLastWeekCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId && lastWeekRollCallsList.Contains(y.EmployeeId) && !leavesList.Contains(y.EmployeeId)), TotalEmployeesCount = workshopsWorkingEmployeesList.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.TotalWorkingEmployeesCount ?? 0, - UndoneWorkFlowsCount = workFlowApplication.GetAllWorkFlowCount(x.WorkshopId).Result + //UndoneWorkFlowsCount = workFlowApplication.GetAllWorkFlowCount(x.WorkshopId).Result }).OrderByDescending(x=>x.IsActive).ToList(); } diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs b/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs index f5cb29e5..08f18a94 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs +++ b/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs @@ -12,16 +12,17 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk public class IndexModel : PageModel { private readonly IAndroidApkVersionApplication _application; - //private readonly IRollCallDomainService _rollCallDomainService; - //private readonly CompanyContext _context; + private readonly IRollCallDomainService _rollCallDomainService; + private readonly CompanyContext _context; [BindProperty] public IFormFile File { get; set; } - public IndexModel(IAndroidApkVersionApplication application) + public IndexModel(IAndroidApkVersionApplication application, IRollCallDomainService rollCallDomainService, CompanyContext context) { - _application = application; - + _application = application; + _rollCallDomainService = rollCallDomainService; + _context = context; } public void OnGet() @@ -37,22 +38,22 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk public async Task OnPostShiftDate() { -// var customizeWorkshopSettings = _context.CustomizeWorkshopSettings.AsSplitQuery(); + var customizeWorkshopSettings = _context.CustomizeWorkshopSettings.AsSplitQuery(); -////#if DEBUG -//// customizeWorkshopSettings = customizeWorkshopSettings.Where(x => x.WorkshopId == 27 || x.WorkshopId == 499); -////#endif -// var rollCalls = -// _context.RollCalls.Where(x => customizeWorkshopSettings.Any(a => a.WorkshopId == x.WorkshopId)) -// .ToList(); -// foreach (var rollCall in rollCalls) -// { -// rollCall.SetShiftDate(_rollCallDomainService); -// Console.WriteLine(rollCall.id); -// } + customizeWorkshopSettings = customizeWorkshopSettings.Where(x => x.WorkshopId == 499); - //await _context.SaveChangesAsync(); + var rollCalls = + _context.RollCalls.Where(x => customizeWorkshopSettings.Any(a => a.WorkshopId == x.WorkshopId)) + .ToList(); + + foreach (var rollCall in rollCalls) + { + rollCall.SetShiftDate(_rollCallDomainService); + Console.WriteLine(rollCall.id); + } + + await _context.SaveChangesAsync(); ViewData["message"] = ""; return Page(); } diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml b/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml index c39f9e8a..08c3960b 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml +++ b/ServiceHost/Areas/AdminNew/Pages/Company/RollCall/Index.cshtml @@ -21,6 +21,7 @@ var index = 1; +