Fix grafici pagina import (coloring, dati msotrati)

This commit is contained in:
Samuele E. Locatelli
2019-08-22 12:42:05 +02:00
parent 6df8ebf3ec
commit 4fa44bcd1e
8 changed files with 137 additions and 5 deletions
@@ -76,6 +76,7 @@ namespace NKC_WF.WebUserControls
{
// registro accettazione Nesting
DataLayer.man.taBL.acceptBatch(BatchId, DataLayer.man.CodSoggCurrUser);
raiseEvent();
}
protected void lbtStopNesting_Click(object sender, EventArgs e)
+9 -5
View File
@@ -1,5 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_batchList.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_batchList" %>
<%@ Register Src="~/WebUserControls/cmp_batchDetail.ascx" TagPrefix="uc1" TagName="cmp_batchDetail" %>
<%@ Register Src="~/WebUserControls/cmp_numRow.ascx" TagPrefix="uc1" TagName="cmp_numRow" %>
<div class="row">
@@ -22,6 +24,8 @@
<asp:ListItem Text="Nesting Approved" Value="3"></asp:ListItem>
<asp:ListItem Text="Nesting Discarded" Value="4"></asp:ListItem>
</asp:DropDownList>
&nbsp;|&nbsp;
<uc1:cmp_numRow runat="server" id="cmp_numRow" numRow="10" />
</div>
</div>
</div>
@@ -40,15 +44,15 @@
<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"><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"><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" />
<asp:BoundField DataField="Takt" HeaderText="Takt" InsertVisible="False" ReadOnly="True" SortExpression="Takt" />
<asp:BoundField DataField="DueDate" HeaderText="DueDate" SortExpression="DueDate" DataFormatString="{0:yyyy-MM-dd}" />
<%--<asp:BoundField DataField="BatchID" HeaderText="BatchID" InsertVisible="False" ReadOnly="True" SortExpression="BatchID" />--%>
<asp:BoundField DataField="Takt" HeaderText="Date" InsertVisible="False" ReadOnly="True" SortExpression="Takt" />
<%--<asp:BoundField DataField="DueDate" HeaderText="DueDate" SortExpression="DueDate" DataFormatString="{0:yyyy-MM-dd}" />--%>
<asp:TemplateField HeaderText="Status" SortExpression="Status">
<ItemTemplate>
<asp:Label ID="lblStatus" runat="server"><%# BStatus(Eval("Status")) %></asp:Label>
<asp:Label ID="lblStatus" runat="server" CssClass='<%# cssByStatus(Eval("Status")) %>'><%# BStatus(Eval("Status")) %></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="TotalTime" HeaderText="TotalTime" SortExpression="TotalTime" DataFormatString="{0:N2} min" />
@@ -18,6 +18,14 @@ namespace NKC_WF.WebUserControls
divDetail.Visible = false;
}
cmp_batchDetail.eh_doRefresh += Cmp_batchDetail_eh_doRefresh;
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
}
private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e)
{
// recupero num righe ed aggiorno...
grView.PageSize = cmp_numRow.numRow;
grView.DataBind();
}
private void Cmp_batchDetail_eh_doRefresh(object sender, EventArgs e)
@@ -25,6 +33,35 @@ namespace NKC_WF.WebUserControls
resetSelezione();
}
/// <summary>
/// Codice CSS in base a status...
/// </summary>
/// <param name="_status"></param>
/// <returns></returns>
public string cssByStatus(object _status)
{
string answ = "";
int status = -1;
int.TryParse(_status.ToString(), out status);
switch (status)
{
case 1:
answ = "font-weight-bold text-warning";
break;
case 2:
answ = "font-weight-bold text-info";
break;
case 3:
answ = "font-weight-bold text-success";
break;
case 4:
answ = "font-weight-bold text-secondary";
break;
default:
break;
}
return answ;
}
/// <summary>
/// Converte il codice stato in effettivo campo
/// </summary>
+9
View File
@@ -39,6 +39,15 @@ namespace NKC_WF.WebUserControls {
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlStatus;
/// <summary>
/// Controllo cmp_numRow.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::NKC_WF.WebUserControls.cmp_numRow cmp_numRow;
/// <summary>
/// Controllo grView.
/// </summary>
+4
View File
@@ -0,0 +1,4 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_numRow.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_numRow" %>
size:
<asp:TextBox runat="server" ID="txtNumRow" Text="10" Width="2em" AutoPostBack="True" OnTextChanged="txtNumRow_TextChanged"></asp:TextBox>
+45
View File
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace NKC_WF.WebUserControls
{
public partial class cmp_numRow : System.Web.UI.UserControl
{
public event EventHandler eh_doRefresh;
protected void Page_Load(object sender, EventArgs e)
{
}
private void raiseEvent()
{
// se qualcuno ascolta sollevo evento nuovo valore...
if (eh_doRefresh != null)
{
eh_doRefresh(this, new EventArgs());
}
}
public int numRow
{
set
{
txtNumRow.Text = value.ToString();
}
get
{
int answ = 10;
int.TryParse(txtNumRow.Text, out answ);
return answ;
}
}
protected void txtNumRow_TextChanged(object sender, EventArgs e)
{
raiseEvent();
}
}
}
+24
View File
@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <generato automaticamente>
// Codice generato da uno strumento.
//
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
// il codice viene rigenerato.
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace NKC_WF.WebUserControls {
public partial class cmp_numRow {
/// <summary>
/// Controllo txtNumRow.
/// </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.TextBox txtNumRow;
}
}