Bozza print x BINS
This commit is contained in:
@@ -1,48 +1,61 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_MU_bins.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_MU_bins" %>
|
||||
|
||||
<div class="card text-center mb-2" style="width: 100%;">
|
||||
<h5 class="card-header bg-primary text-light">BINS</h5>
|
||||
<div class="card-body py-1">
|
||||
<div class="row">
|
||||
<div class="col-12 px-0">
|
||||
<asp:GridView runat="server" ID="grView" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="BinID" DataSourceID="ods" CssClass="table table-striped table-sm table-borderless" BorderWidth="0">
|
||||
<HeaderStyle CssClass="default" />
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="table-info" />
|
||||
<EmptyDataTemplate>
|
||||
No Record
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Cod" SortExpression="BinDtmx">
|
||||
<ItemTemplate>
|
||||
<asp:Image runat="server" Height='<%# qrSize %>' Visible='<%# hfShowQr.Value.ToLower()=="true" %>' ImageUrl='<%# getImgUrl(Eval("BinDtmx")) %>' />
|
||||
<b><asp:Label ID="lblBinIndex" runat="server" Text='<%# Eval("BinIndex","B{0}") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>' /></b>
|
||||
<asp:Label ID="lblBinDtmx" runat="server" Visible='<%# hfShowQr.Value.ToLower()=="true" %>' Text='<%# Eval("BinDtmx") %>' CssClass="small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="D/T" SortExpression="TotItem">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("TotItemLoad") +"/" + Eval("TotItem") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>'/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="%" SortExpression="TotItemLoad">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# getRatio(Eval("TotItemLoad"),Eval("TotItem")).ToString("P1") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>'/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getByBatch" TypeName="AppData.DS_AppTableAdapters.BinsTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfBatchID" DefaultValue="0" Name="BatchID" PropertyName="Value" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField ID="hfBatchID" runat="server" />
|
||||
<asp:HiddenField ID="hfShowQr" runat="server" Value="false" />
|
||||
<asp:HiddenField ID="hfQrSize" runat="server" Value="32" />
|
||||
<asp:HiddenField ID="hfShowPrint" runat="server" Value="false" />
|
||||
</div>
|
||||
<h5 class="card-header bg-primary text-light">BINS</h5>
|
||||
<div class="card-body py-1">
|
||||
<div class="row">
|
||||
<div class="col-12 px-0">
|
||||
<asp:GridView runat="server" ID="grView" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="BinID" DataSourceID="ods" CssClass="table table-striped table-sm table-borderless" BorderWidth="0" OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<HeaderStyle CssClass="default" />
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="table-info" />
|
||||
<EmptyDataTemplate>
|
||||
No Record
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Cod" SortExpression="BinDtmx">
|
||||
<ItemTemplate>
|
||||
<asp:Image runat="server" Height='<%# qrSize %>' Visible='<%# hfShowQr.Value.ToLower()=="true" %>' ImageUrl='<%# getImgUrl(Eval("BinDtmx")) %>' />
|
||||
<b>
|
||||
<asp:Label ID="lblBinIndex" runat="server" Text='<%# Eval("BinIndex","B{0}") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>' /></b>
|
||||
<asp:Label ID="lblBinDtmx" runat="server" Visible='<%# hfShowQr.Value.ToLower()=="true" %>' Text='<%# Eval("BinDtmx") %>' CssClass="small" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="D/T" SortExpression="TotItem">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("TotItemLoad") +"/" + Eval("TotItem") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="%" SortExpression="TotItemLoad">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# getRatio(Eval("TotItemLoad"),Eval("TotItem")).ToString("P1") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<HeaderTemplate>
|
||||
<div class="text-center">
|
||||
<asp:LinkButton ID="lbtPrintAll" runat="server" OnClick="lbtPrintAll_Click" CssClass="btn btn-sm btn-primary" ToolTip='<%# traduci("PrintAll") %>' Visible='<%# hfShowPrint.Value.ToLower()=="true" %>'><i class="fa fa-print"></i> <i class="fa fa-plus"></i></asp:LinkButton>
|
||||
</div>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<div class="text-center">
|
||||
<asp:LinkButton ID="lbtSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-info" Visible='<%# hfShowPrint.Value.ToLower()=="true" %>'><i class="fa fa-print" aria-hidden="true"></i></asp:LinkButton>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getByBatch" TypeName="AppData.DS_AppTableAdapters.BinsTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfBatchID" DefaultValue="0" Name="BatchID" PropertyName="Value" Type="Int32" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField ID="hfBatchID" runat="server" />
|
||||
<asp:HiddenField ID="hfShowQr" runat="server" Value="false" />
|
||||
<asp:HiddenField ID="hfQrSize" runat="server" Value="32" />
|
||||
<asp:HiddenField ID="hfShowPrint" runat="server" Value="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using AppData;
|
||||
using NKC_SDK;
|
||||
using System;
|
||||
|
||||
namespace NKC_WF.WebUserControls
|
||||
{
|
||||
public partial class cmp_MU_bins : System.Web.UI.UserControl
|
||||
public partial class cmp_MU_bins : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Batch corrente...
|
||||
@@ -54,6 +56,29 @@ namespace NKC_WF.WebUserControls
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// BinId selezionato
|
||||
/// </summary>
|
||||
public int selBinId
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
int.TryParse(grView.SelectedValue.ToString(), out answ);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Stampante associata
|
||||
/// </summary>
|
||||
protected string printer
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = DataLayer.man.getPrinter("PC-MACHINE-UNLOAD2");
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce URL immagine QRCode
|
||||
/// </summary>
|
||||
/// <param name="currId"></param>
|
||||
@@ -128,5 +153,49 @@ namespace NKC_WF.WebUserControls
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Alla selezione mando in stampa il singolo record
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// invio SINGOLO record in stampa
|
||||
DataLayer.man.stampaDoc(selBinId.ToString(), printer, tipoDocumento.docBinPre, Request.UserHostName);
|
||||
// reset
|
||||
doReset();
|
||||
}
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtPrintAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo stored x stampare OGNI cart del BATCH
|
||||
var tabBins = DataLayer.man.taBN.getByBatch(BatchId);
|
||||
try
|
||||
{
|
||||
if (tabBins != null && tabBins.Count > 0)
|
||||
{
|
||||
foreach (var item in tabBins)
|
||||
{
|
||||
// invio SINGOLO record in stampa
|
||||
DataLayer.man.stampaDoc(item.BinID.ToString(), printer, tipoDocumento.docBinPre, Request.UserHostName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// reset
|
||||
doReset();
|
||||
}
|
||||
|
||||
private void doReset()
|
||||
{
|
||||
// resetto
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,9 @@ namespace NKC_WF.WebUserControls
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Stampante associata
|
||||
/// </summary>
|
||||
protected string printer
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user