inizio gest pedane
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="gestPedane.aspx.cs" Inherits="MP_MAG.SMART.gestPedane" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/cmp_elencoPedane.ascx" TagPrefix="uc1" TagName="cmp_elencoPedane" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
|
||||
|
||||
|
||||
<div class="row m-0">
|
||||
<div class="col-6">
|
||||
<uc1:cmp_elencopedane runat="server" id="cmp_elencoPedane" />
|
||||
</div>
|
||||
<div class="col-6">
|
||||
elenco UDC x pedana
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
Generated
+9
@@ -13,5 +13,14 @@ namespace MP_MAG.SMART
|
||||
|
||||
public partial class gestPedane
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo cmp_elencoPedane.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::MP_MAG.WebUserControls.cmp_elencoPedane cmp_elencoPedane;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_dettPedane.ascx.cs" Inherits="MP_MAG.WebUserControls.cmp_dettPedane" %>
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace MP_MAG.WebUserControls
|
||||
{
|
||||
public partial class cmp_dettPedane : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MP_MAG.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class cmp_dettPedane
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,16 +7,8 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace MP_MAG.WebUserControls
|
||||
{
|
||||
public partial class cmp_elencoLotti : System.Web.UI.UserControl
|
||||
public partial class cmp_elencoLotti : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Generico evento di richiesta refresh a aprent
|
||||
/// </summary>
|
||||
public event EventHandler eh_doRefresh;
|
||||
/// <summary>
|
||||
/// Generico evento di richiesta refresh a aprent
|
||||
/// </summary>
|
||||
public event EventHandler eh_doReset;
|
||||
/// <summary>
|
||||
/// Lotto selezionato
|
||||
/// </summary>
|
||||
@@ -59,25 +51,11 @@ namespace MP_MAG.WebUserControls
|
||||
grView.DataBind();
|
||||
raiseReset();
|
||||
}
|
||||
/// <summary>
|
||||
/// Chiamata evento
|
||||
/// </summary>
|
||||
public void raiseReset()
|
||||
{
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (eh_doReset != null)
|
||||
{
|
||||
eh_doReset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (eh_doRefresh != null)
|
||||
{
|
||||
eh_doRefresh(this, new EventArgs());
|
||||
}
|
||||
raiseEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_elencoPedane.ascx.cs" Inherits="MP_MAG.WebUserControls.cmp_elencoPedane" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_numRow.ascx" TagPrefix="uc1" TagName="cmp_numRow" %>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>Elenco Pedane</h4>
|
||||
</div>
|
||||
<div class="card-body py-0">
|
||||
<div class="row table-dark py-1">
|
||||
<div class="col-4">
|
||||
<asp:LinkButton runat="server" ID="lbtShowAdd" CssClass="btn btn-block btn-warning" OnClick="lbtShowAdd_Click" Text="Aggiungi" />
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<asp:CheckBox runat="server" ID="chkFiltData" Text="Filtra Data" AutoPostBack="true" OnCheckedChanged="chkFiltData_CheckedChanged" />
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<asp:TextBox runat="server" ID="txtData" TextMode="Date" CssClass="form-control" OnTextChanged="txtData_TextChanged" AutoPostBack="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="divAddNew" class="row table-secondary py-1">
|
||||
<div class="col-4">
|
||||
Descrizione
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<asp:TextBox runat="server" ID="txtDescr" CssClass="form-control" />
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<asp:LinkButton runat="server" ID="lbkAddNew" CssClass="btn btn-block btn-success" OnClientClick="return confirm('Creazione nuova pedana: sicuro di voler procedere?');" OnClick="lbkAddNew_Click"><i class="fas fa-plus"></i> ADD</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<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">
|
||||
<HeaderStyle CssClass="default" />
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="table-info" />
|
||||
<EmptyDataTemplate>
|
||||
Nessun Risultato trovato
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:BoundField DataField="AL" HeaderText="AL" ReadOnly="True" SortExpression="AL" />
|
||||
<asp:BoundField DataField="Descr" HeaderText="Descr" SortExpression="Descr" />
|
||||
<asp:BoundField DataField="DtRec" HeaderText="DtRec" SortExpression="DtRec" />
|
||||
<asp:BoundField DataField="CodSoggetto" HeaderText="CodSoggetto" SortExpression="CodSoggetto" />
|
||||
<asp:BoundField DataField="QtaTot" HeaderText="QtaTot" SortExpression="QtaTot" />
|
||||
<asp:BoundField DataField="NumUdc" HeaderText="NumUdc" SortExpression="NumUdc" />
|
||||
<asp:BoundField DataField="PesoTot" HeaderText="PesoTot" SortExpression="PesoTot" />
|
||||
<asp:BoundField DataField="Tara" HeaderText="Tara" SortExpression="Tara" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getBySearch" TypeName="MagData.DS_MagTableAdapters.ElencoALTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="chkFiltData" DefaultValue="0" Name="FiltDate" PropertyName="Checked" Type="Boolean" />
|
||||
<asp:ControlParameter ControlID="txtData" DefaultValue="""" Name="DayRef" PropertyName="Text" Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="*" Name="SearchVal" SessionField="valoreSearch" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
|
||||
<%--<asp:TemplateField ShowHeader="False">
|
||||
<HeaderTemplate>
|
||||
<asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true" ToolTip="Reset"><i class="fas fa-sync"></i></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtSel" runat="server" CausesValidation="False" CommandName="Select" Text="Seleziona" CssClass="btn btn-sm btn-info"><i class="fas fa-search"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Lotto" HeaderText="Lotto" ReadOnly="True" SortExpression="Lotto" />
|
||||
<asp:TemplateField HeaderText="Tipo" SortExpression="TipoLotto">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Eval("TipoLotto") %>' ToolTip='<%# Eval("Origine") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Articolo" SortExpression="CodArt">
|
||||
<ItemTemplate>
|
||||
<div class="row">
|
||||
<div class="col-6 font-weight-bold">
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("CodArt") %>' />
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Eval("CodArtExt") %>' />
|
||||
</div>
|
||||
<div class="col-12 small">
|
||||
<i>
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Eval("DescrArt") %>' /></i>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cod" SortExpression="CodStato">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("CodStato") %>' ToolTip='<%# Eval("DescStato") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Data" SortExpression="DtCrea">
|
||||
<ItemTemplate>
|
||||
<div>
|
||||
<asp:Label ID="Label7" runat="server" Text='<%# Eval("DtCrea", "{0:yyyy.MM.dd}") %>' />
|
||||
</div>
|
||||
<div class="small">
|
||||
<i>
|
||||
<asp:Label ID="Label8" runat="server" Text='<%# Eval("Note") %>' /></i>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Qta" SortExpression="QtaOrig">
|
||||
<ItemTemplate>
|
||||
<b>
|
||||
<asp:Label ID="Label9" runat="server" Text='<%# Eval("QtaCurr", "{0:N0}") %>' /></b>
|
||||
/
|
||||
<asp:Label ID="Label6" runat="server" Text='<%# Eval("QtaOrig", "{0:N0}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NumUdc" HeaderText="#" SortExpression="NumUdc" />
|
||||
<asp:TemplateField HeaderText="Attivo" SortExpression="Attivo">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("Attivo") %>' Enabled="false" ToolTip='<%# Eval("DtMod", "mod: {0:yyyy.MM.dd HH:mm:ss}") %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<div class="row small">
|
||||
<div class="col text-right">
|
||||
<uc1:cmp_numRow runat="server" ID="cmp_numRow" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,120 @@
|
||||
using MagData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace MP_MAG.WebUserControls
|
||||
{
|
||||
public partial class cmp_elencoPedane : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// AL selezionato
|
||||
/// </summary>
|
||||
public string AlSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return grView.SelectedValue.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
cmp_numRow.numRow = 10;
|
||||
grView.PageSize = cmp_numRow.numRow;
|
||||
txtData.Text = $"{DateTime.Today:yyyy-MM-dd}";
|
||||
txtData.Visible = false;
|
||||
divAddNew.Visible = false;
|
||||
}
|
||||
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
|
||||
}
|
||||
|
||||
private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e)
|
||||
{
|
||||
grView.PageSize = cmp_numRow.numRow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
private void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
raiseReset();
|
||||
}
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
raiseEvent();
|
||||
}
|
||||
/// <summary>
|
||||
/// Creazione nuova pedana
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbkAddNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo insert
|
||||
MagDataLayer.man.taEAL.insertQuery(DateTime.Today, "PED", currProdData.CodOpr, txtDescr.Text.Trim());
|
||||
// nascondo add...
|
||||
toggleAddNew();
|
||||
// update!!!
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// In caso di checkbox positivo --> imposta data ad oggi
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void chkFiltData_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
txtData.Visible = chkFiltData.Checked;
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// Mostra btn add new
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtShowAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
toggleAddNew();
|
||||
}
|
||||
|
||||
private void toggleAddNew()
|
||||
{
|
||||
divAddNew.Visible = !divAddNew.Visible;
|
||||
lbtShowAdd.Text = divAddNew.Visible ? "Nascondi" : "Aggiungi";
|
||||
int newNum = 0;
|
||||
// calcolo quante pedane ho...
|
||||
try
|
||||
{
|
||||
var tabAL = MagDataLayer.man.taEAL.getBySearch(true, DateTime.Today, "*");
|
||||
newNum = tabAL.Count + 1;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// descrizione
|
||||
txtDescr.Text = $"PEDANA {newNum}";
|
||||
}
|
||||
|
||||
protected void txtData_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 MP_MAG.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class cmp_elencoPedane
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtShowAdd.
|
||||
/// </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 lbtShowAdd;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo chkFiltData.
|
||||
/// </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.CheckBox chkFiltData;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo txtData.
|
||||
/// </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 txtData;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divAddNew.
|
||||
/// </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 divAddNew;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo txtDescr.
|
||||
/// </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 txtDescr;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbkAddNew.
|
||||
/// </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 lbkAddNew;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo grView.
|
||||
/// </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.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods.
|
||||
/// </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.ObjectDataSource ods;
|
||||
|
||||
/// <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::MP_MAG.WebUserControls.cmp_numRow cmp_numRow;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user