COmpletata gestione deroga con visuals

This commit is contained in:
Samuele Locatelli
2021-07-27 19:00:20 +02:00
parent 9ccefa2aec
commit 52fdc60ca3
5 changed files with 70 additions and 23 deletions
+38 -6
View File
@@ -120,7 +120,7 @@ namespace MoonProTablet.WebUserControls
set
{
hfValueRead.Value = value.Trim();
lblExtCode.Visible = !string.IsNullOrEmpty(value);
lblExtCode.Visible = !string.IsNullOrEmpty(value);
}
}
@@ -216,6 +216,36 @@ namespace MoonProTablet.WebUserControls
}
}
public string derogaCss
{
get
{
string answ = enableForceParamSchedaTecnica && hasDeroga ? " bg-warning" : "";
return answ;
}
}
protected bool hasDeroga
{
get
{
bool answ = false;
try
{
var currDeroga = DataLayerObj.getDerogaSt(idxST);
answ = (currDeroga != null);
if (answ)
{
answ = (currDeroga.CanForce && currDeroga.Num == dataNum && currDeroga.CodGruppo == dataGroup && currDeroga.CodTipo == dataType);
}
}
catch
{ }
return answ;
}
}
#endregion Public Properties
#region Private Methods
@@ -238,7 +268,8 @@ namespace MoonProTablet.WebUserControls
bool doShow = showMissingData;
lblError.Visible = doShow;
lblChecked.Visible = doShow;
lbtForce.Visible = doShow && enableForceParamSchedaTecnica;
lbtForce.Visible = doShow && enableForceParamSchedaTecnica && !hasDeroga;
lblDeroga.Visible = doShow && enableForceParamSchedaTecnica && hasDeroga;
}
#endregion Private Methods
@@ -256,14 +287,15 @@ namespace MoonProTablet.WebUserControls
// registro abilitazione forzatura parametro per un periodo limitato
StCheckOverride newDeroga = new StCheckOverride()
{
CanForce=enableForceParamSchedaTecnica,
Num= dataNum,
CodTipo= dataType,
CodGruppo=dataGroup,
CanForce = enableForceParamSchedaTecnica,
Num = dataNum,
CodTipo = dataType,
CodGruppo = dataGroup,
IdxST = idxST
};
// salvo
DataLayerObj.setDerogaSt(newDeroga);
Response.Redirect(Request.RawUrl);
}
}
}