Updated daily report to show correct information when two work weeks split quarters.
Also current changes to project with Blazor implementation is implemented here as well.
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
@page "/PlanningReports"
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 d-grid">
|
||||
<button class="btn btn-outline-secondary text-start" @onclick="((e) => OpenDialog())"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Weekly Part Changes Report</span></button>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,16 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
using ReportingServices.Blazor.Components;
|
||||
|
||||
namespace ReportingServices.Blazor.Pages.PlanningReports;
|
||||
|
||||
public partial class PlanningReports
|
||||
{
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
[Inject]
|
||||
public IDialogService Dialog { get; set; }
|
||||
|
||||
private void OpenDialog() => Dialog.Show<DatePickerModal>("Date Picker", new DialogOptions());
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
@page "/PlanningReports/WeeklyPartChangesReport"
|
||||
|
||||
<ReportHeader Title="Weekly Part Changes Report" Date="@DateTime.Now"></ReportHeader>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<p>Number of Part Changes: @WeeklyPartChanges.TotalPartChanges</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<p class="text-end">Date Range: @WeeklyPartChanges.StartDate - @WeeklyPartChanges.EndDate</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MudTable Items="@WeeklyPartChanges.ReactorPSNWORuns" Hover="true" SortLabel="Sort By" RowsPerPage="15">
|
||||
<HeaderContent>
|
||||
<MudTh><MudTableSortLabel SortBy="new Func<ReactorPSNWORuns, object>(x => x.REACTOR)">Reactor</MudTableSortLabel></MudTh>
|
||||
<MudTh><MudTableSortLabel SortBy="new Func<ReactorPSNWORuns, object>(x => x.PSN)">PSN</MudTableSortLabel></MudTh>
|
||||
<MudTh><MudTableSortLabel SortBy="new Func<ReactorPSNWORuns, object>(x => x.WO_COUNT)">WO Count</MudTableSortLabel></MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Reactor">@context.REACTOR</MudTd>
|
||||
<MudTd DataLabel="PSN">@context.PSN</MudTd>
|
||||
<MudTd DataLabel="WO Count">@context.WO_COUNT</MudTd>
|
||||
</RowTemplate>
|
||||
<PagerContent>
|
||||
<MudTablePager PageSizeOptions="new int[]{ 15, 50, 100 }" />
|
||||
</PagerContent>
|
||||
</MudTable>
|
@ -0,0 +1,32 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using ReportingServices.Blazor.Services;
|
||||
using ReportingServices.Shared.Blazor.HelperClasses;
|
||||
using ReportingServices.Shared.Blazor.Models.PlanningReport;
|
||||
|
||||
namespace ReportingServices.Blazor.Pages.PlanningReports;
|
||||
|
||||
public partial class WeeklyPartChangesReport
|
||||
{
|
||||
public WeeklyPartChanges WeeklyPartChanges { get; set; } = new WeeklyPartChanges();
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
[Inject]
|
||||
public AppData? AppData { get; set; }
|
||||
|
||||
[Inject]
|
||||
public ScrapeDBService? Db { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
int numberOfPartChanges = await Db!.GetPartChangesAsync(AppData!.StartDate, AppData!.EndDate);
|
||||
List<ReactorPSNWORuns> reactorPSNWORuns = await Db.GetReactorRunsAsync(AppData!.StartDate, AppData!.EndDate);
|
||||
|
||||
WeeklyPartChanges.TotalPartChanges = numberOfPartChanges;
|
||||
WeeklyPartChanges.StartDate = AppData.StartDate.ToShortDateString();
|
||||
WeeklyPartChanges.EndDate = AppData.EndDate.ToShortDateString();
|
||||
WeeklyPartChanges.ReactorPSNWORuns = reactorPSNWORuns;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user