Altre prove x accettazione deroghe

This commit is contained in:
Samuele Locatelli
2021-07-27 13:29:50 +02:00
parent 2036cda148
commit 9ccefa2aec
5 changed files with 22 additions and 11 deletions
+2 -2
View File
@@ -6,12 +6,12 @@
<asp:Repeater ID="repDetail" runat="server" DataSourceID="ods">
<ItemTemplate>
<div class="border border-bottom-secondary">
<uc1:cmp_ST_objView runat="server" ID="cmp_ST_objView" dataType='<%# Eval("CodTipo") %>' idxST='<%# Eval("IdxST") %>' num='<%# Eval("Num") %>' dataLabel='<%# traduci(Eval("Label")) %>' dataValue='<%# Eval("Value") %>' dataValueRead='<%# Eval("ValueRead") %>' extCode='<%# Eval("ExtCode") %>' required='<%# Eval("Required") %>' />
<uc1:cmp_ST_objView runat="server" ID="cmp_ST_objView" dataType='<%# Eval("CodTipo") %>' dataGroup='<%# Eval("CodGruppo") %>' idxST='<%# Eval("IdxST") %>' num='<%# Eval("Num") %>' dataLabel='<%# traduci(Eval("Label")) %>' dataValue='<%# Eval("Value") %>' dataValueRead='<%# Eval("ValueRead") %>' extCode='<%# Eval("ExtCode") %>' required='<%# Eval("Required") %>' />
</div>
</ItemTemplate>
<AlternatingItemTemplate>
<div class="">
<uc1:cmp_ST_objView runat="server" ID="cmp_ST_objView" dataType='<%# Eval("CodTipo") %>' idxST='<%# Eval("IdxST") %>' num='<%# Eval("Num") %>' dataLabel='<%# traduci(Eval("Label")) %>' dataValue='<%# Eval("Value") %>' dataValueRead='<%# Eval("ValueRead") %>' extCode='<%# Eval("ExtCode") %>' required='<%# Eval("Required") %>' />
<uc1:cmp_ST_objView runat="server" ID="cmp_ST_objView" dataType='<%# Eval("CodTipo") %>' dataGroup='<%# Eval("CodGruppo") %>' idxST='<%# Eval("IdxST") %>' num='<%# Eval("Num") %>' dataLabel='<%# traduci(Eval("Label")) %>' dataValue='<%# Eval("Value") %>' dataValueRead='<%# Eval("ValueRead") %>' extCode='<%# Eval("ExtCode") %>' required='<%# Eval("Required") %>' />
</div>
</AlternatingItemTemplate>
</asp:Repeater>
+15 -2
View File
@@ -121,9 +121,9 @@ namespace MoonProTablet.WebUserControls
var trovatoBatch = tabRichieste.Where(x => x.CheckType == "BATCH");
if (trovatoBatch != null && trovatoBatch.Count() > 0)
{
datiBatchCheck = trovatoBatch.FirstOrDefault();
if (tabGiacenzeLotto != null && tabGiacenzeLotto.Count > 0)
{
datiBatchCheck = trovatoBatch.FirstOrDefault();
datiLotto = tabGiacenzeLotto.FirstOrDefault();
// registro trovato
@@ -143,8 +143,21 @@ namespace MoonProTablet.WebUserControls
lblMessage.CssClass = "text-danger";
}
}
else
{
// verifico EVENTUALI deroghe
var currDeroga = DataLayerObj.getDerogaSt(tabRichieste[0].IdxST);
// se è deroga x gruppo/tipo/num corretto...
if (currDeroga.CanForce && tabRichieste[0].CodGruppo == currDeroga.CodGruppo && tabRichieste[0].CodTipo == currDeroga.CodTipo && tabRichieste[0].Num == currDeroga.Num)
{
// ... forzo accettazione deroga
DataLayerObj.taSTChk.upsertQuery(idxOdl, datiBatchCheck.IdxST, datiBatchCheck.Oggetto, datiBatchCheck.Num, BCodeVal, tabRichieste[0].Value, true, user_std.UtSn.utente);
lblMessage.Text = $"Lotto/articolo non valido: {BCodeVal} --> Forzato a valido per articolo {tabRichieste[0].Value}";
lblMessage.CssClass = "text-warning";
DataLayerObj.setDerogaSt(new MapoSDK.StCheckOverride() { IdxST = tabRichieste[0].IdxST, CanForce = false });
}
}
}
}
// se non trovato
if (!found)
@@ -256,14 +256,13 @@ namespace MoonProTablet.WebUserControls
// registro abilitazione forzatura parametro per un periodo limitato
StCheckOverride newDeroga = new StCheckOverride()
{
ValidUntil=DateTime.Now.AddMinutes(2),
CanForce=enableForceParamSchedaTecnica,
Num= dataNum,
CodTipo= dataType,
CodGruppo=dataGroup,
IdxST = idxST
};
// salvo
DataLayerObj.setDerogaSt(newDeroga);
}
}
+4 -4
View File
@@ -168,8 +168,8 @@ namespace MapoDb
public StCheckOverride getDerogaSt(int idxST)
{
StCheckOverride answ = new StCheckOverride() { IdxST = idxST };
string keyDerogaST = $"derogaSt_{idxST:000}";
string rawData = memLayer.ML.StringSessionObj(keyDerogaST);
string keyDerogaST = memLayer.ML.redHash($"DerogaSt:{user_std.UtSn.utente}:{idxST:000}");
string rawData = memLayer.ML.getRSV(keyDerogaST);
if (!string.IsNullOrEmpty(rawData))
{
try
@@ -187,9 +187,9 @@ namespace MapoDb
bool fatto = false;
try
{
string keyDerogaST = $"derogaSt_{deroga.IdxST:000}";
string keyDerogaST = memLayer.ML.redHash($"DerogaSt:{user_std.UtSn.utente}:{deroga.IdxST:000}");
string rawData = JsonConvert.SerializeObject(deroga);
memLayer.ML.setSessionVal(keyDerogaST, rawData);
memLayer.ML.setRSV(keyDerogaST, rawData, 60*2);
fatto = true;
}
catch
-1
View File
@@ -990,6 +990,5 @@ namespace MapoSDK
public string CodTipo { get; set; } = "";
public int IdxST { get; set; } = 0;
public int Num { get; set; } = 0;
public DateTime ValidUntil { get; set; } = DateTime.Now;
}
}