@using GPW.CORE.Data
@code {
public class WeekArg
{
public int Year { get; set; }
public int Week { get; set; }
}
[Parameter]
public CORE.Data.DTO.WeekStatDTO? currData { get; set; }
[Parameter]
public int WeekSel { get; set; } = 0;
[Parameter]
public EventCallback weekSelected { get; set; }
protected int currWeekNum
{
get
{
int answ = 0;
if (currData != null)
{
answ = currData.WeekNumber;
}
return answ;
}
}
protected int currYearNum
{
get
{
int answ = 0;
if (currData != null)
{
answ = currData.Anno;
}
return answ;
}
}
protected void reportSelect()
{
weekSelected.InvokeAsync(new WeekData(currYearNum, currWeekNum));
}
protected string selStyle
{
get
{
string currCss = "bg-secondary";
if (currData != null)
{
currCss = currData.WeekNumber == WeekSel ? "btn-primary" : "btn-secondary";
}
return currCss;
}
}
protected string styleLav
{
get
{
double valPerc = 0;
if (currData != null)
{
try
{
valPerc = currData.SumOreLav / 64;
}
catch
{ }
}
return $"width: {valPerc:P0};";
}
}
protected string styleCom
{
get
{
double valPerc = 0;
if (currData != null)
{
try
{
valPerc = currData.SumOreComm / 64;
}
catch
{ }
}
return $"width: {valPerc:P0};";
}
}
}