Ancora udpate x pagina RilTemp
This commit is contained in:
@@ -19,18 +19,49 @@
|
||||
<div class="card-body text-center">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
gestione temperature rilevate + insert quotidiano <b>@TargetDate.ToShortDateString()</b>
|
||||
@if (currRecord != null)
|
||||
{
|
||||
<div>
|
||||
Temp odierna
|
||||
<b>@currRecord.TempRil</b>
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<b>@TargetDate.ToString("ddd dd/MM/yyyy")</b>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<LoadingDataSmall></LoadingDataSmall>
|
||||
}
|
||||
<div class="card-body">
|
||||
@if (currRecord != null)
|
||||
{
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-thermometer-half"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="number" @bind="@currRecord.TempRil"></input>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-success btn-block" title="Salva temperatura" @onclick="() => DoSave()"><i class="far fa-save"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<LoadingDataSmall></LoadingDataSmall>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" style="width:3em;">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select @bind="@numDays" class="form-control" title="finestra analisi">
|
||||
<option value="30">1 Mese</option>
|
||||
<option value="60">2 Mese</option>
|
||||
<option value="90">3 Mese</option>
|
||||
<option value="180">6 Mese</option>
|
||||
<option value="365">1 Anno</option>
|
||||
<option value="730">2 Anno</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@if (listRilTemp != null)
|
||||
@@ -58,7 +89,19 @@
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private int numDays = 60;
|
||||
private int numDays
|
||||
{
|
||||
get
|
||||
{
|
||||
return _numDays;
|
||||
}
|
||||
set
|
||||
{
|
||||
_numDays = value;
|
||||
var pUpd = Task.Run(async () => await ReloadData());
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> CloseReq { get; set; }
|
||||
@@ -77,6 +120,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
protected int _numDays = 30;
|
||||
protected DateTime _targetDate { get; set; } = DateTime.Today;
|
||||
|
||||
protected List<chartJsData.chartJsTSerie>? listRilTemp { get; set; } = null;
|
||||
@@ -114,5 +158,21 @@
|
||||
histLabel = histDict.Keys.ToArray();
|
||||
// cerco se c'è dato odierno della temperatura...
|
||||
currRecord = rawData.Where(x => x.DtRilievo == TargetDate).FirstOrDefault();
|
||||
if (currRecord == null)
|
||||
{
|
||||
currRecord = new RilievoTempModel()
|
||||
{
|
||||
DtRilievo = DateTime.Now,
|
||||
TempRil = 0
|
||||
};
|
||||
}
|
||||
}
|
||||
// effettua salvataggio misurazione temperatura
|
||||
protected async void DoSave()
|
||||
{
|
||||
// chiamo classe gestione che salva e resetta cache dati...
|
||||
|
||||
// chiamo chiusura!
|
||||
await CloseReq.InvokeAsync(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user