Update elenco pedane in visualizzazione

This commit is contained in:
Samuele Locatelli
2021-04-21 10:05:39 +02:00
parent 13d4c4101e
commit f53a23b009
3 changed files with 46 additions and 35 deletions
+5 -4
View File
@@ -11,12 +11,13 @@
<asp:LinkButton runat="server" ID="lbtShowAdd" CssClass="btn btn-block btn-info" OnClick="lbtShowAdd_Click" ToolTip="Aggiungi nuova pedana"><i class="fa fa-plus" aria-hidden="true"></i> Nuova Pedana</asp:LinkButton>
</div>
<div class="col-3">
<asp:LinkButton runat="server" ID="lbtSetStarted" CssClass="btn btn-block btn-warning" OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmStarted") %>' OnClick="lbtSetStarted_Click" ToolTip="Preparazione PackList INIZIATA">INIZIA <i class="fa fa-hourglass-start" aria-hidden="true"></i></asp:LinkButton>
<asp:Label runat="server" ID="lblStatus01" CssClass="btn btn-block btn-outline-info disabled">Richiesta <i class="fa fa-cubes" aria-hidden="true"></i></asp:Label>
</div>
<div class="col-3">
<asp:LinkButton runat="server" ID="lbtSetCompleted" CssClass="btn btn-block btn-success" OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmShipEnabled") %>' OnClick="lbtSetCompleted_Click" ToolTip="Preparazione PackList COMPLETATA">Spedibile <i class="fa fa-hourglass-end" aria-hidden="true"></i></asp:LinkButton>
<asp:Label runat="server" ID="lblStatus02" CssClass="btn btn-block btn-outline-warning disabled">Iniziata <i class="fa fa-hourglass-start" aria-hidden="true"></i></asp:Label>
</div>
<div class="col-3">
<asp:Label runat="server" ID="lblStatus03" CssClass="btn btn-block btn-outline-success disabled">Spedibile <i class="fa fa-hourglass-end" aria-hidden="true"></i></asp:Label>
<%--<asp:LinkButton runat="server" ID="lbtPrintReport" CssClass="btn btn-block btn-primary" OnClick="lbtPrintReport_Click" ToolTip="Stampa report dettagliato pedane (A4)">REPORT Dettaglio <i class="fas fa-print"></i></asp:LinkButton>--%>
</div>
</div>
@@ -34,7 +35,7 @@
<div class="row">
<div class="col-12 px-0">
<asp:HiddenField runat="server" ID="hfLastCmd" />
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="AL" DataSourceID="ods" CssClass="table table-striped table-condensed table-sm small" AllowPaging="True" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnRowCommand="grView_RowCommand" OnRowCancelingEdit="grView_RowCancelingEdit" OnRowEditing="grView_RowEditing" OnRowUpdated="grView_RowUpdated">
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="AL" DataSourceID="ods" CssClass="table table-striped table-condensed table-sm small" AllowPaging="True" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnRowCommand="grView_RowCommand" OnRowCancelingEdit="grView_RowCancelingEdit" OnRowEditing="grView_RowEditing" OnRowUpdated="grView_RowUpdated" AllowSorting="true">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
@@ -57,9 +58,9 @@
<asp:LinkButton ID="lbtUpdate" runat="server" CausesValidation="False" CommandName="Update" CssClass="btn btn-sm btn-success"><i class="fas fa-check"></i></asp:LinkButton>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Descr" HeaderText="Descr" SortExpression="Descr" />
<asp:BoundField DataField="AL" HeaderText="AL" ReadOnly="True" SortExpression="AL" />
<asp:BoundField DataField="CurrState" HeaderText="Stato" SortExpression="CurrState" ReadOnly="true" />
<asp:BoundField DataField="Descr" HeaderText="Descr" SortExpression="Descr" />
<asp:BoundField DataField="DtRec" HeaderText="Data" SortExpression="DtRec" DataFormatString="{0:yyyy-MM-dd}" ReadOnly="true" />
<%--<asp:BoundField DataField="CodSoggetto" HeaderText="Opr" SortExpression="CodSoggetto" />--%>
<asp:BoundField DataField="NumUdc" HeaderText="# Udc" SortExpression="NumUdc" ReadOnly="true" />
+28 -27
View File
@@ -55,7 +55,7 @@ namespace MP_MAG.WebUserControls
{
hfPackListID.Value = $"{value}";
doUpdate();
checkBtn();
checkStatus();
}
}
@@ -63,19 +63,33 @@ namespace MP_MAG.WebUserControls
#region Private Methods
private void checkBtn()
private void checkStatus()
{
// verifica buttons secondo stato PackList...
var tabPL = MagDataLayerObj.taPList.getByKey(PackListID);
bool showStart = false;
bool showEnd = false;
if (tabPL.Rows.Count > 0)
lblStatus01.Visible = false;
lblStatus02.Visible = false;
lblStatus03.Visible = false;
if (tabPL != null && tabPL.Rows.Count > 0)
{
showStart = (tabPL[0].PackStatus == 1);
showEnd = (tabPL[0].PackStatus == 2);
switch (tabPL[0].PackStatus)
{
case 1:
lblStatus01.Visible = true;
break;
case 2:
lblStatus02.Visible = true;
break;
case 3:
lblStatus03.Visible = true;
break;
default:
break;
}
}
lbtSetStarted.Visible = showStart;
lbtSetCompleted.Visible = showEnd;
}
private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e)
@@ -195,9 +209,12 @@ namespace MP_MAG.WebUserControls
MagDataLayer.man.taEAL.insertQuery(DateTime.Today, "PED", currCodOpr, txtDescr.Text.Trim(), PackListID, TaraAL);
// nascondo add...
toggleAddNew();
#if false
// aggiorno packList a iniziata...
MagDataLayerObj.taPList.updateStatus(PackListID, 2);
checkBtn();
#endif
checkStatus();
// update!!!
grView.DataBind();
}
@@ -225,20 +242,6 @@ namespace MP_MAG.WebUserControls
resetSelezione();
}
protected void lbtSetCompleted_Click(object sender, EventArgs e)
{
MagDataLayerObj.taPList.updateStatus(PackListID, 3);
checkBtn();
resetSelezione();
}
protected void lbtSetStarted_Click(object sender, EventArgs e)
{
MagDataLayerObj.taPList.updateStatus(PackListID, 2);
checkBtn();
resetSelezione();
}
/// <summary>
/// Mostra btn add new
/// </summary>
@@ -262,11 +265,9 @@ namespace MP_MAG.WebUserControls
grView.PageSize = cmp_numRow.numRow;
divAddNew.Visible = false;
lastCmd = "";
lbtSetStarted.DataBind();
lbtSetCompleted.DataBind();
}
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
checkBtn();
checkStatus();
}
#endregion Protected Methods
+13 -4
View File
@@ -24,22 +24,31 @@ namespace MP_MAG.WebUserControls
protected global::System.Web.UI.WebControls.LinkButton lbtShowAdd;
/// <summary>
/// lbtSetStarted control.
/// lblStatus01 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtSetStarted;
protected global::System.Web.UI.WebControls.Label lblStatus01;
/// <summary>
/// lbtSetCompleted control.
/// lblStatus02 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtSetCompleted;
protected global::System.Web.UI.WebControls.Label lblStatus02;
/// <summary>
/// lblStatus03 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblStatus03;
/// <summary>
/// divAddNew control.