Fix comportamento selezione dettaglio batch selezionato

This commit is contained in:
Samuele E. Locatelli
2019-08-26 15:33:17 +02:00
parent efaecde44f
commit cd9a62e100
4 changed files with 114 additions and 31 deletions
+25 -19
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0"?>
<!--
Per altre informazioni su come configurare l'applicazione ASP.NET, vedere
https://go.microsoft.com/fwlink/?LinkId=169433
@@ -13,7 +13,7 @@
</sectionGroup>
</configSections>
<system.web>
<compilation targetFramework="4.6.2"/>
<compilation targetFramework="4.6.2" debug="true"/>
<httpRuntime targetFramework="4.6.2"/>
<pages>
<namespaces>
@@ -23,16 +23,18 @@
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
</controls>
</pages>
<sessionState mode="Custom" customProvider="MySessionStateStore">
<sessionState mode="Custom" customProvider="MySessionStateStore">
<providers>
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="127.0.0.1" accessKey="" ssl="false" applicationName="NKC"
databaseId="0"/>
databaseId="0"/>
</providers>
</sessionState><httpModules>
</sessionState>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
</httpModules></system.web>
</httpModules>
</system.web>
<appSettings>
<!--Configurazioni generali-->
<add key="intUpdatePagina_ms" value="120000"/>
@@ -45,27 +47,26 @@
<add key="doShrinkFolder" value="true"/>
<add key="_logLevel" value="6"/>
<add key="_logMaxMb" value="30"/>
<add key="logMitigSec" value="30"/>
<add key="logMitigSec" value="30"/>
<!--Configurazioni Redis-->
<!--<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false,allowAdmin=true" />-->
<add key="RedisConn" value="nkcredis.steamware.net,abortConnect=false,ssl=false,password=nkc.password"/>
<add key="RedisConnAdmin" value="nkcredis.steamware.net,abortConnect=false,ssl=false,password=nkc.password,allowAdmin=true"/>
<add key="redisDb" value="0"/>
<!--Configurazioni DB per classi referenziate AppData e Steamware dll-->
<add key="NKC_WFConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=conn_NKC;Password=pwd_NKC;"/>
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=conn_NKC;Password=pwd_NKC;"/>
<add key="VocabolarioConnectionString"
value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=conn_NKC;Password=pwd_NKC;"/>
</appSettings>
value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=conn_NKC;Password=pwd_NKC;"/>
</appSettings>
<connectionStrings>
<add name="AppData.Properties.Settings.Sauder_NKCConnectionString"
connectionString="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=conn_NKC;Password=pwd_NKC"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
@@ -77,7 +78,7 @@
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
</dependentAssembly>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1"/>
@@ -120,16 +121,20 @@
<add name="Session"
type="Microsoft.AspNet.SessionState.SessionStateModuleAsync, Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
preCondition="integratedMode"/>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler"/><add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"
preCondition="managedHandler"/><add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler"/></modules>
<validation validateIntegratedModeConfiguration="false"/></system.webServer>
<elmah>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler"/>
</modules>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
<elmah>
<!--
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
more information on remote access and securing ELMAH.
-->
<security allowRemoteAccess="false"/>
</elmah><location path="elmah.axd" inheritInChildApplications="false">
</elmah>
<location path="elmah.axd" inheritInChildApplications="false">
<system.web>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
@@ -142,11 +147,12 @@
<allow roles="admin" />
<deny users="*" />
</authorization>
-->
-->
</system.web>
<system.webServer>
<handlers>
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode"/>
</handlers>
</system.webServer>
</location></configuration>
</location>
</configuration>
+19 -11
View File
@@ -3,10 +3,18 @@
<div class="row">
<div class="col-12">
<h3>TAKT to STACK</h3>
<div runat="server" id="divTitle">
<div class="col-6 pr-0">
Batch List
</div>
<div class="col-6 pl-0 table-primary text-right" runat="server" id="divSelected">
<asp:Label runat="server" ID="lblTakt" />
<asp:LinkButton ID="lbtResetGlob" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true" ToolTip="Reset"><i class="fa fa-refresh"></i></asp:LinkButton>
</div>
</div>
</div>
<div class="col-12">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="BatchID" DataSourceID="ods" CssClass="table table-sm table-striped table-responsive" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="BatchID" DataSourceID="ods" CssClass="table table-sm table-striped table-responsive" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnRowCommand="grView_RowCommand">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
@@ -20,7 +28,7 @@
<asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true" ToolTip="Reset"><i class="fa fa-refresh"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-primary"><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
<asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-primary" CommandArgument='<%# Eval("Takt") %>'><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="BatchID" HeaderText="BatchID" InsertVisible="False" ReadOnly="True" SortExpression="BatchID" />--%>
@@ -37,17 +45,17 @@
</ItemTemplate>
<ItemStyle CssClass="text-right" />
</asp:TemplateField>
<asp:BoundField DataField="NumStacks" HeaderText="# Stacks" SortExpression="NumStacks" ItemStyle-CssClass="text-right" >
<ItemStyle CssClass="text-right"></ItemStyle>
<asp:BoundField DataField="NumStacks" HeaderText="# Stacks" SortExpression="NumStacks" ItemStyle-CssClass="text-right">
<ItemStyle CssClass="text-right"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="NumSheets" HeaderText="# Sheets" SortExpression="NumSheets" ItemStyle-CssClass="text-right" >
<ItemStyle CssClass="text-right"></ItemStyle>
<asp:BoundField DataField="NumSheets" HeaderText="# Sheets" SortExpression="NumSheets" ItemStyle-CssClass="text-right">
<ItemStyle CssClass="text-right"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="NumOrders" HeaderText="# Orders" SortExpression="NumOrders" ItemStyle-CssClass="text-right" >
<ItemStyle CssClass="text-right"></ItemStyle>
<asp:BoundField DataField="NumOrders" HeaderText="# Orders" SortExpression="NumOrders" ItemStyle-CssClass="text-right">
<ItemStyle CssClass="text-right"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="NumItems" HeaderText="# Items" SortExpression="NumItems" ItemStyle-CssClass="text-right" >
<ItemStyle CssClass="text-right"></ItemStyle>
<asp:BoundField DataField="NumItems" HeaderText="# Items" SortExpression="NumItems" ItemStyle-CssClass="text-right">
<ItemStyle CssClass="text-right"></ItemStyle>
</asp:BoundField>
</Columns>
</asp:GridView>
+34 -1
View File
@@ -12,8 +12,26 @@ namespace NKC_WF.WebUserControls
{
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
checkVisibility();
}
}
private void checkVisibility()
{
divSelected.Visible = BatchIdSel > 0;
grView.Visible = !divSelected.Visible;
// imposto css titolo...
string titleClass = "row font-weight-bold";
if(divSelected.Visible)
{
titleClass += " table-primary";
}
divTitle.Attributes.Remove("class");
divTitle.Attributes.Add("class", titleClass);
}
/// <summary>
/// Codice CSS in base a status...
/// </summary>
@@ -81,8 +99,10 @@ namespace NKC_WF.WebUserControls
private void resetSelezione()
{
lblTakt.Text = "";
grView.SelectedIndex = -1;
grView.DataBind();
checkVisibility();
raiseEvent();
}
/// <summary>
@@ -104,7 +124,20 @@ namespace NKC_WF.WebUserControls
}
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
checkVisibility();
raiseEvent();
}
protected void grView_RowCommand(object sender, GridViewCommandEventArgs e)
{
// recupero argomento = Takt...
try
{
string takt = e.CommandArgument.ToString();
lblTakt.Text = takt;
}
catch
{ }
}
}
}
+36
View File
@@ -12,6 +12,42 @@ namespace NKC_WF.WebUserControls {
public partial class cmp_taktList {
/// <summary>
/// Controllo divTitle.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTitle;
/// <summary>
/// Controllo divSelected.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSelected;
/// <summary>
/// Controllo lblTakt.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblTakt;
/// <summary>
/// Controllo lbtResetGlob.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtResetGlob;
/// <summary>
/// Controllo grView.
/// </summary>