This commit is contained in:
Samuele Locatelli
2023-01-16 12:19:54 +01:00
2 changed files with 45 additions and 13 deletions
+1 -1
View File
@@ -154,7 +154,7 @@ else
else
{
<div class="timeContainer">
<input type="time" />
<input @bind="@dtMancTimb" type="time" />
</div>
}
}
+44 -12
View File
@@ -29,12 +29,14 @@ namespace GPW.CORE.Smart.Components
protected string emptyTime = "--/--";
protected DailyDataDTO? timbratureOggi = null;
protected DateTime dtMancTimb { get; set; } = DateTime.Now;
#endregion Protected Fields
#region Protected Properties
protected bool isApproved { get; set; } = true;
protected bool isApprovedEntr { get; set; } = true;
protected bool isApprovedEsc { get; set; } = true;
#endregion Protected Properties
@@ -71,33 +73,43 @@ namespace GPW.CORE.Smart.Components
private void changeMode()
{
showGauge = !showGauge;
showGauge = false;
}
#if false
private async void checkApp(DateTime? dtRif)
{
isApprovedEntr = true;
isApprovedEsc = true;
DateTime dtScelta = dtRif ?? DateTime.Today;
listTimb = await CSDataService.TimbratureDay(dtScelta, IdxDipendente);
if (listTimb != null)
{
if (listTimb.Count == 1)
if (listTimb.Count != 0)
{
Timb = listTimb.FirstOrDefault();
if (Timb.Approv == true)
foreach (var item in listTimb)
{
isApproved = false;
if (item.Approv == false && item.Entrata == true)
{
isApprovedEntr = false;
}
else if (item.Approv == false && item.Entrata == false)
{
isApprovedEsc = false;
}
}
}
}
}
}
#endif
private string cssChooseEntr(DateTime? dtRif)
{
checkApp(dtRif);
string answ = "";
try
{
answ = (isApproved) ? "text-success" : "text-danger";
answ = (isApprovedEntr) ? "text-success" : "text-danger";
}
catch
{ }
@@ -106,11 +118,10 @@ namespace GPW.CORE.Smart.Components
private string cssChooseEsc(DateTime? dtRif)
{
checkApp(dtRif);
string answ = "";
try
{
answ = (isApproved) ? "text-primary" : "text-danger";
answ = (isApprovedEsc) ? "text-primary" : "text-danger";
}
catch
{ }
@@ -173,11 +184,32 @@ namespace GPW.CORE.Smart.Components
navManager.NavigateTo("TempRil");
}
private void updateDetail()
private async void updateDetail()
{
isApprovedEntr = true;
isApprovedEsc = true;
if (ListRecords != null)
{
timbratureOggi = ListRecords.Where(x => x.DtRif == dtCurr).FirstOrDefault();
listTimb = await CSDataService.TimbratureDay(dtCurr, IdxDipendente);
if (listTimb != null)
{
if (listTimb.Count != 0)
{
foreach (var item in listTimb)
{
if (item.Approv == false && item.Entrata == true)
{
isApprovedEntr = false;
}
else if (item.Approv == false && item.Entrata == false)
{
isApprovedEsc = false;
}
}
}
}
}
}