88 lines
2.1 KiB
C#
88 lines
2.1 KiB
C#
using GPW_data;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace GPW_Commesse.WebUserControls
|
|
{
|
|
public partial class cmp_rilTemp : BaseUserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
setupData();
|
|
}
|
|
}
|
|
|
|
public DateTime dtRif
|
|
{
|
|
get
|
|
{
|
|
|
|
DateTime answ = DateTime.Today;
|
|
DateTime.TryParse(hfDataRif.Value, out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
hfDataRif.Value = value.ToString();
|
|
setupData();
|
|
}
|
|
}
|
|
|
|
protected decimal tempRilevata
|
|
{
|
|
get
|
|
{
|
|
decimal answ = 37;
|
|
decimal.TryParse(txtTempRil.Text.Replace(".", ","), out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
|
|
txtTempRil.Text = $"{value:0.0}".Replace(",", ".");
|
|
}
|
|
}
|
|
|
|
private void setupData()
|
|
{
|
|
// recupero dati temperatura
|
|
decimal tempRil = 0;
|
|
try
|
|
{
|
|
if (DataProxy.idxDipendente > 0)
|
|
{
|
|
var tabRT = DataProxy.DP.taRT.getByKey(DataProxy.idxDipendente, dtRif);
|
|
if (tabRT != null && tabRT.Rows.Count > 0)
|
|
{
|
|
tempRil = tabRT[0].tempRil;
|
|
}
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
tempRilevata = tempRil;
|
|
}
|
|
|
|
|
|
|
|
protected void lbtSave_Click(object sender, EventArgs e)
|
|
{
|
|
DataProxy.DP.taRT.upsertQuery(DataProxy.idxDipendente, dtRif, tempRilevata);
|
|
// evento chiusura
|
|
raiseSave();
|
|
}
|
|
|
|
protected void lbtCancel_Click(object sender, EventArgs e)
|
|
{
|
|
// evento chiusura
|
|
raiseCancel();
|
|
}
|
|
}
|
|
} |