Aggiunta preliminare pagine ADMIN --> ADM

This commit is contained in:
Samuele E. Locatelli
2018-10-27 11:58:26 +02:00
parent 392b156823
commit 03e0bca907
312 changed files with 26816 additions and 68 deletions
@@ -0,0 +1,140 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_anagArticoli.ascx.cs"
Inherits="MoonProAdmin.WebUserControls.mod_anagArticoli" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound" PageSize="25"
DataKeyNames="CodArticolo" DataSourceID="ods" Width="100%">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<%--<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="true" />--%>
</HeaderTemplate>
<ItemTemplate>
<%--<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
ToolTip='<%# traduci("Select") %>' ImageUrl="~/images/view_m.png" />
&nbsp;--%>
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
Visible='<%# isWritable() %>' ToolTip='<%# traduci("Edit") %>' ImageUrl="~/images/edit_m.png" />
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl="~/images/apply_m.png" />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl="~/images/cancel_m.png" />
</EditItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodArticolo" SortExpression="CodArticolo">
<ItemTemplate>
<asp:Label runat="server" ID="txtCodArticolo" Text='<%# Eval("CodArticolo") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtCodArticolo" Text='<%# Bind("CodArticolo") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Disegno" SortExpression="Disegno">
<ItemTemplate>
<asp:Label runat="server" ID="txtDisegno" Text='<%# Eval("Disegno") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtDisegno" Text='<%# Bind("Disegno") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo" SortExpression="Tipo">
<ItemTemplate>
<asp:Label runat="server" ID="txtTipo" Text='<%# Eval("Tipo") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtTipo" Text='<%# Bind("Tipo") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DescArticolo" SortExpression="DescArticolo">
<ItemTemplate>
<asp:Label runat="server" ID="txtDescArticolo" Text='<%# Eval("DescArticolo") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtDescArticolo" Text='<%# Bind("DescArticolo") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CurrRev" SortExpression="CurrRev">
<ItemTemplate>
<asp:Label runat="server" ID="txtCurrRev" Text='<%# Eval("CurrRev") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtCurrRev" Text='<%# Bind("CurrRev") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ProdRev" SortExpression="ProdRev">
<ItemTemplate>
<asp:Label runat="server" ID="txtProdRev" Text='<%# Eval("ProdRev") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:Label runat="server" ID="txtProdRev" Text='<%# Eval("ProdRev") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="FlagIsNew" SortExpression="FlagIsNew">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkFlagIsNew" Checked='<%# Eval("FlagIsNew") %>' Enabled="false" />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox runat="server" ID="chkFlagIsNew" Checked='<%# Eval("FlagIsNew") %>' Enabled="false" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
CommandArgument='<%# Eval("CodArticolo") %>' ToolTip='<%# traduci("Delete") %>'
Visible='<%# delEnabled(Eval("CodArticolo")) %>' ImageUrl="~/images/elimina_m.png" />
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete"></asp:ConfirmButtonExtender>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl="~/images/apply_m.png" />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl="~/images/cancel_m.png" />
</EditItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" Text="Nuovo" ToolTip="Aggiunti articolo" OnClick="btnNew_Click"
Visible="true" />
</HeaderTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_ProdTempiTableAdapters.AnagArticoliTableAdapter" OnInserting="recuperaFooter" FilterExpression="CodArticolo LIKE '%{0}%' OR DescArticolo LIKE '%{0}%' " OnInserted="ods_Updated" OnUpdated="ods_Updated" OnDeleted="ods_Updated" UpdateMethod="updateQry" DeleteMethod="deleteQry" InsertMethod="Insert" OnUpdating="ods_Updating">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_CodArticolo" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Original_CodArticolo" Type="String" />
<asp:Parameter Name="DescArticolo" Type="String" />
<asp:Parameter Name="CurrRev" Type="String" />
<asp:Parameter Name="Disegno" Type="String" />
<asp:Parameter Name="Tipo" Type="String" />
<asp:Parameter Name="CodArticolo" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="CodArticolo" Type="String" />
<asp:Parameter Name="DescArticolo" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
@@ -0,0 +1,270 @@
using MapoDb;
using SteamWare;
using System;
using System.Data;
using System.Web.UI.WebControls;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_anagArticoli : System.Web.UI.UserControl
{
#region area da NON modificare
#region area protected
protected string _idxGridView;
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
/// <summary>
/// traduce gli header delle colonne
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_DataBound(object sender, EventArgs e)
{
if (grView.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grView.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
}
else
{
lblNumRec.Text = "";
}
}
/// <summary>
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
{
//recupero la riga footer...
DataColumnCollection colonne = colonneObj();
string nomeCol;
string tipoColonna = "";
foreach (DataColumn colonna in colonne)
{
nomeCol = colonna.ColumnName;
// cerco un textbox o quello che sia...
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
{
tipoColonna = "textBox";
}
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
{
tipoColonna = "dropDownList";
}
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
{
tipoColonna = "checkBox";
}
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
{
tipoColonna = "selAjax";
}
// in base al tipo salvo negli inputparameters dell'ODS
switch (tipoColonna)
{
case "textBox":
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
break;
case "dropDownList":
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
break;
case "checkBox":
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
break;
//case "selAjax":
// e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
// break;
default:
break;
}
tipoColonna = "";
}
}
/// <summary>
/// svuoto da cache post update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// evento come nuovo...
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
#endregion
#region are public
/// <summary>
/// effettua traduzione del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// effettua traduzione in inglese del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduciEn(string lemma)
{
return user_std.UtSn.TraduciEn(lemma);
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
public event EventHandler eh_selValore;
#endregion
#region area da modificare
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "IdxMacchina";
}
/// <summary>
/// nuovo valore creato...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e)
{
// aggiorno!
resetSelezione();
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
MapoDb.DS_ProdTempi.DatiMacchineDataTable tabella = new MapoDb.DS_ProdTempi.DatiMacchineDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
public bool delEnabled(object _idx)
{
bool answ = false;
string codArticolo = _idx.ToString();
// controllo non sia stato mai prodotto sennò non posso cancellare...
try
{
bool? usato = false;
MapoDb.DataLayer.obj.taAnagArt.checkUsed(codArticolo, ref usato);
answ = !(bool)usato;
}
catch
{ }
return answ;
}
/// <summary>
/// definisce scrivibilità/editabilità del controllo
/// </summary>
/// <returns></returns>
public bool isWritable()
{
return true;
}
/// <summary>
/// crea un nuovo record e ricarica...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
string tempCode = string.Format("_{0:yyyyMMdd-HHmmss}", DateTime.Now);
string tempName = string.Format("Nuovo articolo creato {0:dd/MM/yyyy HH:mm:ss}", DateTime.Now);
DataLayer.obj.taAnagArt.Insert(tempCode, tempName, "", "", "", "ART");
// reset!
resetSelezione();
}
#endregion
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
// verifico eventuali nulli --> ""
if (e.InputParameters["DescArticolo"] == null) e.InputParameters["DescArticolo"] = "";
if (e.InputParameters["CurrRev"] == null) e.InputParameters["CurrRev"] = "";
if (e.InputParameters["Disegno"] == null) e.InputParameters["Disegno"] = "";
}
}
}
+51
View File
@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_anagArticoli {
/// <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 lblNumRec.
/// </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 lblNumRec;
/// <summary>
/// Controllo lblWarning.
/// </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 lblWarning;
/// <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;
}
}
@@ -0,0 +1,54 @@
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="mod_aperturaImpianti" CodeBehind="mod_aperturaImpianti.ascx.cs" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="giorno" DataSourceID="ods" OnDataBound="grView_DataBound">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="descrGiorno" HeaderText="descrGiorno" Visible="true" ReadOnly="True"
SortExpression="descrGiorno" />
<asp:TemplateField HeaderText="apertura" SortExpression="apertura">
<EditItemTemplate>
<asp:TextBox ID="txtApertura" runat="server" Width="3em" Text='<%# Bind("apertura") %>' />
<cc1:MaskedEditExtender ID="mee_Ora" runat="server" TargetControlID="txtApertura" Mask="99.99"
MaskType="Number"></cc1:MaskedEditExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("apertura") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="GIM_data.DS_applicazioneTableAdapters.OreAperturaSettTableAdapter"
UpdateMethod="updateApertura" OldValuesParameterFormatString="Original_{0}">
<UpdateParameters>
<asp:Parameter Name="apertura" Type="Decimal" />
<asp:Parameter Name="Original_giorno" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
@@ -0,0 +1,30 @@
using SteamWare;
using System;
using System.Web.UI.WebControls;
public partial class mod_aperturaImpianti : ApplicationUserControl
{
/// <summary>
/// evento dati associati a controllo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_DataBound(object sender, EventArgs e)
{
if (grView.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grView.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
}
}
}
@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class mod_aperturaImpianti {
/// <summary>
/// grView 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.GridView grView;
/// <summary>
/// ods 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.ObjectDataSource ods;
}
@@ -0,0 +1,63 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_approvProd.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_approvProd" %>
<div style="text-align: center; margin: auto; vertical-align: middle; min-width: 800px; width: 100%; background: #DCDCDC;">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataSourceID="odsProd" ForeColor="Black" GridLines="None" Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" DataKeyNames="IdxODL,DataRif">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
<EmptyDataRowStyle BackColor="Tan" Font-Bold="True" />
<EmptyDataTemplate>
Nessun record storico trovato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="btnSelAll" runat="server" Checked="false" ToolTip='<%# traduci("btnSelAll") %>'
OnCheckedChanged="btnSelAll_Click" CssClass="ctrHeaderPager" AutoPostBack="true"></asp:CheckBox>
</HeaderTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="ODL" SortExpression="IdxODL">
<ItemTemplate>
<asp:Label ID="lblIdxODL" runat="server" Text='<%# Eval("IdxODL") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Data" SortExpression="DataRif">
<ItemTemplate>
<asp:Label ID="lblDataRif" runat="server" Text='<%# Eval("DataRif","{0:dd/MM/yyyy}") %>' />
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:BoundField DataField="IdxODL" HeaderText="IdxODL" SortExpression="IdxODL" />
<asp:BoundField DataField="DataRif" HeaderText="DataRif" SortExpression="DataRif" />--%>
<asp:BoundField DataField="CommessaAs400" HeaderText="CommessaAs400" SortExpression="CommessaAs400" />
<asp:BoundField DataField="CodArticolo" HeaderText="CodArticolo" SortExpression="CodArticolo" />
<asp:BoundField DataField="TotPzProd" HeaderText="TotPzProd" SortExpression="TotPzProd" />
<asp:TemplateField ShowHeader="False">
<HeaderTemplate>
<%--<asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click"><i class="fa fa-refresh fa-2x"></i></asp:LinkButton>--%>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkAppr" runat="server" CausesValidation="False" CommandArgument="Approva" CommandName="Select" ToolTip="Approva" ForeColor="Green" OnCommand="lbt_Command"><i class="fa fa-thumbs-o-up fa-2x"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsProd" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_ProdTempiTableAdapters.ProduzioneAs400TableAdapter"></asp:ObjectDataSource>
<div style="text-align: center; margin: auto; vertical-align: middle; padding: 4px 2px; height: 1.5em;">
<asp:Button runat="server" ID="btnApprova" Text="..." Width="150px" OnClick="btnApprovaProd_Click" />
<div style="float: right;">
mostra:
<asp:TextBox runat="server" ID="txtPageSize" Text="10" Width="2em" OnTextChanged="txtPageSize_TextChanged" />
</div>
</div>
</div>
@@ -0,0 +1,150 @@
using SteamWare;
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_approvProd : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
btnApprova.Text = traduci("btnApprovaProd");
grView.PageSize = pageSize;
}
}
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// seleziona/deseleziona le righe indicate...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSelAll_Click(object sender, EventArgs e)
{
// seleziono tutti i valori visibili nel datagrid
CheckBox chkbox = ((CheckBox)sender);
bool isChecked = chkbox.Checked;
if (!isChecked)
{
chkbox.ToolTip = traduci("btnSelAll");
}
else
{
chkbox.ToolTip = traduci("btnDeselAll");
}
foreach (GridViewRow riga in grView.Rows)
{
((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked;
}
}
/// <summary>
/// conferma dati produzione verso As400
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnApprovaProd_Click(object sender, EventArgs e)
{
foreach (GridViewRow riga in grView.Rows)
{
int IdxODL = 0;
DateTime DataRif = DateTime.Now.Date;
if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
{
try
{
IdxODL = Convert.ToInt32(((Label)riga.FindControl("lblIdxODL")).Text);
DataRif = Convert.ToDateTime(((Label)riga.FindControl("lblDataRif")).Text);
}
catch
{ }
MapoDb.DataLayer.obj.taAs400.insProdAs400(IdxODL, DataRif);
}
}
grView.DataBind();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int IdxODL = 0;
DateTime DataRif = DateTime.Now.Date;
try
{
IdxODL = Convert.ToInt32(grView.SelectedDataKey[0]);
DataRif = Convert.ToDateTime(grView.SelectedDataKey[1]);
}
catch
{ }
// gestione buttons approvazione
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Approva":
MapoDb.DataLayer.obj.taAs400.insProdAs400(IdxODL, DataRif);
break;
default:
break;
}
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
}
}
+52
View File
@@ -0,0 +1,52 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MoonProAdmin.WebUserControls
{
public partial class mod_approvProd {
/// <summary>
/// grView 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.GridView grView;
/// <summary>
/// odsProd 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.ObjectDataSource odsProd;
/// <summary>
/// btnApprova 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.Button btnApprova;
/// <summary>
/// txtPageSize 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.TextBox txtPageSize;
}
}
@@ -0,0 +1,82 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_approvazioneODL.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_approvazioneODL" %>
<div style="text-align: center; margin: auto; vertical-align: middle; min-width: 800px; width: 100%; background: #DCDCDC;">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="false" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="IdxODL" DataSourceID="odsTempi" ForeColor="Black" GridLines="None" Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
<EmptyDataRowStyle BackColor="Tan" Font-Bold="True" />
<EmptyDataTemplate>
Nessun record trovato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False">
<HeaderTemplate>
<asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click"><i class="fa fa-refresh fa-2x"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkAppr" runat="server" CausesValidation="False" CommandArgument="Approva" CommandName="Select" ToolTip="Approva" ForeColor="Green" OnCommand="lbt_Command"><i class="fa fa-thumbs-o-up fa-2x"></i></asp:LinkButton>
<asp:LinkButton ID="lnkReject" runat="server" CausesValidation="False" CommandArgument="Rifiuta" CommandName="Select" ToolTip="Rifiuta" ForeColor="Red" OnCommand="lbt_Command"><i class="fa fa-thumbs-o-down fa-2x"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="IdxODL" HeaderText="ODL" InsertVisible="False" ReadOnly="True" SortExpression="IdxODL" />
<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
<asp:TemplateField HeaderText="Articolo" SortExpression="CodArticolo">
<ItemTemplate>
<asp:Label ID="lblCod" runat="server" Text='<%# Bind("CodArticolo") %>'></asp:Label>
<div style="color: #696969; font-size: 0.7em;"">
<asp:Label ID="lblDesc" runat="server" Text='<%# Bind("DescArticolo") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NumPezzi" HeaderText="NumPezzi" SortExpression="NumPezzi" />
<asp:TemplateField HeaderText="TC Attrezzato" SortExpression="TCRichAttr">
<ItemTemplate>
<div style="color: #DD3333; font-size: 1.1em;">
<asp:Label ID="lblTCRichMS" runat="server" Text='<%# minSec(Eval("TCRichAttr", "{0:N3}")) %>' />
<br />
<asp:Label ID="lblTCRichMC" runat="server" Text='<%# Bind("TCRichAttr", "{0:N2} min.cent") %>' Font-Size="0.6em" ForeColor="#696969" />
</div>
<div style="color: #696969; font-size: 0.9em;">
<asp:Label ID="lblNote" runat="server" Text='<%# Bind("Note") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="OperSetup" HeaderText="Oper." SortExpression="OperSetup" />
<asp:TemplateField HeaderText="TC Assegnato" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label ID="lblTCAssMS" runat="server" Text='<%# minSec(Eval("TCAssegnato", "{0:N3}")) %>' />
<br />
<asp:Label ID="lblTCAssMC" runat="server" Text='<%# Bind("TCAssegnato", "{0:N2} min.cent") %>' Font-Size="0.6em" ForeColor="#696969" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataInizio" SortExpression="DataInizio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblInizio" runat="server" Text='<%# Bind("DataInizio","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataFine" SortExpression="DataFine" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="lblFine" runat="server" Text='<%# Bind("DataFine","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsTempi" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getNeedAppr" TypeName="MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter"></asp:ObjectDataSource>
<div style="text-align: center; margin: auto; vertical-align: middle; padding: 4px 2px; height: 1.5em;">
<div style="float: right;">
mostra:
<asp:TextBox runat="server" ID="txtPageSize" Text="10" Width="2em" OnTextChanged="txtPageSize_TextChanged" />
</div>
</div>
</div>
@@ -0,0 +1,143 @@
using SteamWare;
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_approvazioneODL : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
grView.PageSize = pageSize;
}
}
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grView.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
// gestione buttons approvazione
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Approva":
MapoDb.DataLayer.obj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Approvato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, true);
break;
case "Rifiuta":
MapoDb.DataLayer.obj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Rifiutato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, false);
break;
default:
break;
}
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// formatta in minuti/sec partendo da min.cent
/// </summary>
/// <param name="minCent"></param>
/// <returns></returns>
public string minSec(object minCent)
{
string answ = "";
try
{
answ = string.Format("{0:mm}:{0:ss}", minCent2Sec(Convert.ToDecimal(minCent.ToString().Replace(".", ","))));
}
catch
{ }
return answ;
}
/// <summary>
/// conversione da tempo minuti centesimali a minuti/secondi
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
protected TimeSpan minCent2Sec(decimal valore)
{
TimeSpan answ = new TimeSpan(0, 0, 1);
try
{
answ = new TimeSpan(0, Convert.ToInt32(valore), Convert.ToInt32((valore - Convert.ToInt32(valore)) * 60));
}
catch
{ }
return answ;
}
}
}
@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_approvazioneODL {
/// <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 odsTempi.
/// </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 odsTempi;
/// <summary>
/// Controllo txtPageSize.
/// </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 txtPageSize;
}
}
+39
View File
@@ -0,0 +1,39 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_barcode.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_barcode" %>
<script type="text/javascript">
$(document).ready(function () {
$('#<%=txtInput.ClientID %>').focus();
// oggetto da legare all'update parziale ajax x sistemare btns & co
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function () {
// re-bind jQuery events
$('#<%=txtInput.ClientID %>').focus();
});
});
</script>
<div class="form-row">
<div class="form-group col-8 col-md-9 col-lg-10">
<asp:TextBox runat="server" ID="txtInput" CssClass="form-control form-control-lg" OnTextChanged="txtInput_TextChanged" TabIndex="1" AutoPostBack="true" />
</div>
<div class="col-4 col-md-3 col-lg-2">
<asp:LinkButton ID="lbtCerca" runat="server" CssClass="btn text-truncate btn-warning btn-lg btn-block text-uppercase"><i class="fa fa-search"></i> cerca</asp:LinkButton>
</div>
</div>
<div style="text-align: center; font-size: 20pt;">
<div class="ui-grid-solo">
<asp:Panel runat="server" ID="pnlBarcodeBox" CssClass="">
<div style="background-color: #FFE800; padding: 8px; margin: 1px;">
<asp:Label runat="server" ID="lblInput" Text="" />
</div>
<div style="background-color: #FFC500; padding: 8px; margin: 1px;">
<asp:Label runat="server" ID="lblValore" Text="" />
</div>
<div style="background-color: #FF7700; padding: 8px; margin: 1px;">
<asp:Label runat="server" ID="lblRichiesta" Text="" Font-Bold="true" />
</div>
<asp:Label ID="lblBrowser" runat="server" />
</asp:Panel>
</div>
</div>
+680
View File
@@ -0,0 +1,680 @@
using MapoDb;
using Newtonsoft.Json;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Web.UI;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_barcode : System.Web.UI.UserControl
{
#region setup VARS
/// <summary>
/// RegExp x RESET / CANCEL
/// </summary>
protected string regExp_KO = memLayer.ML.cdv("regExp_KO");
/// <summary>
/// RegExp x CONFERMA
/// </summary>
protected string regExp_OK = memLayer.ML.cdv("regExp_OK");
/// <summary>
/// RegExp x START KIT
/// </summary>
protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart");
/// <summary>
/// RegExp x SAVE KIT
/// </summary>
protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave");
/// <summary>
/// RegExp x Find --> replace (se vettore è | delimited)
/// </summary>
protected string regExp_Find = memLayer.ML.cdv("regExp_Find");
/// <summary>
/// RegExp x Replace da Find (se vettore è | delimited)
/// </summary>
protected string regExp_Replace = memLayer.ML.cdv("regExp_Replace");
#endregion
#region variabili in sessione
/// <summary>
/// UID formattato con "_"
/// </summary>
public string uid
{
get
{
return this.UniqueID.Replace("$", "_").Replace("-", "_");
}
}
/// <summary>
/// Valore validazione codici ORDINE come STARTING (es: OPR,KIT)
/// </summary>
public string codOrdPre
{
get
{
return memLayer.ML.StringSessionObj(string.Format("codOrdPre_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("codOrdPre_{0}", uid), value);
}
}
public string codArt
{
get
{
return memLayer.ML.StringSessionObj(string.Format("codArt_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("codArt_{0}", uid), value);
}
}
public string descArt
{
get
{
return memLayer.ML.StringSessionObj(string.Format("descArt_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("descArt_{0}", uid), value);
}
}
public string kitCode
{
get
{
return memLayer.ML.StringSessionObj(string.Format("kitCode_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("kitCode_{0}", uid), value);
}
}
public string codOrd
{
get
{
return memLayer.ML.StringSessionObj(string.Format("codOrd_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("codOrd_{0}", uid), value);
}
}
public int qta
{
get
{
return memLayer.ML.IntSessionObj(string.Format("qta_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("qta_{0}", uid), value);
}
}
public string idxMacc
{
get
{
return memLayer.ML.StringSessionObj(string.Format("idxMacc_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("idxMacc_{0}", uid), value);
}
}
public string nomeMacc
{
get
{
return memLayer.ML.StringSessionObj(string.Format("nomeMacc_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("nomeMacc_{0}", uid), value);
}
}
public string codGruppo
{
get
{
return memLayer.ML.StringSessionObj(string.Format("codGruppo_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("codGruppo_{0}", uid), value);
}
}
/// <summary>
/// Verifica se il cod ordine è OK:
/// coerenza tra ordine e iniziale ordine (OPR/KIT)
/// </summary>
public bool checkOrdOk
{
get
{
return codOrd.StartsWith(codOrdPre);
}
}
/// <summary>
/// titolo pagina
/// </summary>
public string titolo
{
get
{
return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", "");
}
}
#endregion
#region area protected
/// <summary>
/// dictionary comandi ammessi
/// </summary>
protected Dictionary<string, string> _comandi = new Dictionary<string, string>();
/// <summary>
/// dictionary dei valori ammessi
/// </summary>
protected Dictionary<string, string> _tabValori = new Dictionary<string, string>();
/// <summary>
/// oggetto comando locale alla classe
/// </summary>
protected SteamWare.inputComando comando
{
get
{
SteamWare.inputComando answ;
if (memLayer.ML.isInSessionObject("barcodeCmd"))
{
answ = (SteamWare.inputComando)memLayer.ML.objSessionObj("barcodeCmd");
}
else
{
answ = new SteamWare.inputComando();
}
return answ;
}
set
{
memLayer.ML.setSessionVal("barcodeCmd", value, false);
}
}
/// <summary>
/// oggetto comando locale alla classe
/// </summary>
public string rawInput
{
get
{
string answ;
if (memLayer.ML.isInSessionObject("barcodeRaw"))
{
answ = memLayer.ML.StringSessionObj("barcodeRaw");
}
else
{
answ = "";
}
return answ;
}
set
{
memLayer.ML.setSessionVal("barcodeRaw", value, false);
}
}
/// <summary>
/// al caricamento della pagina...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
resetData();
}
DetectAgent();
myInitialize();
}
/// <summary>
/// inizializzazione specifica barcode
/// </summary>
private void myInitialize()
{
if (!Page.IsPostBack)
{
lblInput.Text = traduci("PregoInserireBarcode");
comando = new SteamWare.inputComando();
}
}
public string BCodeVal
{
get
{
return txtInput.Text.Trim().ToUpper();
}
set
{
txtInput.Text = value;
}
}
/// <summary>
/// barcode completato con invio...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtInput_TextChanged(object sender, EventArgs e)
{
processInput();
}
public void processInput()
{
comando.isValid = false;
bool gotIt = false;
gotIt = checkComandi();
if (!gotIt)
{
gotIt = checkMacc();
}
if (!gotIt)
{
gotIt = checkIntServ();
}
// ora check globale...
checkParam();
// verifico se c'è stato input evento
if (comando.isValid)
{
if (comando.currCmdIn != "" || comando.descrComando != "")
{
txtInput2show = comando.descrComando;
}
else
{
txtInput2show = "---";
}
if (comando.valore != "")
{
txtVal2show = comando.valoreTrad;
}
else
{
txtVal2show = "---";
}
if (eh_comandoRegistrato != null)
{
eh_comandoRegistrato(this, new EventArgs());
}
}
else
{
lblInput.Text = traduci("ComandoSconosciuto");
lblValore.Text = BCodeVal;
comando = new SteamWare.inputComando();
rawInput = BCodeVal;
if (eh_dataRead != null)
{
eh_dataRead(this, new EventArgs());
}
}
BCodeVal = "";
}
private bool checkComandi()
{
bool answ = false;
// controllo eventuali comandi CUSTOM
if (BCodeVal == regExp_KO)
{
comando.isValid = true;
answ = true;
resetData();
}
else if (BCodeVal == regExp_KitStart)
{
comando.isValid = true;
answ = true;
resetData();
}
else if (BCodeVal == regExp_KitSave)
{
comando.isValid = true;
answ = true;
resetData();
}
else if (BCodeVal == regExp_OK)
{
// comando valido SE ho ordine coerente...
if (checkOrdOk)
{
comando.isValid = true;
// recupero il codGruppo da macchina... (primo)
if (codGruppo == "")
{
var tabAG = DataLayer.obj.taAG.getFaseByIdxMacc(idxMacc);
if (tabAG.Rows.Count > 0)
{
codGruppo = tabAG[0].CodGruppo;
}
}
// controllo se ho tutti i dati necessari...
if (codOrd != "" && codArt != "" && codGruppo != "" && idxMacc != "" && qta > 0)
{
// creo nuova PROMESSA ODL...
DataLayer.obj.taPODL.insertQuery(codOrd, codOrd, true, codArt, codGruppo, idxMacc, qta, 1, DateTime.Now, 1, 1);
}
}
// resetto ricaricando
Response.Redirect(titolo);
}
return answ;
}
private void resetData()
{
// resetto
idxMacc = "";
nomeMacc = "";
codArt = "";
descArt = "";
codGruppo = "";
codOrd = "";
qta = 0;
}
private bool checkMacc()
{
bool answ = false;
// verifico se il barcode è di una macchina...
var risultato = DataLayer.obj.taMacchine.GetByIdx(BCodeVal);
if (risultato.Rows.Count > 0)
{
idxMacc = BCodeVal;
comando.valore = BCodeVal;
comando.isValid = true;
answ = true;
// recupero altri dati
var rRes = risultato[0];
nomeMacc = rRes.Descrizione;
// imposto il gruppo cercandolo...
var gruppi = DataLayer.obj.taAG.getByIdxMacc(BCodeVal);
if (gruppi.Rows.Count > 0)
{
// salvo primo...
codGruppo = gruppi[0].CodGruppo;
}
}
return answ;
}
/// <summary>
/// verifica parametri in sessione x i valori eventualmente da mettere al comando...
/// </summary>
private void checkParam()
{
// ho macchina ed articolo?
bool hasAllData = (idxMacc != "" && codArt != "");
string valOut = "";
if (codArt != "")
{
valOut += string.Format("<b>{0}</b><br/>Art: {1} | qta: {2:N0} | kit: {3}<br/>{4}", codOrd, codArt, qta, kitCode, descArt);
}
if (idxMacc != "")
{
valOut += string.Format("<br>{0} | {1}", idxMacc, nomeMacc);
}
// imposto...
comando.valoreTrad = valOut;
// controllo se ho tutto...
comando.descrComando = "";
if (idxMacc == "")
{
comando.descrComando += " - Manca Impianto - ";
}
if (codArt == "" || codOrd == "")
{
comando.descrComando += " - Manca Ordine Produzione - ";
}
if (!checkOrdOk)
{
comando.descrComando += " - Tipo Ordine errato - ";
}
if (hasAllData && checkOrdOk)
{
comando.descrComando = "Confermare caricamento";
}
}
private bool checkIntServ()
{
bool answ = false;
// IN PRIMIS se c'è in config preprocesso BCode x Find-Replace
string BCodeFilt = BCodeVal;
if (regExp_Find != "")
{
// splitto i vettori
var vettFind = regExp_Find.Split('|');
var vettRepl = regExp_Replace.Split('|');
// se ho tanti find quanti replace procedo...
if (vettFind.Length == vettRepl.Length)
{
for (int i = 0; i < vettFind.Length; i++)
{
BCodeFilt = BCodeFilt.Replace(vettFind[i], vettRepl[i]);
}
}
else
{
logger.lg.scriviLog(string.Format("Attenzione: problema in decodifica barcode find/replace, i aprametri non corrispondono una votla esplosi i vettori:{0}find: {1}{0}replace:{2}", Environment.NewLine, regExp_Find, regExp_Replace));
}
}
// cerco esplicitamente sul DB IntegrationServices...
var risultato = DataLayer.obj.taIS_TrDati.getOrdini(BCodeFilt);
if (risultato.Rows.Count > 0)
{
var rRes = risultato[0];
// verifico da config COME decodificare IS...
string BCodeIS_DType = memLayer.ML.cdv("BCodeIS_DType");
// verifico corrispondano i formati...
if (rRes.DataType == BCodeIS_DType)
{
// cerco i dati e decodifico... togliendo eventuale VETTORE "[..]"
var jsonData = risultato[0].ValueOUT.Replace("[", "").Replace("]", "");
try
{
if (BCodeIS_DType == "Colcom_Order")
{
// a seconda del tipo decodifico...
ISTD_OrderColcom currVal = JsonConvert.DeserializeObject<ISTD_OrderColcom>(jsonData);
comando.isValid = true;
answ = true;
// salvo ordine / articolo / qta
codOrd = currVal.CodOrdine;
codArt = currVal.CodArticolo;
descArt = currVal.DescrArticolo;
kitCode = currVal.KitCode;
qta = (int)currVal.Qta;
comando.valore = jsonData;// string.Format("{0}#{1}#{2:N0}", codOrd, codArt, qta);
comando.currCmdIn = "OrdArtQta";
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in decodifica obj JSON:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
}
}
return answ;
}
/// <summary>
/// verifico se sia un valore compreso nell'elenco fornito
/// </summary>
private void isValore()
{
if (_tabValori.ContainsKey(BCodeVal)) // verifico se il comando digitato esista...
{
comando.isValid = true;
comando.valore = BCodeVal;
_tabValori.TryGetValue(BCodeVal, out comando.valoreTrad);
}
}
/// <summary>
/// verifica se il comando inserito sia valido
/// </summary>
private void isInputEvent()
{
if (_comandi.ContainsKey(BCodeVal)) // verifico se il comando digitato esista...
{
comando.isValid = true;
// salvo comando precedente (se c'è...)
comando.prevCmdIn = comando.currCmdIn;
comando.descrComandoPrev = comando.descrComando;
comando.currCmdIn = BCodeVal;
_comandi.TryGetValue(BCodeVal, out comando.descrComando);
}
}
/// <summary>
/// verifica quale browser usato e applica css corretto al div attorno al box
/// </summary>
private void DetectAgent()
{
System.Web.HttpBrowserCapabilities browser = Request.Browser;
if (browser.Browser == "IE")
{
pnlBarcodeBox.CssClass = "barcodeBoxIE";
}
else
{
pnlBarcodeBox.CssClass = "barcodeBoxOther";
}
}
#endregion
#region area public
/// <summary>
/// effettua al ettura da sessione del comando cliccato e lo inserisce come fosse barcode
/// </summary>
public void loadBtnClickComando()
{
BCodeVal = memLayer.ML.StringSessionObj("btnCmdPress");
memLayer.ML.emptySessionVal("btnCmdPress");
processInput();
}
/// <summary>
/// elenco dei comandi riconosciuti
/// </summary>
public Dictionary<string, string> comandiAmmessi
{
get
{
return _comandi;
}
set
{
_comandi = value;
}
}
/// <summary>
/// tabella di valori ammissibili
/// </summary>
public Dictionary<string, string> tabValori
{
get
{
return _tabValori;
}
set
{
_tabValori = value;
}
}
/// <summary>
/// evento comando registrato
/// </summary>
public event EventHandler eh_comandoRegistrato;
/// <summary>
/// evento lettura dati (grezza) effettuata
/// </summary>
public event EventHandler eh_dataRead;
/// <summary>
/// comando registrato dal barcode
/// </summary>
public SteamWare.inputComando comandoRegistrato
{
get
{
return comando;
}
}
/// <summary>
/// scrive nella label input
/// </summary>
public string txtInput2show
{
set
{
lblInput.Text = value;
}
}
/// <summary>
/// scrive nella label valore
/// </summary>
public string txtVal2show
{
set
{
lblValore.Text = value;
}
}
/// <summary>
/// scrive nella label richiesta
/// </summary>
public string txtRich2show
{
set
{
lblRichiesta.Text = value;
}
}
/// <summary>
/// reset del controllo
/// </summary>
public void resetMe()
{
comando = new SteamWare.inputComando();
txtInput2show = "Prego inserire barcode";
txtVal2show = "";
txtRich2show = "";
}
/// <summary>
/// wrapper traduzione termini
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
#endregion
}
}
+78
View File
@@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_barcode {
/// <summary>
/// Controllo txtInput.
/// </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 txtInput;
/// <summary>
/// Controllo lbtCerca.
/// </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 lbtCerca;
/// <summary>
/// Controllo pnlBarcodeBox.
/// </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.Panel pnlBarcodeBox;
/// <summary>
/// Controllo lblInput.
/// </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 lblInput;
/// <summary>
/// Controllo lblValore.
/// </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 lblValore;
/// <summary>
/// Controllo lblRichiesta.
/// </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 lblRichiesta;
/// <summary>
/// Controllo lblBrowser.
/// </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 lblBrowser;
}
}
+117
View File
@@ -0,0 +1,117 @@
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="mod_calChiusura" CodeBehind="mod_calChiusura.ascx.cs" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="data" DataSourceID="ods" OnDataBound="grView_DataBound">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="data" InsertVisible="False" SortExpression="data">
<EditItemTemplate>
<asp:TextBox ID="txtData" runat="server" Text='<%# Bind("data","{0:dd/MM/yy}") %>'
Width="5em" />
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtData" Format="dd/MM/yy"></cc1:CalendarExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("data","{0:dd/MM/yy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="descrizione" SortExpression="descrizione">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Width="30em" Text='<%# Bind("descrizione") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("descrizione") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
</HeaderTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete"></cc1:ConfirmButtonExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="GIM_data.DS_applicazioneTableAdapters.CalendFesteFerieTableAdapter"
UpdateMethod="Update" DeleteMethod="Delete" OldValuesParameterFormatString="Original_{0}"
FilterExpression="descrizione LIKE '%{0}%' " InsertMethod="Insert">
<UpdateParameters>
<asp:Parameter Name="data" Type="DateTime" />
<asp:Parameter Name="descrizione" Type="String" />
<asp:Parameter Name="Original_data" Type="DateTime" />
</UpdateParameters>
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_data" Type="DateTime" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="data" Type="DateTime" />
<asp:Parameter Name="descrizione" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
<div style="text-align: center;">
<asp:Button ID="btnShowInsPeriodo" runat="server" Text="..." OnClick="btnShowInsPeriodo_Click" />
<asp:Panel runat="server" ID="pnlInsPeriodo" Visible="false">
<div style="float: left;">
<asp:TextBox ID="txtDataFrom" runat="server" Width="5em" />
<cc1:CalendarExtender ID="CalendarExtender2" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtDataFrom" Format="dd/MM/yy"></cc1:CalendarExtender>
</div>
<div style="float: left;">
<asp:TextBox ID="txtDataTo" runat="server" Width="5em" />
<cc1:CalendarExtender ID="CalendarExtender3" runat="server" FirstDayOfWeek="Monday"
TargetControlID="txtDataTo" Format="dd/MM/yy"></cc1:CalendarExtender>
</div>
<div style="float: left;">
<asp:TextBox ID="txtDescrizione" runat="server" Width="30em" />
</div>
<div style="float: left;">
<asp:Button ID="btnInsPeriodo" runat="server" OnClick="btnInsPeriodo_Click" />
</div>
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
</asp:Panel>
</div>
@@ -0,0 +1,113 @@
using SteamWare;
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class mod_calChiusura : ApplicationUserControl
{
public event EventHandler eh_resetSelezione;
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
if (!Page.IsPostBack)
{
grView.PageSize = _righeDataGridMed;
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
btnInsPeriodo.Text = traduci("btnInsPeriodo");
}
}
/// <summary>
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
// reset selezione...
resetSelezione();
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
MapoDb.DataLayer.obj.taCalFF.Insert(DateTime.Now.Date, "-- [NUOVO] non definito --");
grView.DataBind();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grView.SelectedIndex = -1;
grView.DataBind();
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
/// <summary>
/// evento dati associati a controllo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_DataBound(object sender, EventArgs e)
{
if (grView.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grView.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
}
else
{
lblNumRec.Text = "";
}
}
protected void btnShowInsPeriodo_Click(object sender, EventArgs e)
{
pnlInsPeriodo.Visible = !pnlInsPeriodo.Visible;
if (pnlInsPeriodo.Visible)
{
btnShowInsPeriodo.Text = traduci("btnHideInsPeriodo");
}
else
{
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
}
}
protected void btnInsPeriodo_Click(object sender, EventArgs e)
{
// verifico date congrue...
DateTime inizio = Convert.ToDateTime(txtDataFrom.Text);
DateTime fine = Convert.ToDateTime(txtDataTo.Text);
if (fine.CompareTo(inizio) >= 0)
{
// inserisco le voci x tutte le date nell'intervallo...
while (fine.CompareTo(inizio) >= 0)
{
MapoDb.DataLayer.obj.taCalFF.Insert(inizio, txtDescrizione.Text);
inizio = inizio.AddDays(1);
}
// update e nascondo pannello
grView.DataBind();
pnlInsPeriodo.Visible = false;
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
lblWarning.Visible = false;
}
else
{
lblWarning.Visible = true;
lblWarning.Text = traduci("OrdineDateErrato");
}
}
}
+121
View File
@@ -0,0 +1,121 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class mod_calChiusura {
/// <summary>
/// grView 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.GridView grView;
/// <summary>
/// lblNumRec 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 lblNumRec;
/// <summary>
/// ods 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.ObjectDataSource ods;
/// <summary>
/// btnShowInsPeriodo 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.Button btnShowInsPeriodo;
/// <summary>
/// pnlInsPeriodo 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.Panel pnlInsPeriodo;
/// <summary>
/// txtDataFrom 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.TextBox txtDataFrom;
/// <summary>
/// CalendarExtender2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.CalendarExtender CalendarExtender2;
/// <summary>
/// txtDataTo 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.TextBox txtDataTo;
/// <summary>
/// CalendarExtender3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.CalendarExtender CalendarExtender3;
/// <summary>
/// txtDescrizione 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.TextBox txtDescrizione;
/// <summary>
/// btnInsPeriodo 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.Button btnInsPeriodo;
/// <summary>
/// lblWarning 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 lblWarning;
}
+6
View File
@@ -0,0 +1,6 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_fixCal" Codebehind="mod_fixCal.ascx.cs" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:TextBox ID="TextBox1" runat="server" Visible="false">
</asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1"
FirstDayOfWeek="monday" Format="dd/MM/yyyy" />
@@ -0,0 +1,9 @@
using System;
public partial class mod_fixCal : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
+32
View File
@@ -0,0 +1,32 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class mod_fixCal {
/// <summary>
/// TextBox1 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.TextBox TextBox1;
/// <summary>
/// CalendarExtender1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1;
}
+14
View File
@@ -0,0 +1,14 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_footer.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_footer" %>
<div data-role="navbar">
<div class="row" style="color: Yellow;">
<div class="col text-left">
<asp:Label runat="server" ID="lblLastUpdt" />
</div>
<div class="col text-center">
<%: SteamWare.devicesAuthProxy.stObj.utente %>
</div>
<div class="col text-right">
<asp:Label runat="server" ID="lblVers" />
</div>
</div>
</div>
+13
View File
@@ -0,0 +1,13 @@
using System;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_footer : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
lblLastUpdt.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
lblVers.Text = string.Format("v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
}
}
}
+33
View File
@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_footer {
/// <summary>
/// Controllo lblLastUpdt.
/// </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 lblLastUpdt;
/// <summary>
/// Controllo lblVers.
/// </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 lblVers;
}
}
+231
View File
@@ -0,0 +1,231 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestKIT.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_gestKIT" %>
<div class="row">
<div class="col-sm-12">
<div class="card-deck">
<asp:HiddenField runat="server" ID="hlCodKitTemp" />
<div class="card">
<div class="card-header bg-primary text-light">
<h4>Composizione KIT</h4>
</div>
<div class="card-body">
<b>Ordini selezionati:</b>
<asp:GridView runat="server" ID="grViewWSK" DataSourceID="odsWSK" AutoGenerateColumns="False" DataKeyNames="KeyFilt,CodOrd" CssClass="table table-sm table-striped">
<EmptyDataTemplate>
Nessun Ordine caricato
</EmptyDataTemplate>
<Columns>
<asp:BoundField DataField="CodOrd" HeaderText="OPR" ReadOnly="True" SortExpression="CodOrd" ItemStyle-CssClass="text-nowrap" />
<asp:BoundField DataField="CodArt" HeaderText="Cod.Art" SortExpression="CodArt" ItemStyle-CssClass="font-weight-bold" />
<asp:BoundField DataField="DescArt" HeaderText="Desc.Art" SortExpression="DescArt" ItemStyle-CssClass="small" />
<asp:BoundField DataField="Qta" HeaderText="Qta" SortExpression="Qta" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="odsWSK" OldValuesParameterFormatString="original_{0}" SelectMethod="getByFilt" TypeName="MapoDb.DS_IntServTableAdapters.WipSetupKitTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hlCodKitTemp" Name="KeyFilt" PropertyName="Value" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="card-footer py-1 bg-primary text-light">
Cod temp: <b><%: hlCodKitTemp.Value %></b>
</div>
</div>
<div class="card">
<div class="card-header bg-success text-light">
<h4>Verifica KIT</h4>
</div>
<div class="card-body">
<b>Elenco KIT compatibili</b>
<asp:GridView runat="server" ID="grViewKitSel" DataSourceID="odsKitSel" AutoGenerateColumns="False" CssClass="table table-striped table-sm" DataKeyNames="CodArtParent" OnSelectedIndexChanged="grViewKitSel_SelectedIndexChanged">
<EmptyDataTemplate>
Nessun KIT trovato
</EmptyDataTemplate>
<Columns>
<asp:BoundField DataField="CodArtParent" HeaderText="Codice KIT" SortExpression="CodArtParent" />
<asp:BoundField DataField="TotalScore" HeaderText="Coerenza KIT" ReadOnly="True" SortExpression="TotalScore" DataFormatString="{0:P2}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField HeaderText="Azione">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtCreatePODL" Visible='<%# Eval("TotalScore","{0:P0}") == "100%" %>' CssClass="btn btn-success btn-sm" ToolTip="Crea ordine KIT" CommandName="select">
<i class="fa fa-plus-square"></i> Prom.ODL <i class="fa fa-plus-square"></i>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="odsKitSel" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_IntServTableAdapters.TKS_SearchTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hlCodKitTemp" Name="KeyFilt" PropertyName="Value" Type="String" />
<asp:Parameter DefaultValue="2" Name="maxResult" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<div runat="server" id="divPODL">
<b>Elenco promesse per KIT (100%)</b>
<asp:GridView runat="server" ID="grViewPODL" DataSourceID="odsPODL" CssClass="table table-sm table-striped" AutoGenerateColumns="False" DataKeyNames="idxPromessa">
<Columns>
<asp:BoundField DataField="idxPromessa" HeaderText="#" InsertVisible="False" ReadOnly="True" SortExpression="idxPromessa" />
<asp:TemplateField HeaderText="Cod.KIT" SortExpression="KeyRichiesta">
<ItemTemplate>
<div style="float: left;">
<b>
<asp:Label runat="server" ID="txtCodArticolo" Text='<%# Eval("CodArticolo") %>' /></b>
</div>
<div style="float: right; font-size: 0.8em;">
<asp:Label runat="server" ID="Label3" Text='<%# Eval("KeyRichiesta") %>' />
</div>
<div style="float: none; clear: both;">
<asp:Label runat="server" ID="txtDescArticolo" Text='<%# Eval("DescArticolo") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nome" SortExpression="Nome">
<ItemTemplate>
<b>
<asp:Label runat="server" ID="txtCodMacchina" Text='<%# Eval("CodMacchina") %>' /></b>
<br />
<asp:Label runat="server" ID="txtNome" Text='<%# Eval("Nome") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NumPezzi" HeaderText="NumPezzi" SortExpression="NumPezzi" />
</Columns>
<EmptyDataTemplate>
Nessun Record (P.ODL da eseguire)
</EmptyDataTemplate>
</asp:GridView>
<asp:ObjectDataSource ID="odsPODL" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByCodArt" TypeName="MapoDb.DS_ProdTempiTableAdapters.PromesseODLTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hfCodArtKit" DefaultValue="###" Name="CodArticolo" PropertyName="Value" Type="String" />
<asp:Parameter DefaultValue="true" Name="onlyAvail" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfCodArtKit" />
</div>
</div>
<div class="card-footer py-1 bg-success text-light">
Abilitato se = 100%
</div>
</div>
<div class="card">
<div class="card-header bg-danger text-light">
<h4>KIT e Promesse</h4>
</div>
<div class="card-body">
<b>Elenco KIT associati ad ordini</b>
<asp:GridView runat="server" ID="grViewIstanzeKIT" DataSourceID="odsIstanzeKIT" AutoGenerateColumns="False" DataKeyNames="KeyKit,KeyExtOrd" CssClass="table table-sm table-striped">
<EmptyDataTemplate>
Nessun Record (Ordini associati a KIT)
</EmptyDataTemplate>
<Columns>
<asp:BoundField DataField="KeyKit" HeaderText="OPR.KIT" ReadOnly="True" SortExpression="KeyKit" ItemStyle-CssClass="font-weight-bold" />
<asp:BoundField DataField="CodArtParent" HeaderText="Cod.KIT" SortExpression="CodArtParent" />
<asp:BoundField DataField="KeyExtOrd" HeaderText="OPR" ReadOnly="True" SortExpression="KeyExtOrd" ItemStyle-CssClass="text-danger" />
<asp:BoundField DataField="CodArtChild" HeaderText="Cod.Art" SortExpression="CodArtChild" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsIstanzeKIT" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByExtOrd" TypeName="MapoDb.DS_IntServTableAdapters.IstanzeKITTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hlCodKitTemp" Name="KeyFilt" PropertyName="Value" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="card-footer py-1 bg-danger text-light">
Attenzione: non associare OPR a più KIT!
</div>
</div>
</div>
</div>
</div>
<div class="row">
<%--<div class="col">
<ul>
<li><b>esempio KIT: 8060A00</b></li>
<li>OPR18-20381</li>
<li>OPR18-21855</li>
<li>OPR18-21856</li>
<li>OPR18-21857</li>
<li>OPR18-22974 (NON VA BENE A313)</li>
</ul>
</div>--%>
<%-- <div class="col">
<ul>
<li><b>esempio KIT: 8010A00</b></li>
<li>OPR18-22022</li>
<li>OPR18-22032</li>
</ul>
<br />
<ul>
<li><b>esempio KIT: 8665A00</b></li>
<li>OPR18-21255</li>
<li>OPR18-21259</li>
<li>OPR18-21268</li>
<li>OPR18-21262</li>
</ul>
</div>--%>
<div class="col-4">
<asp:HiddenField ID="hlLastInput" runat="server" />
<asp:Label runat="server" ID="lblOut" CssClass="text-danger" />
</div>
</div>
<%--TESTDB: MoonPro
select * from Config where chiave like 'regexp%'
TESTDB: IS_Colcom
exec stp_IstanzeKit_Search 'K1800000001', '', '', ''
exec stp_IstanzeKit_Search '', 'OPR-123456', '', ''
exec stp_IstanzeKit_Search '', '', 'A101000', ''
exec stp_IstanzeKit_Search '', '', '', 'A101001'
exec stp_TemplateKit_Search '8060A00',''
exec stp_TemplateKit_Search '','8060A313'
select * from TransitoDati
select * from IstanzeKIT
select top 1 * from TransitoDati where ValueOUT LIKE '%8060A0%'
select top 1 * from TransitoDati where ValueOUT LIKE '%8060A1%'
select top 1 * from TransitoDati where ValueOUT LIKE '%8060A2%'
select top 1 * from TransitoDati where ValueOUT LIKE '%8060A313%'
-- esempio KIT: 8060A00
-- OPR18-20381
-- OPR18-21855
-- OPR18-21856
-- OPR18-22974
select * from TemplateKIT order by CodArtChild DESC
exec stp_TKS_Search '1010A1,1010A2,'
exec stp_TKS_Search '8060A0,'
exec stp_TKS_Search '8060A1,'
exec stp_TKS_Search '8060A2,'
exec stp_TKS_Search '8060A313,'
exec stp_TKS_Search '8060A0,8060A1,8060A2,8060A313,'
exec stp_TKS_Search 'V10616D,'
exec stp_TKS_Search 'M06606,'
exec stp_TemplateKit_Search '1050A00',''
exec stp_TemplateKit_Search '1040A00',''
exec stp_TemplateKit_Search '6606A00',''
exec stp_TemplateKit_Search '6610A00',''
--truncate table IstanzeKIT
--truncate table Counters
select * from IstanzeKIT
exec stp_IstKit_byKeyExtOrd 'OPR-123321,OPR-123456,'
exec stp_IstKit_getKey
--%>
+264
View File
@@ -0,0 +1,264 @@
using MapoDb;
using SteamWare;
using System;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_gestKIT : System.Web.UI.UserControl
{
public event EventHandler eh_selKit;
#region setup VARS
/// <summary>
/// RegExp x RESET / CANCEL
/// </summary>
protected string regExp_KO = memLayer.ML.cdv("regExp_KO");
/// <summary>
/// RegExp x CONFERMA
/// </summary>
protected string regExp_OK = memLayer.ML.cdv("regExp_OK");
/// <summary>
/// RegExp x START KIT
/// </summary>
protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart");
/// <summary>
/// RegExp x SAVE KIT
/// </summary>
protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave");
#endregion
#region variabili in sessione
/// <summary>
/// UID formattato con "_"
/// </summary>
public string uid
{
get
{
return this.UniqueID.Replace("$", "_").Replace("-", "_");
}
}
/// <summary>
/// titolo pagina
/// </summary>
public string titolo
{
get
{
return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", "");
}
}
public string codKitTemp
{
get
{
return memLayer.ML.StringSessionObj(string.Format("codKitTemp_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("codKitTemp_{0}", uid), value);
hlCodKitTemp.Value = value;
grViewWSK.DataBind();
}
}
/// <summary>
/// Ultimo Codice KIT creato
/// </summary>
public string lastKitMade
{
get
{
return memLayer.ML.StringSessionObj("lastKitMade");
}
set
{
memLayer.ML.setSessionVal("lastKitMade", value);
}
}
/// <summary>
/// Aggiunge (in obj OrdineKit) l'ordine coi parametri indicati
/// </summary>
/// <param name="codOrd"></param>
/// <param name="codArt"></param>
/// <param name="descArt"></param>
/// <param name="qta"></param>
/// <returns></returns>
public bool addOrdArt(string codOrd, string codArt, string descArt, int qta)
{
bool answ = false;
// verifico di avere un codiceKIT
checkCodKit();
// salvo info x il cod temporaneo...
DataLayer.obj.taWKS.insertQuery(codKitTemp, codOrd, codArt, descArt, qta);
// verifico SE HO un KIT riconosciuto e quindi un CodArt di KIT valido...
string currCodArtKit = "###";
var TksTab = DataLayer.obj.taTKS.GetData(codKitTemp, 1);
bool showPODL = false;
if (TksTab.Rows.Count > 0)
{
// verifico se ho aderenza 100%...
if (TksTab[0].TotalScore == 1)
{
currCodArtKit = TksTab[0].CodArtParent;
showPODL = true;
}
}
hfCodArtKit.Value = currCodArtKit;
divPODL.Visible = showPODL;
answ = true;
grViewWSK.DataBind();
grViewKitSel.DataBind();
grViewPODL.DataBind();
grViewIstanzeKIT.DataBind();
return answ;
}
#endregion
/// <summary>
/// Caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
doReset();
}
}
/// <summary>
/// Ultimo input registrato
/// </summary>
public string lastInput
{
get
{
return hlLastInput.Value;
}
set
{
hlLastInput.Value = value;
}
}
/// <summary>
/// Aggiorno controllo secondo ULTIMO input
/// </summary>
public void doUpdate()
{
// aggiorno label...
messOut = "";
// controllo input (reset/inizio o salva...)
if (lastInput == regExp_KO)
{
// resetto dati
doReset();
messOut = "Effettuato reset!";
}
else if (lastInput == regExp_KitStart)
{
// resetto dati
doReset();
messOut = "Inizio configurazione KIT";
}
else if (lastInput == regExp_KitSave)
{
// controllo SE HO un kit selezionato...
string currCodArtKit = "###";
var TksTab = DataLayer.obj.taTKS.GetData(codKitTemp, 1);
bool showPODL = false;
if (TksTab.Rows.Count > 0)
{
// verifico se ho aderenza 100%...
if (TksTab[0].TotalScore == 1)
{
currCodArtKit = TksTab[0].CodArtParent;
showPODL = true;
}
}
if (showPODL)
{
// in questo caso creo istanza!
creazioneIstanzaKit(currCodArtKit);
}
}
else if (lastInput == regExp_OK)
{
}
// ennesimo check cod TEMP
checkCodKit();
}
private void doReset()
{
// elimino eventuali record ODL
DataLayer.obj.taWKS.deleteQuery(codKitTemp);
codKitTemp = "";
divPODL.Visible = false;
checkCodKit();
}
/// <summary>
/// Verifico SE HO un codKit Temporaneo sennò lo creo...
/// </summary>
private void checkCodKit()
{
if (codKitTemp == "")
{
// genero un NUOVO cod temp kit...
codKitTemp = string.Format("KIT_{0:yyMMdd_HHmmss}", DateTime.Now);
}
}
public string messOut
{
set
{
lblOut.Text = value;
}
get
{
return lblOut.Text;
}
}
protected void grViewKitSel_SelectedIndexChanged(object sender, EventArgs e)
{
// se ho selezionato recupero CHIAVE = CodArticolo del KIT
string CodArtParent = grViewKitSel.SelectedValue.ToString();
// crea KIT x quel CodArtParent...
creazioneIstanzaKit(CodArtParent);
}
/// <summary>
/// Crea una NUOVA istanza KIT
/// </summary>
/// <param name="CodArtParent">CodArt dell'Assieme/KIT</param>
private void creazioneIstanzaKit(string CodArtParent)
{
// calcolo NUOVO codice kit...
var tabKey = DataLayer.obj.taIstK.getNewKey();
if (tabKey.Rows.Count == 1)
{
// stacco un NUOVO codice KIT
lastKitMade = tabKey[0].KeyKit;
// inserisco ISTANZA KIT!
DataLayer.obj.taIstK.insertByWKS(lastKitMade, CodArtParent, codKitTemp);
// faccio reset valori WKS...
doReset();
// ora resetto ordine caricato...
messOut = string.Format("Creato NUOVA P.ODL cod {0} per il KIT {1}", lastKitMade, CodArtParent);
// sollevo evento x impostare lettura KIT a BARCODE (x conferma successiva...)
// sollevo evento nuovo valore...
if (eh_selKit != null)
{
eh_selKit(this, new EventArgs());
}
}
}
}
}
+132
View File
@@ -0,0 +1,132 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_gestKIT {
/// <summary>
/// Controllo hlCodKitTemp.
/// </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.HiddenField hlCodKitTemp;
/// <summary>
/// Controllo grViewWSK.
/// </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 grViewWSK;
/// <summary>
/// Controllo odsWSK.
/// </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 odsWSK;
/// <summary>
/// Controllo grViewKitSel.
/// </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 grViewKitSel;
/// <summary>
/// Controllo odsKitSel.
/// </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 odsKitSel;
/// <summary>
/// Controllo divPODL.
/// </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 divPODL;
/// <summary>
/// Controllo grViewPODL.
/// </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 grViewPODL;
/// <summary>
/// Controllo odsPODL.
/// </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 odsPODL;
/// <summary>
/// Controllo hfCodArtKit.
/// </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.HiddenField hfCodArtKit;
/// <summary>
/// Controllo grViewIstanzeKIT.
/// </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 grViewIstanzeKIT;
/// <summary>
/// Controllo odsIstanzeKIT.
/// </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 odsIstanzeKIT;
/// <summary>
/// Controllo hlLastInput.
/// </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.HiddenField hlLastInput;
/// <summary>
/// Controllo lblOut.
/// </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 lblOut;
}
}
+208
View File
@@ -0,0 +1,208 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestPromODL.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_gestPromODL" %>
<%@ Register Src="~/WebUserControls/mod_newPromessaODL.ascx" TagPrefix="uc1" TagName="mod_newPromessaODL" %>
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<h4>Filtri attivi</h4>
</div>
<div class="col text-nowrap">
<div class="input-group my-1 input-group-sm">
<div class="input-group-prepend">
<asp:LinkButton runat="server" ID="lbtResArt" CssClass="btn btn-outline-dark" OnClick="lbtResArt_Click"><i class="fa fa-refresh"></i> <b>Articolo</b></asp:LinkButton>
<asp:Label runat="server" ID="lblCodArt" CssClass="input-group-text" />
<asp:Label runat="server" ID="lblDescArt" CssClass="input-group-text text-truncate" />
</div>
</div>
</div>
<div class="col">
<div class="input-group my-1 input-group-sm">
<div class="input-group-prepend">
<asp:LinkButton runat="server" ID="lbtResMacc" CssClass="btn btn-outline-dark" OnClick="lbtResMacc_Click"><i class="fa fa-refresh"></i> <b>Macchina</b></asp:LinkButton>
<asp:Label runat="server" ID="lblNomeMacc" CssClass="input-group-text" />
<asp:Label runat="server" ID="lblIdxMacc" CssClass="input-group-text" />
</div>
</div>
</div>
<div class="col">
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">
<asp:CheckBox runat="server" ID="chkUnassigned" AutoPostBack="True" OnCheckedChanged="chkUnassigned_CheckedChanged" Checked="true" />
</div>
</div>
<asp:Label runat="server" ID="lblUnass" CssClass="input-group-text" Text="Mostra SOLO programmate" />
</div>
</div>
</div>
<div class="bg-dark text-light" style="white-space: nowrap; padding: 2px;">
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<asp:LinkButton ID="lbtNewPODL" runat="server" OnClick="lbtNewPODL_Click" CssClass="btn btn-block btn-primary text-light"><i class="fa fa-plus"></i> PROMESSA ODL <i class="fa fa-list-ol"></i></asp:LinkButton>
</div>
<div class="col-4"></div>
</div>
<uc1:mod_newPromessaODL runat="server" ID="mod_newPromessaODL" />
</div>
<div id="divEditQta" runat="server" visible="false" class="ctrSelRowStyle" style="white-space: nowrap; padding: 2px;">
<div class="row">
<div class="col-sm-3">
<asp:LinkButton ID="lbtOk" runat="server" Text="Ok" OnClick="btnOk_Click" CssClass="btn btn-block btn-success" OnClientClick="return confirm('Sicuro di voler modificare la Promessa ODL?');"><i class="fa fa-plus"></i> Modifica </asp:LinkButton>
</div>
<div class="col-sm-3">
# Pezzi Richiesti:
<asp:TextBox runat="server" ID="txtNewQta" Width="6em" />
</div>
<div class="col-sm-3">
Pezzi Pallet:
<asp:TextBox runat="server" ID="txtNewPzPallet" Width="6em" />
</div>
<div class="col-sm-3">
<asp:LinkButton ID="lbtCancel" runat="server" Text="Annulla" OnClick="btnCancel_Click" CssClass="btn btn-block btn-warning"><i class="fa fa-ban"></i> Annulla</asp:LinkButton>
</div>
</div>
</div>
</div>
<div class="card-body">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound" PageSize="25"
DataKeyNames="IdxPromessa" DataSourceID="ods" Width="100%">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:LinkButton runat="server" ID="lbtReset" CausesValidation="false" OnClick="btnReset_Click" ToolTip="Reset selezione" CssClass="btn btn-block btn-warning"><i class="fa fa-refresh"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtSel" CausesValidation="false" CommandName="Select" OnCommand="lbt_Command" CommandArgument="Edit" ToolTip="Modifica promessa" Visible='<%# Eval("IdxODL").ToString()=="" || Eval("IdxODL").ToString()=="0" %>' CssClass="btn btn-sm btn-info"><i class="fa fa-edit"></i></asp:LinkButton>
<asp:LinkButton runat="server" ID="lbtClona" CausesValidation="false" CommandName="Select" OnCommand="lbt_Command" CommandArgument="Clona" ToolTip="Copia promessa" CssClass="btn btn-sm btn-primary" Visible='<%# !Eval("KeyRichiesta").ToString().StartsWith("KIT") %>'><i class="fa fa-clipboard"></i></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="#" SortExpression="IdxPromessa">
<ItemTemplate>
<asp:Label runat="server" ID="txtIdxPromessa" Text='<%# Eval("IdxPromessa") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ODL" SortExpression="IdxOdl">
<ItemTemplate>
<asp:Label runat="server" ID="txtIdxOdl" Text='<%# Eval("IdxOdl") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodArticolo" SortExpression="CodArticolo">
<ItemTemplate>
<div style="float: left;">
<asp:LinkButton runat="server" ID="lbtSelArt" OnClick="lbtSelArt_Click" CausesValidation="False" CommandArgument='<%# Eval("CodArticolo")+"|"+Eval("DescArticolo") %>' CssClass="btn btn-sm btn-outline-dark p-1">
<i class="fa fa-search"></i>
<b><%# Eval("CodArticolo") %></b>
</asp:LinkButton>
</div>
<div style="float: right; font-size: 0.8em;">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("KeyRichiesta") %>' />
</div>
<div style="float: none; clear: both;">
<asp:Label runat="server" ID="txtDescArticolo" Text='<%# Eval("DescArticolo") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="codMacchina" SortExpression="CodMacchina">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtSelMacc" OnClick="lbtSelMacc_Click" CausesValidation="False" CommandArgument='<%# Eval("IdxMacchina")+"|"+Eval("Nome") %>' CssClass="btn btn-sm btn-outline-dark p-1 btn-block">
<i class="fa fa-search"></i>
<b><%# Eval("Nome") %></b>
<div><%# Eval("CodMacchina") %></div>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NumPezzi" SortExpression="NumPezzi">
<ItemTemplate>
<asp:Label runat="server" ID="txtNumPezzi" Text='<%# Eval("NumPezzi") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:Label runat="server" ID="txtNumPezzi" Text='<%# Bind("NumPezzi") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TCAssegnato" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label runat="server" ID="txtTCAssegnato" Text='<%# Eval("TCAssegnato","{0:0.000}") %>' />
<div class="small">
<asp:Label runat="server" ID="txtTCAssMs" Text='<%# SteamWare.TempiCiclo.minSec(Eval("TCAssegnato")) %>' />
(m:s)
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PzPallet" SortExpression="PzPallet">
<ItemTemplate>
<asp:Label runat="server" ID="txtPzPallet" Text='<%# Eval("PzPallet") %>' />
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Data" SortExpression="DueDate">
<ItemTemplate>
<asp:Label runat="server" ID="txtDataInizio" Text='<%# Eval("DueDate") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Attiva" SortExpression="Attivabile">
<ItemTemplate>
<asp:Label runat="server" ID="txtAttivabile" Text='<%# Eval("Attivabile") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtDel" CommandArgument='<%# Eval("IdxPromessa") %>' OnClientClick="return confirm('Sicuro di voler procedere con eliminazione?');" OnClick="lbtDel_Click" ToolTip='<%# traduci("Delete") %>' Visible='<%# Eval("IdxODL").ToString()=="" || Eval("IdxODL").ToString()=="0" %>' CssClass="btn btn-sm btn-danger"><i class="fa fa-trash"></i></asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByMaccArt" TypeName="MapoDb.DS_ProdTempiTableAdapters.PromesseODLTableAdapter" OnInserting="recuperaFooter" FilterExpression="CodArticolo LIKE '%{0}%' OR DescArticolo LIKE '%{0}%' " OnInserted="ods_Updated" OnUpdated="ods_Updated" DeleteMethod="deleteQuery" OnDeleted="ods_Updated" UpdateMethod="updateQta">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_idxPromessa" Type="Int32" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="lblIdxMacc" Name="IdxMacchina" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="lblCodArt" Name="CodArticolo" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="chkUnassigned" Name="onlyFree" PropertyName="Checked" Type="Boolean" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="NumPezzi" Type="Int32" />
<asp:Parameter Name="PzPallet" Type="Int32" />
<asp:Parameter Name="Original_idxPromessa" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
</div>
<div class="card-footer">
<div class="row">
<div class="col"></div>
<div class="col text-center">
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
</div>
<div class="col text-right">
mostra:
<asp:TextBox runat="server" ID="txtPageSize" Text="10" Width="2em" OnTextChanged="txtPageSize_TextChanged" />
</div>
</div>
</div>
</div>
@@ -0,0 +1,586 @@
using MapoDb;
using SteamWare;
using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_gestPromODL : System.Web.UI.UserControl
{
/// <summary>
/// Evento selezione filtro
/// </summary>
public event EventHandler eh_selFilt;
/// <summary>
/// Determina se sia solo readonly il controllo...
/// </summary>
public bool readOnly;
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
#region area da NON modificare
#region area protected
protected string _idxGridView;
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
bool doClone = false;
bool doEdit = false;
// gestione buttons richieste
string _comando = "";
if (memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = memLayer.ML.StringSessionObj("nextObjCommand");
memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Clona":
doClone = true;
break;
case "Edit":
doEdit = true;
break;
default:
break;
}
if (doClone)
{
memLayer.ML.setSessionVal("idxProm2Clone", grView.SelectedValue, false);
showAddNewPODL();
mod_newPromessaODL.doSelPODL();
}
else if (doEdit)
{
memLayer.ML.setSessionVal("idxProm2Edit", grView.SelectedValue, false);
showAddNewPODL();
mod_newPromessaODL.doSelPODL();
}
else
{
// mostro edit quantità...
divEditQta.Visible = true;
lbtNewPODL.Visible = true;
mod_newPromessaODL.Visible = false;
var riga = DataLayer.obj.taPODL.getByKey(idxPOdlSel)[0];
numPz = riga.NumPezzi;
pzPallet = riga.PzPallet;
}
}
/// <summary>
/// traduce gli header delle colonne
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_DataBound(object sender, EventArgs e)
{
if (grView.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grView.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
}
else
{
lblNumRec.Text = "";
}
}
/// <summary>
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
{
//recupero la riga footer...
DataColumnCollection colonne = colonneObj();
string nomeCol;
string tipoColonna = "";
foreach (DataColumn colonna in colonne)
{
nomeCol = colonna.ColumnName;
// cerco un textbox o quello che sia...
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
{
tipoColonna = "textBox";
}
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
{
tipoColonna = "dropDownList";
}
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
{
tipoColonna = "checkBox";
}
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
{
tipoColonna = "selAjax";
}
// in base al tipo salvo negli inputparameters dell'ODS
switch (tipoColonna)
{
case "textBox":
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
break;
case "dropDownList":
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
break;
case "checkBox":
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
break;
//case "selAjax":
// e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
// break;
default:
break;
}
tipoColonna = "";
}
}
/// <summary>
/// svuoto da cache post update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// evento come nuovo...
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
#endregion
#region are public
/// <summary>
/// effettua traduzione del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// effettua traduzione in inglese del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduciEn(string lemma)
{
return user_std.UtSn.TraduciEn(lemma);
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
divEditQta.Visible = false;
mod_newPromessaODL.Visible = false;
lbtNewPODL.Visible = true;
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
#endregion
#region area da modificare
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Page.IsPostBack)
{
mod_newPromessaODL.Visible = false;
grView.PageSize = pageSize;
}
mod_newPromessaODL.eh_nuovoValore += new EventHandler(mod_newOdl1_eh_nuovoValore);
}
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "IdxODL";
}
/// <summary>
/// nuovo valore creato...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e)
{
// nascondo controllo e mostro button
mod_newPromessaODL.Visible = false;
lbtNewPODL.Visible = true;
// aggiorno!
resetSelezione();
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
MapoDb.DS_ProdTempi.ODLDataTable tabella = new MapoDb.DS_ProdTempi.ODLDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
public bool delEnabled(object _idxOdl)
{
bool answ = false;
int idxOdl = 0;
// controllo non sia già stata iniziata la produzione sennò non posso cancellare...
try
{
idxOdl = Convert.ToInt32(_idxOdl);
answ = (MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, true).Count > 0);
}
catch
{ }
return answ;
}
/// <summary>
/// mostra creazione nuovo ODL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtNewPODL_Click(object sender, EventArgs e)
{
showAddNewPODL();
}
private void showAddNewPODL()
{
// mostro controllo creazione ODL
mod_newPromessaODL.Visible = true;
divEditQta.Visible = false;
lbtNewPODL.Visible = false;
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// formatot url x stampa ODL
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public string formattaUrlOdl(object idx)
{
string answ = String.Format(memLayer.ML.CRS("exportFormat1"), Convert.ToInt32(reportRichiesto.SchedaODL), idx);
return answ;
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// elimina commento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtDel_Click(object sender, EventArgs e)
{
LinkButton imgBtn = (LinkButton)sender;
int IdxProm = 0;
int.TryParse(imgBtn.CommandArgument, out IdxProm);
DataLayer.obj.taPODL.deleteQuery(IdxProm);
doUpdate();
}
private void doUpdate()
{
grView.DataBind();
}
#endregion
protected void btnOk_Click(object sender, EventArgs e)
{
if (idxPOdlSel > 0)
{
DataLayer.obj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel);
}
updateCtrl();
}
private void updateCtrl()
{
divEditQta.Visible = false;
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// idxOdl selezionato
/// </summary>
protected int idxPOdlSel
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(grView.SelectedValue);
}
catch
{ }
return answ;
}
}
/// <summary>
/// Nuovo num pz
/// </summary>
protected int numPz
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(txtNewQta.Text.Trim());
}
catch
{ }
return answ;
}
set
{
txtNewQta.Text = value.ToString();
}
}
/// <summary>
/// Nuovo num pz per pallet
/// </summary>
protected int pzPallet
{
get
{
int answ = 1;
try
{
answ = Convert.ToInt32(txtNewPzPallet.Text.Trim());
}
catch
{ }
// controllo sia > 0...
if (answ < 1)
{
answ = 1;
}
return answ;
}
set
{
txtNewPzPallet.Text = value.ToString();
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
updateCtrl();
}
protected void chkUnassigned_CheckedChanged(object sender, EventArgs e)
{
updateGrView();
}
/// <summary>
/// Aggiorno Gridview
/// </summary>
private void updateGrView()
{
grView.DataBind();
}
/// <summary>
/// IdxMacchina filtrata
/// </summary>
protected string idxMacc
{
get
{
return lblIdxMacc.Text;
}
set
{
lblIdxMacc.Text = value;
}
}
/// <summary>
/// Nome filtrata
/// </summary>
protected string NomeMacc
{
get
{
return lblNomeMacc.Text;
}
set
{
lblNomeMacc.Text = value;
}
}
/// <summary>
/// CodArt filtrato
/// </summary>
protected string CodArt
{
get
{
return lblCodArt.Text;
}
set
{
lblCodArt.Text = value;
}
}
/// <summary>
/// CodArt filtrato
/// </summary>
protected string DescArt
{
get
{
return lblDescArt.Text;
}
set
{
lblDescArt.Text = value;
}
}
/// <summary>
/// Selezionato un condominio --> riporto selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelArt_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
string[] artData = lb.CommandArgument.Split('|');
CodArt = artData[0];
DescArt = artData[1];
updateGrView();
}
/// <summary>
/// Selezionato un condominio --> riporto selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelMacc_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
string[] maccData = lb.CommandArgument.Split('|');
idxMacc = maccData[0];
NomeMacc = maccData[1];
updateGrView();
}
protected void lbtResArt_Click(object sender, EventArgs e)
{
CodArt = "";
DescArt = "";
updateGrView();
}
protected void lbtResMacc_Click(object sender, EventArgs e)
{
idxMacc = "";
NomeMacc = "";
updateGrView();
}
}
}
+195
View File
@@ -0,0 +1,195 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_gestPromODL {
/// <summary>
/// Controllo lbtResArt.
/// </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 lbtResArt;
/// <summary>
/// Controllo lblCodArt.
/// </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 lblCodArt;
/// <summary>
/// Controllo lblDescArt.
/// </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 lblDescArt;
/// <summary>
/// Controllo lbtResMacc.
/// </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 lbtResMacc;
/// <summary>
/// Controllo lblNomeMacc.
/// </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 lblNomeMacc;
/// <summary>
/// Controllo lblIdxMacc.
/// </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 lblIdxMacc;
/// <summary>
/// Controllo chkUnassigned.
/// </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 chkUnassigned;
/// <summary>
/// Controllo lblUnass.
/// </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 lblUnass;
/// <summary>
/// Controllo lbtNewPODL.
/// </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 lbtNewPODL;
/// <summary>
/// Controllo mod_newPromessaODL.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::MoonProAdmin.WebUserControls.mod_newPromessaODL mod_newPromessaODL;
/// <summary>
/// Controllo divEditQta.
/// </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 divEditQta;
/// <summary>
/// Controllo lbtOk.
/// </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 lbtOk;
/// <summary>
/// Controllo txtNewQta.
/// </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 txtNewQta;
/// <summary>
/// Controllo txtNewPzPallet.
/// </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 txtNewPzPallet;
/// <summary>
/// Controllo lbtCancel.
/// </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 lbtCancel;
/// <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 lblNumRec.
/// </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 lblNumRec;
/// <summary>
/// Controllo lblWarning.
/// </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 lblWarning;
/// <summary>
/// Controllo txtPageSize.
/// </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 txtPageSize;
}
}
@@ -0,0 +1,127 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestioneDatiMacchine.ascx.cs"
Inherits="MoonPro_site.WebUserControls.mod_gestioneDatiMacchine" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
DataKeyNames="IdxMacchina" DataSourceID="ods">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
Visible="true" />
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
ToolTip='<%# traduci("Select") %>' ImageUrl="~/images/view_m.png" />
&nbsp;
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
Visible='<%# isWritable() %>' ToolTip='<%# traduci("Edit") %>' ImageUrl="~/images/edit_m.png" />
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl="~/images/apply_m.png" />
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl="~/images/cancel_m.png" />
</EditItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="idxMacchina" SortExpression="idxMacchina">
<ItemTemplate>
<b>
<asp:Label runat="server" ID="txtidxMacchina" Text='<%# Eval("idxMacchina") %>' /></b>
<br />
<asp:Label runat="server" ID="txtDescFull" Text='<%# Eval("DescFull") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="palletChange" SortExpression="palletChange">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkpalletChange" Checked='<%# Eval("palletChange") %>'
Enabled="false" />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox runat="server" ID="chkpalletChange" Checked='<%# Bind("palletChange") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodArticolo_A" SortExpression="CodArticolo_A">
<ItemTemplate>
<b>
<asp:Label runat="server" ID="txtArticolo_A" Text='<%# Eval("CodArticolo_A") %>' />
</b>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtArticolo_A" Text='<%# Bind("CodArticolo_A") %>' />
<asp:AutoCompleteExtender ID="txtArticolo_A_AutoCompleteExtender" runat="server" TargetControlID="txtArticolo_A"
ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoArticoli" EnableCaching="true"
MinimumPrefixLength="1" Enabled="True" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodArticolo_B" SortExpression="CodArticolo_B">
<ItemTemplate>
<b>
<asp:Label runat="server" ID="txtArticolo_B" Text='<%# Eval("CodArticolo_B") %>' />
</b>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtArticolo_B" Text='<%# Bind("CodArticolo_B") %>' />
<asp:AutoCompleteExtender ID="aceArticolo_B" runat="server" TargetControlID="txtArticolo_B"
EnableCaching="true" MinimumPrefixLength="1" ServicePath="~/WS/AutoCompletamento.asmx"
ServiceMethod="elencoArticoli" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="serialPort" SortExpression="serialPort">
<ItemTemplate>
<asp:Label runat="server" ID="txtserialPort" Text='<%# Eval("serialPort") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="refreshPeriod" SortExpression="refreshPeriod">
<ItemTemplate>
<asp:Label runat="server" ID="txtrefreshPeriod" Text='<%# Eval("refreshPeriod") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
CommandArgument='<%# Eval("idxMacchina") %>' ToolTip='<%# traduci("Delete") %>'
Visible='<%# delEnabled(Eval("idxMacchina")) %>' ImageUrl="~/images/elimina_m.png" />
<asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
TargetControlID="imgDelete"></asp:ConfirmButtonExtender>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
ToolTip='<%# traduci("Update")%>' ImageUrl="~/images/apply_m.png" />
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
ToolTip='<%# traduci("Cancel") %>' ImageUrl="~/images/cancel_m.png" />
</EditItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="MapoDb.DS_ProdTempiTableAdapters.DatiMacchineTableAdapter"
OnInserting="recuperaFooter" FilterExpression="CodArticolo_A LIKE '%{0}%' OR CodArticolo_B LIKE '%{0}%' OR serialPort LIKE '%{0}%'"
OnInserted="ods_Updated" OnUpdated="ods_Updated" OnDeleted="ods_Updated" UpdateMethod="updateQry">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<UpdateParameters>
<asp:Parameter Name="Original_idxMacchina" Type="Int32" />
<asp:Parameter Name="palletChange" Type="Boolean" />
<asp:Parameter Name="CodArticolo_A" Type="String" />
<asp:Parameter Name="CodArticolo_B" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
@@ -0,0 +1,239 @@
using SteamWare;
using System;
using System.Data;
using System.Web.UI.WebControls;
namespace MoonPro_site.WebUserControls
{
public partial class mod_gestioneDatiMacchine : System.Web.UI.UserControl
{
#region area da NON modificare
#region area protected
protected string _idxGridView;
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
}
/// <summary>
/// traduce gli header delle colonne
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_DataBound(object sender, EventArgs e)
{
if (grView.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grView.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
}
else
{
lblNumRec.Text = "";
}
}
/// <summary>
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
{
//recupero la riga footer...
DataColumnCollection colonne = colonneObj();
string nomeCol;
string tipoColonna = "";
foreach (DataColumn colonna in colonne)
{
nomeCol = colonna.ColumnName;
// cerco un textbox o quello che sia...
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
{
tipoColonna = "textBox";
}
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
{
tipoColonna = "dropDownList";
}
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
{
tipoColonna = "checkBox";
}
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
{
tipoColonna = "selAjax";
}
// in base al tipo salvo negli inputparameters dell'ODS
switch (tipoColonna)
{
case "textBox":
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
break;
case "dropDownList":
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
break;
case "checkBox":
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
break;
//case "selAjax":
// e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
// break;
default:
break;
}
tipoColonna = "";
}
}
/// <summary>
/// svuoto da cache post update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// evento come nuovo...
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
#endregion
#region are public
/// <summary>
/// effettua traduzione del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// effettua traduzione in inglese del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduciEn(string lemma)
{
return user_std.UtSn.TraduciEn(lemma);
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
public event EventHandler eh_selValore;
#endregion
#region area da modificare
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "IdxMacchina";
}
/// <summary>
/// nuovo valore creato...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e)
{
// aggiorno!
resetSelezione();
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
MapoDb.DS_ProdTempi.DatiMacchineDataTable tabella = new MapoDb.DS_ProdTempi.DatiMacchineDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
public bool delEnabled(object _idx)
{
bool answ = false;
return answ;
}
/// <summary>
/// definisce scrivibilità/editabilità del controllo
/// </summary>
/// <returns></returns>
public bool isWritable()
{
return true;
}
#endregion
}
}
@@ -0,0 +1,52 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MoonPro_site.WebUserControls
{
public partial class mod_gestioneDatiMacchine {
/// <summary>
/// grView 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.GridView grView;
/// <summary>
/// lblNumRec 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 lblNumRec;
/// <summary>
/// lblWarning 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 lblWarning;
/// <summary>
/// ods 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.ObjectDataSource ods;
}
}
+189
View File
@@ -0,0 +1,189 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestioneODL.ascx.cs"
Inherits="MoonPro_site.WebUserControls.mod_gestioneODL" %>
<%@ Register Src="mod_newOdl.ascx" TagName="mod_newOdl" TagPrefix="uc1" %>
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-sm-2">
<h4>Filtri attivi</h4>
</div>
<div class="col-sm-4 text-nowrap">
<div class="input-group my-1 input-group-sm">
<div class="input-group-prepend">
<asp:LinkButton runat="server" ID="lbtResArt" CssClass="btn btn-outline-dark" OnClick="lbtResArt_Click"><i class="fa fa-refresh"></i> <b>Articolo</b></asp:LinkButton>
<asp:Label runat="server" ID="lblCodArt" CssClass="input-group-text" />
<asp:Label runat="server" ID="lblDescArt" CssClass="input-group-text text-truncate" />
</div>
</div>
</div>
<div class="col-sm-4">
<div class="input-group my-1 input-group-sm">
<div class="input-group-prepend">
<asp:LinkButton runat="server" ID="lbtResMacc" CssClass="btn btn-outline-dark" OnClick="lbtResMacc_Click"><i class="fa fa-refresh"></i> <b>Macchina</b></asp:LinkButton>
<asp:Label runat="server" ID="lblNomeMacc" CssClass="input-group-text" />
<asp:Label runat="server" ID="lblIdxMacc" CssClass="input-group-text" />
</div>
</div>
</div>
<div class="col-sm-2">
</div>
</div>
<div class="bg-dark text-light" style="white-space: nowrap; padding: 2px;">
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<asp:LinkButton ID="lbtNewODL" runat="server" OnClick="lbtNewODL_Click" CssClass="btn btn-block btn-primary text-light"><i class="fa fa-plus"></i> Nuovo ODL <i class="fa fa-list-ol"></i></asp:LinkButton>
</div>
<div class="col-4"></div>
</div>
<uc1:mod_newOdl ID="mod_newOdl1" runat="server" />
</div>
<div id="divEditQta" runat="server" visible="false" class="ctrSelRowStyle" style="white-space: nowrap; padding: 2px;">
<div class="row">
<div class="col-sm-3">
<asp:Button runat="server" ID="btnOk" Text="Ok" Width="10em" OnClick="btnOk_Click" />
</div>
<div class="col-sm-3">
Pezzi ODL:
<asp:TextBox runat="server" ID="txtNewQta" Width="6em" />
</div>
<div class="col-sm-3">
Pezzi Pallet:
<asp:TextBox runat="server" ID="txtNewPzPallet" Width="6em" />
</div>
<div class="col-sm-3">
<asp:Button runat="server" ID="btnCancel" Text="Annulla" Width="10em" OnClick="btnCancel_Click" />
</div>
</div>
</div>
</div>
<div class="card-body">
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound" PageSize="25"
DataKeyNames="IdxODL" DataSourceID="ods" Width="100%">
<RowStyle CssClass="ctrRowStyle" />
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
<EditRowStyle CssClass="ctrEditRowStyle" />
<SelectedRowStyle CssClass="ctrSelRowStyle" />
<FooterStyle CssClass="ctrFooter" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
<EmptyDataRowStyle CssClass="ctrRowStyle" />
<EmptyDataTemplate>
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" CausesValidation="false" Visible="true" />
</HeaderTemplate>
<ItemTemplate>
<span style="padding-right: 2px;">
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Select"
ToolTip="Modifica num pz" ImageUrl="~/images/edit_s.png" Visible='<%# OdlIsCurrent(Eval("DataInizio"),Eval("DataFine")) %>' />
</span>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="ODL" SortExpression="IdxOdl">
<ItemTemplate>
<asp:Label runat="server" ID="txtIdxOdl" Text='<%# Eval("IdxOdl") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodArticolo" SortExpression="CodArticolo">
<ItemTemplate>
<div style="float: left;">
<asp:LinkButton runat="server" ID="lbtSelArt" OnClick="lbtSelArt_Click" CausesValidation="False" CommandArgument='<%# Eval("CodArticolo")+"|"+Eval("DescArticolo") %>' CssClass="btn btn-sm btn-outline-dark p-1">
<i class="fa fa-search"></i>
<b><%# Eval("CodArticolo") %></b>
</asp:LinkButton>
</div>
<div style="float: right; font-size: 0.8em;">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("CommessaAs400") %>' />
</div>
<div style="float: none; clear: both;">
<asp:Label runat="server" ID="txtDescArticolo" Text='<%# Eval("DescArticolo") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="codMacchina" SortExpression="CodMacchina">
<ItemTemplate>
<asp:LinkButton runat="server" ID="lbtSelMacc" OnClick="lbtSelMacc_Click" CausesValidation="False" CommandArgument='<%# Eval("IdxMacchina")+"|"+Eval("Nome") %>' CssClass="btn btn-sm btn-outline-dark p-1 btn-block">
<i class="fa fa-search"></i>
<b><%# Eval("Nome") %></b>
<div><%# Eval("CodMacchina") %></div>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NumPezzi" SortExpression="NumPezzi">
<ItemTemplate>
<asp:Label runat="server" ID="txtNumPezzi" Text='<%# Eval("NumPezzi") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:Label runat="server" ID="txtNumPezzi" Text='<%# Bind("NumPezzi") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TCAssegnato" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label runat="server" ID="txtTCAssegnato" Text='<%# Eval("TCAssegnato","{0:0.000}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PzPallet" SortExpression="PzPallet">
<ItemTemplate>
<asp:Label runat="server" ID="txtPzPallet" Text='<%# Eval("PzPallet") %>' />
</ItemTemplate>
<EditItemTemplate>
<%--<asp:Label runat="server" ID="txtPzPallet" Text='<%# Bind("PzPallet") %>' />--%>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataInizio" SortExpression="DataInizio">
<ItemTemplate>
<asp:Label runat="server" ID="txtDataInizio" Text='<%# Eval("DataInizio") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataFine" SortExpression="DataFine">
<ItemTemplate>
<asp:Label runat="server" ID="txtDataFine" Text='<%# Eval("DataFine") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete" OnClientClick="return confirm('Sicuro di voler procedere con eliminazione?');"
CommandArgument='<%# Eval("IdxODL") %>' ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("IdxODL")) %>'
ImageUrl="~/images/elimina_m.png" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByMacchinaArticolo" TypeName="MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter" OnInserting="recuperaFooter" FilterExpression="CodArticolo LIKE '%{0}%'" OnInserted="ods_Updated" OnUpdated="ods_Updated" DeleteMethod="DeleteQuery" OnDeleted="ods_Updated">
<FilterParameters>
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
</FilterParameters>
<DeleteParameters>
<asp:Parameter Name="Original_IdxODL" Type="Int32" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="lblCodArt" Name="CodArticolo" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="lblIdxMacc" Name="IdxMacchina" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="card-footer">
<div class="row">
<div class="col"></div>
<div class="col text-center">
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
</div>
<div class="col text-right">
mostra:
<asp:TextBox runat="server" ID="txtPageSize" Text="10" Width="2em" OnTextChanged="txtPageSize_TextChanged" />
</div>
</div>
</div>
</div>
@@ -0,0 +1,543 @@
using MapoDb;
using SteamWare;
using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonPro_site.WebUserControls
{
public partial class mod_gestioneODL : System.Web.UI.UserControl
{
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
#region area da NON modificare
#region area protected
protected string _idxGridView;
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// gestione cambio selezione valore
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
// mostro edit quantità...
divEditQta.Visible = true;
lbtNewODL.Visible = enableCreateNew;
mod_newOdl1.Visible = false;
var riga = DataLayer.obj.taODL.getByIdx(idxOdlSel, false)[0];
numPz = riga.NumPezzi;
pzPallet = riga.PzPallet;
}
/// <summary>
/// traduce gli header delle colonne
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_DataBound(object sender, EventArgs e)
{
if (grView.Rows.Count > 0)
{
LinkButton lb;
// aggiorno gli headers
foreach (TableCell cella in grView.HeaderRow.Cells)
{
try
{
lb = (LinkButton)cella.Controls[0];
lb.Text = traduci(lb.Text);
}
catch
{ }
}
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
}
else
{
lblNumRec.Text = "";
}
}
/// <summary>
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
{
//recupero la riga footer...
DataColumnCollection colonne = colonneObj();
string nomeCol;
string tipoColonna = "";
foreach (DataColumn colonna in colonne)
{
nomeCol = colonna.ColumnName;
// cerco un textbox o quello che sia...
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
{
tipoColonna = "textBox";
}
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
{
tipoColonna = "dropDownList";
}
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
{
tipoColonna = "checkBox";
}
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
{
tipoColonna = "selAjax";
}
// in base al tipo salvo negli inputparameters dell'ODS
switch (tipoColonna)
{
case "textBox":
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
break;
case "dropDownList":
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
break;
case "checkBox":
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
break;
//case "selAjax":
// e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
// break;
default:
break;
}
tipoColonna = "";
}
}
/// <summary>
/// svuoto da cache post update
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// evento come nuovo...
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
#endregion
#region are public
/// <summary>
/// effettua traduzione del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// effettua traduzione in inglese del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduciEn(string lemma)
{
return user_std.UtSn.TraduciEn(lemma);
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
divEditQta.Visible = false;
mod_newOdl1.Visible = false;
lbtNewODL.Visible = enableCreateNew;
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
}
#endregion
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
#endregion
#region area da modificare
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Page.IsPostBack)
{
mod_newOdl1.Visible = false;
grView.PageSize = pageSize;
lbtNewODL.Visible = enableCreateNew;
}
mod_newOdl1.eh_nuovoValore += new EventHandler(mod_newOdl1_eh_nuovoValore);
}
public bool enableCreateNew
{
get
{
return !memLayer.ML.CRB("enableRPO");
}
}
/// inizializzazione valori di default
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_idxGridView = "IdxODL";
}
/// <summary>
/// nuovo valore creato...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e)
{
// nascondo controllo e mostro button
mod_newOdl1.Visible = false;
lbtNewODL.Visible = enableCreateNew;
// aggiorno!
resetSelezione();
}
/// <summary>
/// elenco colonne del datagrid
/// </summary>
/// <returns></returns>
protected DataColumnCollection colonneObj()
{
MapoDb.DS_ProdTempi.ODLDataTable tabella = new MapoDb.DS_ProdTempi.ODLDataTable();
DataColumnCollection colonne = tabella.Columns;
return colonne;
}
public bool delEnabled(object _idxOdl)
{
bool answ = false;
int idxOdl = 0;
// controllo non sia già stata iniziata la produzione sennò non posso cancellare...
try
{
idxOdl = Convert.ToInt32(_idxOdl);
answ = (MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, true).Count > 0);
}
catch
{ }
return answ;
}
/// <summary>
/// mostra creazione nuovo ODL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtNewODL_Click(object sender, EventArgs e)
{
// mostro controllo creazione ODL
mod_newOdl1.Visible = true;
divEditQta.Visible = false;
lbtNewODL.Visible = false;
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// formatot url x stampa ODL
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public string formattaUrlOdl(object idx)
{
string answ = String.Format(memLayer.ML.CRS("exportFormat1"), Convert.ToInt32(reportRichiesto.SchedaODL), idx);
return answ;
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// verifica se ODL sia current = aperto (iniziato, NON concluso)
/// </summary>
/// <param name="DataInizio"></param>
/// <param name="DataFine"></param>
/// <returns></returns>
public bool OdlIsCurrent(object DataInizio, object DataFine)
{
bool answ = false;
try
{
if ((DataInizio.ToString() == "") && (DataFine.ToString() == ""))
{
answ = true;
}
}
catch
{ }
if (!answ)
{
try
{
if ((Convert.ToDateTime(DataInizio) <= DateTime.Now) && (DataFine.ToString() == ""))
{
answ = true;
}
}
catch
{ }
}
return answ;
}
#endregion
protected void btnOk_Click(object sender, EventArgs e)
{
if (idxOdlSel > 0)
{
DataLayer.obj.taODL.updateQta(numPz, pzPallet, idxOdlSel);
}
updateCtrl();
}
private void updateCtrl()
{
divEditQta.Visible = false;
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// idxOdl selezionato
/// </summary>
protected int idxOdlSel
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(grView.SelectedValue);
}
catch
{ }
return answ;
}
}
/// <summary>
/// Nuovo num pz
/// </summary>
protected int numPz
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(txtNewQta.Text.Trim());
}
catch
{ }
return answ;
}
set
{
txtNewQta.Text = value.ToString();
}
}
/// <summary>
/// Nuovo num pz per pallet
/// </summary>
protected int pzPallet
{
get
{
int answ = 1;
try
{
answ = Convert.ToInt32(txtNewPzPallet.Text.Trim());
}
catch
{ }
// controllo sia > 0...
if (answ < 1)
{
answ = 1;
}
return answ;
}
set
{
txtNewPzPallet.Text = value.ToString();
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
updateCtrl();
}
/// <summary>
/// Aggiorno Gridview
/// </summary>
private void updateGrView()
{
grView.DataBind();
}
/// <summary>
/// IdxMacchina filtrata
/// </summary>
protected string idxMacc
{
get
{
return lblIdxMacc.Text;
}
set
{
lblIdxMacc.Text = value;
}
}
/// <summary>
/// Nome filtrata
/// </summary>
protected string NomeMacc
{
get
{
return lblNomeMacc.Text;
}
set
{
lblNomeMacc.Text = value;
}
}
/// <summary>
/// CodArt filtrato
/// </summary>
protected string CodArt
{
get
{
return lblCodArt.Text;
}
set
{
lblCodArt.Text = value;
}
}
/// <summary>
/// CodArt filtrato
/// </summary>
protected string DescArt
{
get
{
return lblDescArt.Text;
}
set
{
lblDescArt.Text = value;
}
}
/// <summary>
/// Selezionato un condominio --> riporto selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelArt_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
string[] artData = lb.CommandArgument.Split('|');
CodArt = artData[0];
DescArt = artData[1];
updateGrView();
}
/// <summary>
/// Selezionato un condominio --> riporto selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelMacc_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
// imposto articolo, splittando
string[] maccData = lb.CommandArgument.Split('|');
idxMacc = maccData[0];
NomeMacc = maccData[1];
updateGrView();
}
protected void lbtResArt_Click(object sender, EventArgs e)
{
CodArt = "";
DescArt = "";
updateGrView();
}
protected void lbtResMacc_Click(object sender, EventArgs e)
{
idxMacc = "";
NomeMacc = "";
updateGrView();
}
}
}
+177
View File
@@ -0,0 +1,177 @@
//------------------------------------------------------------------------------
// <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 MoonPro_site.WebUserControls {
public partial class mod_gestioneODL {
/// <summary>
/// Controllo lbtResArt.
/// </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 lbtResArt;
/// <summary>
/// Controllo lblCodArt.
/// </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 lblCodArt;
/// <summary>
/// Controllo lblDescArt.
/// </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 lblDescArt;
/// <summary>
/// Controllo lbtResMacc.
/// </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 lbtResMacc;
/// <summary>
/// Controllo lblNomeMacc.
/// </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 lblNomeMacc;
/// <summary>
/// Controllo lblIdxMacc.
/// </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 lblIdxMacc;
/// <summary>
/// Controllo lbtNewODL.
/// </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 lbtNewODL;
/// <summary>
/// Controllo mod_newOdl1.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::MoonPro_site.WebUserControls.mod_newOdl mod_newOdl1;
/// <summary>
/// Controllo divEditQta.
/// </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 divEditQta;
/// <summary>
/// Controllo btnOk.
/// </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.Button btnOk;
/// <summary>
/// Controllo txtNewQta.
/// </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 txtNewQta;
/// <summary>
/// Controllo txtNewPzPallet.
/// </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 txtNewPzPallet;
/// <summary>
/// Controllo btnCancel.
/// </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.Button btnCancel;
/// <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 lblNumRec.
/// </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 lblNumRec;
/// <summary>
/// Controllo lblWarning.
/// </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 lblWarning;
/// <summary>
/// Controllo txtPageSize.
/// </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 txtPageSize;
}
}
+74
View File
@@ -0,0 +1,74 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" Codebehind="mod_login.ascx.cs" %>
<asp:Panel ID="pnlForceUser" runat="server">
<table width="100%">
<tr>
<td class="chPwdTitle">
<asp:Label runat="server" ID="lblTitolo" />
</td>
</tr>
</table>
<table class="smallTable">
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblPwd" />
</td>
<td>
<asp:TextBox runat="server" ID="authKey" TextMode="Password" Width="210px" />
</td>
</tr>
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblDominio" />
</td>
<td>
<asp:TextBox runat="server" ID="dominio" Width="210px" />
</td>
</tr>
<tr>
<td>
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblUser" />
</td>
<td>
<asp:TextBox runat="server" ID="user" Width="210px" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button Width="100%" runat="server" ID="btnOk" CommandName="ok" CommandArgument="ok"
OnClick="btnOk_Click"></asp:Button>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="pnlSelectUser" runat="server">
<table class="smallTable">
<tr>
<td>
<asp:DropDownList ID="ddlStdUser" runat="server">
<asp:ListItem>DOMITBREMBO\WebGTD_R</asp:ListItem>
<asp:ListItem>DOMITBREMBO\WebGTD_W</asp:ListItem>
<asp:ListItem>DOMITBREMBO\WebGTD_X</asp:ListItem>
<asp:ListItem>DOMITBREMBO\WebGTD_A</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnOkUserStd" runat="server" Width="100%"
onclick="btnOkUserStd_Click" />
</td>
</tr>
</table>
</asp:Panel>
<table class="smallTable">
<tr>
<td colspan="2">
<asp:Label CssClass="chPwdTxt" ID="lblMessage" runat="server" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:HyperLink ID="HypLinkSSO" runat="server" NavigateUrl="~/login.aspx" Text="Single-Sign-On Login"></asp:HyperLink>
</td>
</tr>
</table>
+309
View File
@@ -0,0 +1,309 @@
using SteamWare;
using System;
using System.Web.UI;
/// <summary>
/// classe gestione login e forzatura login
/// </summary>
public partial class mod_login : SteamWare.ApplicationUserControl
{
#region area protected/private
#region area proprietà
private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale;
#endregion
#region area metodi
/// <summary>
/// imposta la modalità di login tra normale / forceUser
/// </summary>
private void setLoginMode()
{
switch (_isForceUser)
{
case SteamWare.loginMode.normale:
pnlForceUser.Visible = false;
pnlSelectUser.Visible = false;
break;
case SteamWare.loginMode.forceUser:
pnlForceUser.Visible = true;
pnlSelectUser.Visible = false;
break;
case SteamWare.loginMode.standardUser:
pnlForceUser.Visible = false;
pnlSelectUser.Visible = true;
break;
default:
break;
}
}
protected override void traduciObj()
{
lblPwd.Text = user_std.UtSn.Traduci("lblPwd");
lblUser.Text = user_std.UtSn.Traduci("lblUser");
lblDominio.Text = user_std.UtSn.Traduci("lblDominio");
lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente");
btnOk.Text = user_std.UtSn.Traduci("btnCommit");
btnOkUserStd.Text = user_std.UtSn.Traduci("btnCommit");
}
/// <summary>
/// prova a verificare se l'utente sia ok x AD credentials
/// </summary>
private void AdLogin()
{
lblMessage.Text = "User not authenticated...";
if (Page.User.Identity.IsAuthenticated)
{
//recupera user windows se c'è...
string ad_name = Page.User.Identity.Name;
string delimStr = "\\";
char[] delimiter = delimStr.ToCharArray();
string[] dom_user = ad_name.Split(delimiter, 2);
// passo al controllo di verifica ADuserOk...
user_std _utente = new user_std();
if (_utente.ADuserOk(dom_user[0], dom_user[1]))
{
bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]);
if (fatto)
{
SteamWare.logger.lg.scriviLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD), SteamWare.tipoLog.INFO);
if (Login_ok != null)
{
Login_ok(this, new EventArgs());
}
}
else
{
lblMessage.Text = String.Format("{0}<br>There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = String.Format("{0}<br>user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
SteamWare.logger.lg.scriviLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth");
SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
/// <summary>
/// effettua verifiche e se concesso permette di forzare l'accesso utente
/// </summary>
private void ForceUserIdentity()
{
if (Page.User.Identity.IsAuthenticated)
{
bool _allowForceUser = false;
try
{
_allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser");
}
catch
{
_allowForceUser = false;
}
if (_allowForceUser)
{
if (authKey.Text == "forzaInter") // verifica passphrase...
{
user_std _utente = new user_std();
user_std.UtSn.isForcedUser = true;
bool fatto = _utente.startUpUtente(dominio.Text, user.Text);
if (fatto)
{
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
if (Login_ok != null)
{
Login_ok(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = String.Format("{0}<br>key not allowed for operation!! operation logged!!", user_std.UtSn.Traduci("AccessFail"));
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = string.Format("{0}<br>user not authenticated!<br>", user_std.UtSn.Traduci("AccessFail"));
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
}
}
/// <summary>
/// se concesso il generico ForceUser permette di forzare l'accesso utente ad uno degli standard
/// </summary>
private void StdUserIdentity()
{
if (Page.User.Identity.IsAuthenticated)
{
bool _allowForceUser = false;
try
{
_allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser");
}
catch
{
_allowForceUser = false;
}
if (_allowForceUser)
{
//leggo e codifico utente indicato
string delimStr = "\\";
char[] delimiter = delimStr.ToCharArray();
string[] dom_user = ddlStdUser.SelectedValue.Split(delimiter, 2);
//forzo login!
user_std _utente = new user_std();
user_std.UtSn.isForcedUser = true;
bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]);
if (fatto)
{
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dom_user[0], dom_user[1]);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
if (Login_ok != null)
{
Login_ok(this, new EventArgs());
}
}
}
else
{
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
}
}
else
{
lblMessage.Text = string.Format("{0}<br>user not authenticated!<br>", user_std.UtSn.Traduci("AccessFail"));
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
}
string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
}
}
/// <summary>
/// fa login con force user e controllo pwd
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
ForceUserIdentity();
}
/// <summary>
/// fa login utente tipo standard
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOkUserStd_Click(object sender, EventArgs e)
{
StdUserIdentity();
}
#endregion
#endregion
#region area public
#region eventi pubblici esposti
public event EventHandler Login_ok;
public event EventHandler Login_Error;
#endregion
#region area proprietà
/// <summary>
/// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser
/// </summary>
public SteamWare.loginMode modoLogin
{
get
{
return _isForceUser;
}
set
{
_isForceUser = value;
}
}
#endregion
/// <summary>
/// avvio pagina
/// </summary>
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
//carico da web.config i default values
loadDefaultsWebConfig();
// procedo...
setLoginMode();
Session.RemoveAll();
if (_isForceUser == SteamWare.loginMode.normale)
{
AdLogin();
}
}
#endregion
}
+140
View File
@@ -0,0 +1,140 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class mod_login {
/// <summary>
/// pnlForceUser 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.Panel pnlForceUser;
/// <summary>
/// lblTitolo 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 lblTitolo;
/// <summary>
/// lblPwd 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 lblPwd;
/// <summary>
/// authKey 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.TextBox authKey;
/// <summary>
/// lblDominio 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 lblDominio;
/// <summary>
/// dominio 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.TextBox dominio;
/// <summary>
/// lblUser 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 lblUser;
/// <summary>
/// user 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.TextBox user;
/// <summary>
/// btnOk 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.Button btnOk;
/// <summary>
/// pnlSelectUser 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.Panel pnlSelectUser;
/// <summary>
/// ddlStdUser 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.DropDownList ddlStdUser;
/// <summary>
/// btnOkUserStd 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.Button btnOkUserStd;
/// <summary>
/// lblMessage 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 lblMessage;
/// <summary>
/// HypLinkSSO 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.HyperLink HypLinkSSO;
}
+67
View File
@@ -0,0 +1,67 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_main_help" CodeBehind="mod_main_help.ascx.cs" %>
<div class="row">
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtAnagArticoli" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnAnagArticoli_Click">
<div><i class="fa fa-tasks fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnAnagArticoli") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestPromesseOdl" CssClass="btn btn-outline-primary btn-block py-3" OnClick="btnGestPromesseOdl_Click">
<div><i class="fa fa-list-ol fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestPromesseOdl") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestOdl" CssClass="btn btn-outline-success btn-block py-3" OnClick="btnGestOdl_Click">
<div><i class="fa fa-wrench fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestOdl") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestDatiMacchina" CssClass="btn btn-outline-secondary btn-block py-3" OnClick="btnGestDatiMacchina_Click">
<div><i class="fa fa-industry fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestDatiMacchina") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaTC" CssClass="btn btn-outline-warning btn-block py-3" OnClick="btnApprovaTC_Click"> <div><i class="fa fa-clock-o fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnApprovaTC") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaProd" CssClass="btn btn-outline-danger btn-block py-3" OnClick="btnApprovaProd_Click">
<div><i class="fa fa-thumbs-up fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnApprovaProd") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtBCode" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnBCode_Click">
<div><i class="fa fa-barcode fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnBCode") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestKIT" CssClass="btn btn-outline-info btn-block py-3" OnClick="lbtGestKIT_Click">
<div><i class="fa fa-object-group fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestKIT") %>
</div>
</asp:LinkButton>
</div>
</div>
@@ -0,0 +1,48 @@
using SteamWare;
using System;
public partial class mod_main_help : ApplicationUserControl
{
protected override void Page_Load(object sender, EventArgs e)
{
}
protected void btnGestPromesseOdl_Click(object sender, EventArgs e)
{
Response.Redirect("~/gestPromesseODL");
}
protected void btnGestOdl_Click(object sender, EventArgs e)
{
Response.Redirect("~/gestioneODL");
}
protected void btnAnagArticoli_Click(object sender, EventArgs e)
{
Response.Redirect("~/anagArticoli");
}
protected void btnGestDatiMacchina_Click(object sender, EventArgs e)
{
Response.Redirect("~/gestioneDatiMacchine");
}
protected void btnApprovaTC_Click(object sender, EventArgs e)
{
Response.Redirect("~/approvazioneODL");
}
protected void btnApprovaProd_Click(object sender, EventArgs e)
{
Response.Redirect("~/approvazioneProd");
}
protected void btnBCode_Click(object sender, EventArgs e)
{
Response.Redirect("~/BCode");
}
protected void lbtGestKIT_Click(object sender, EventArgs e)
{
Response.Redirect("~/GestKIT");
}
}
+85
View File
@@ -0,0 +1,85 @@
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
public partial class mod_main_help {
/// <summary>
/// Controllo lbtAnagArticoli.
/// </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 lbtAnagArticoli;
/// <summary>
/// Controllo lbtGestPromesseOdl.
/// </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 lbtGestPromesseOdl;
/// <summary>
/// Controllo lbtGestOdl.
/// </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 lbtGestOdl;
/// <summary>
/// Controllo lbtGestDatiMacchina.
/// </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 lbtGestDatiMacchina;
/// <summary>
/// Controllo lbtApprovaTC.
/// </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 lbtApprovaTC;
/// <summary>
/// Controllo lbtApprovaProd.
/// </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 lbtApprovaProd;
/// <summary>
/// Controllo lbtBCode.
/// </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 lbtBCode;
/// <summary>
/// Controllo lbtGestKIT.
/// </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 lbtGestKIT;
}
@@ -0,0 +1,33 @@
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="mod_menuBottom" CodeBehind="mod_menuBottom.ascx.cs" %>
<div class="navbar navbar-dark bg-dark text-light fixed-bottom p-0" role="navigation">
<div class="container-fluid">
<div class="row w-100 mx-0 px-0">
<div class="col-6 navbar-text text-left m-0 py-1">
<%--margin da togliere in prod!--%>
<asp:Label ID="lblrev" runat="server"></asp:Label>
<asp:Label runat="server" ID="lblApp" Text="." />
<asp:Label runat="server" ID="lblCopyRight" Text="..." />
</div>
<div class="col-6 navbar-text text-right m-0 py-1">
<div class="d-flex flex-row-reverse">
<div class="px-1 text-right">Powered by <a href="http://www.steamware.net" target="_blank">
<img src="Images/LogoSteamware.png" alt="Steamware" height="18" /></a>
</div>
<div class="px-1 text-right">
<asp:UpdateProgress ID="updtRicerca" runat="server" DisplayAfter="5" DynamicLayout="true">
<ProgressTemplate>
<div id="progress_back">
</div>
<div id="progress_top">
<i class="fa fa-cog fa-spin fa"></i>&nbsp;<i class="fa fa-cog fa-spin fa"></i>&nbsp;<i class="fa fa-cog fa-spin fa"></i>&nbsp;
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,21 @@
using System;
using System.Configuration;
using System.Diagnostics;
using System.Web.UI;
public partial class mod_menuBottom : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// sistemo le stringhe...
//lblApp.Text = string.Format("<b>{0}</b> v.{1}.{2}", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"), ConfigurationManager.AppSettings.Get("minRev"));
var versionInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
lblCopyRight.Text = string.Format("<b>{0}</b>", versionInfo.LegalCopyright);
lblApp.Text = string.Format("{0} v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
}
}
}
+49
View File
@@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
public partial class mod_menuBottom {
/// <summary>
/// Controllo lblrev.
/// </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 lblrev;
/// <summary>
/// Controllo lblApp.
/// </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 lblApp;
/// <summary>
/// Controllo lblCopyRight.
/// </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 lblCopyRight;
/// <summary>
/// Controllo updtRicerca.
/// </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.UpdateProgress updtRicerca;
}
+16
View File
@@ -0,0 +1,16 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_menuSx" Codebehind="mod_menuSx.ascx.cs" %>
<asp:Panel ID="pnlTree" runat="server" HorizontalAlign="Left" CssClass="pnlMenuSx" >
<asp:TreeView ID="tvMenuSx" runat="server" ImageSet="Simple" NodeIndent="10" DataSourceID="XmlDataSource1">
<DataBindings>
<asp:TreeNodeBinding DataMember="menu" TextField="title" NavigateUrlField="url" ToolTipField="description" />
<asp:TreeNodeBinding DataMember="voce" TextField="title" NavigateUrlField="url" ToolTipField="description" />
</DataBindings>
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#DD5555" />
<SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px"
ForeColor="#DD5555" />
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="0px"
NodeSpacing="0px" VerticalPadding="0px" />
</asp:TreeView>
</asp:Panel>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" EnableCaching="false"></asp:XmlDataSource>
+35
View File
@@ -0,0 +1,35 @@
using SteamWare;
using System.Web.UI;
public partial class mod_menuSx : ApplicationUserControl
{
protected override void aggiornaControlliDataGL()
{
// se l'utente c'è...
if (user_std.UtSn.isAuth && !Page.IsPostBack)
{
updateTreeMenu();
}
}
/// <summary>
/// aggiornamento del menù
/// </summary>
private void updateTreeMenu()
{
XmlDataSource1.Data = user_std.UtSn.mappaSito;
//user_std.UtSn.ricaricaMappaSito();
//XmlDataSource1.Data = user_std.UtSn.mappaSitoLive;
XmlDataSource1.XPath = "mainMenu/menu";
XmlDataSource1.DataBind();
}
/// <summary>
/// forza l'update del menù sx
/// </summary>
public void forzaUpdateMenu()
{
user_std.UtSn.ricaricaMappaSito();
updateTreeMenu();
}
}
+41
View File
@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class mod_menuSx {
/// <summary>
/// pnlTree 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.Panel pnlTree;
/// <summary>
/// tvMenuSx 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.TreeView tvMenuSx;
/// <summary>
/// XmlDataSource1 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.XmlDataSource XmlDataSource1;
}
+51
View File
@@ -0,0 +1,51 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="MoonPro_site.WebUserControls.mod_menuTop"
CodeBehind="mod_menuTop.ascx.cs" %>
<%-- Gestione resize --%>
<asp:HiddenField runat="server" ID="HiddenHeight" OnValueChanged="HiddenHeight_ValueChanged" />
<asp:HiddenField runat="server" ID="HiddenWidth" OnValueChanged="HiddenWidth_ValueChanged" />
<nav class="navbar navbar-expand fixed-top navbar-dark bg-black text-light titleBlock p-0">
<div style="width: 100%;">
<div class="row topTitle p-1">
<div class="col-3 text-left">
<div class="d-flex justify-content-start pl-3 text-left">
<asp:LinkButton ID="btnUpdate" runat="server" CssClass="btn btn-sm btn-outline-info" OnClick="btnUpdate_Click"></asp:LinkButton>
<asp:LinkButton ID="btnLogOut" runat="server" CssClass="dxButtonClass" Visible="False"
OnClick="btnLogOut_Click"></asp:LinkButton>
<span class="mx-2 dateTimeSmall">
<%: DateTime.Now.ToString("yyyy.MM.dd") %><br />
<%: DateTime.Now.ToString("HH.mm.ss") %>
<asp:Label runat="server" ID="lastUpdate" CssClass="dateTimeSmall"></asp:Label>
</span>
<asp:UpdateProgress ID="updtPage" runat="server" DisplayAfter="10" DynamicLayout="true">
<ProgressTemplate>
<div id="progress_back">
</div>
<div id="progress_top">
<i class="fa fa-cog fa-spin"></i> <i class="fa fa-cog fa-spin"></i> <i class="fa fa-cog fa-spin"></i>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</div>
<div class="col-6 text-center">
<asp:Image ID="Image1" runat="server" src="Images/LogoMapoNoText.png" CssClass="img-fluid" Height="1.5em" />
<asp:HyperLink runat="server" is="hlHome" CssClass="btn btn-outline-info" NavigateUrl="~/menu"><i class="fa fa-home" aria-hidden="true"></i> MAPO ADMIN - Menu generale </asp:HyperLink>
<asp:Image ID="Image2" runat="server" src="Images/LogoMapoNoText.png" CssClass="img-fluid" Height="1.5em" />
</div>
<div class="col-3 text-right">
<asp:HyperLink runat="server" ID="hlGuida" NavigateUrl="~/help/index.html" Target="_blank" Style="text-decoration: none; color: White; font-size: small;" Visible="false" >
<asp:Image ID="imgHelp" ImageUrl="~/images/Help.png" runat="server" ToolTip="Guida" Height="32px" />
</asp:HyperLink>
&nbsp;
<asp:HyperLink runat ="server" ID="hlSteamware" CssClass="btn btn-sm btn-outline-info" Target="_blank" NavigateUrl="https://www.steamware.net/MAPO">
Steamware - sito</asp:HyperLink>
</div>
</div>
</div>
</nav>
<div class="mb-3">&nbsp;</div>
+181
View File
@@ -0,0 +1,181 @@
using SteamWare;
using System;
using System.Collections.Generic;
using System.Web.UI;
namespace MoonPro_site.WebUserControls
{
public partial class mod_menuTop : System.Web.UI.UserControl
{
private string _titleString;
#region gestione eventi
public event EventHandler eh_toggleMenuSx;
public event EventHandler eh_reqUpdateMenu;
#endregion
protected void Page_Load(object sender, EventArgs e)
{
btnLogOut.Visible = user_std.UtSn.isForcedUser;
if (memLayer.ML.isInSessionObject("doUpdateNow"))
{
doFullDataUpdate();
memLayer.ML.emptySessionVal("doUpdateNow");
}
}
protected void btnLogOut_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("forceUser.aspx");
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
doFullDataUpdate();
updateWindowSize();
}
private void doFullDataUpdate()
{
// salvo i dati attuali...
string cod_cdc = SteamWare.memLayer.ML.StringSessionObj("valRicercaCdC");
string lingua = user_std.UtSn.lingua;
string USER_NAME = SteamWare.memLayer.ML.StringSessionObj("USER_NAME");
string DOMINIO = SteamWare.memLayer.ML.StringSessionObj("DOMINIO");
bool isForceUser = user_std.UtSn.isForcedUser;
// salvo i valori delle tab in session...
Dictionary<string, string> sessionParam = SteamWare.memLayer.ML.valSess2SurvUpd;
// svuoto session e cache per rileggere i dati da Db
Session.RemoveAll();
SteamWare.memLayer.ML.flushRegisteredCache();
// rimemorizzo
SteamWare.memLayer.ML.setSessionVal("valRicercaCdC", cod_cdc);
user_std.UtSn.startUpUtente(DOMINIO, USER_NAME);
user_std.UtSn.lingua = lingua;
user_std.UtSn.isForcedUser = isForceUser;
DataWrap.DW.resetVocabolario();
// risalvo in session i valori...
foreach (KeyValuePair<string, string> kvp in sessionParam)
{
SteamWare.memLayer.ML.setSessionVal(kvp.Key, kvp.Value, true);
}
// cambio visibilità del menù laterale...
if (eh_reqUpdateMenu != null)
{
eh_reqUpdateMenu(this, new EventArgs());
}
Response.Redirect(Page.Request.Url.ToString());
}
protected void bindControlli()
{
if (!Page.IsPostBack)
{
//lnkHelp.ToolTip = traduci("ApriManualeHelp");
// solo se user è auth...
if (user_std.UtSn.isAuth)
{
//lnkShowHide.Text = user_std.UtSn.Traduci("lnkShowHide");
//lblTitle.Text = user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("titleApp"));
if (_titleString != "")
{
//// traduzione di tutti i termini
//lblMessUtente.Text = user_std.UtSn.Traduci(_titleString);
////doppio in english!
//lblMessUtenteEn.Text = "(" + user_std.UtSn.TraduciEn(_titleString) + ")";
_titleString = "";
Session["_titleString"] = _titleString;
Session["SessionUpdateMenu"] = true;
}
else
{
//string titolo = user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("welcomeApp"));
//lblMessUtente.Text = string.Format("{0} - {1}", titolo, memLayer.ML.CRS("SiteName"));
//lblMessUtenteEn.Text = "";
Session["SessionUpdateMenu"] = false;
}
btnLogOut.Text = user_std.UtSn.Traduci("LogOut");
btnUpdate.Text = user_std.UtSn.Traduci("Update");
//lblUser.Text = String.Format("{0}: {1}", user_std.UtSn.Traduci("User"), user_std.UtSn.CognomeNome);
setTimer();
setClock();
}
}
}
/// <summary>
/// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
/// </summary>
private void setTimer()
{
}
protected void lnkShowHide_Click(object sender, EventArgs e)
{
// cambio visibilità del menù laterale...
if (eh_toggleMenuSx != null)
{
eh_toggleMenuSx(this, new EventArgs());
}
}
protected void Timer1_Tick(object sender, EventArgs e)
{
setClock();
}
private void setClock()
{
//lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
}
protected void lblUser_Click(object sender, EventArgs e)
{
Response.Redirect("./chLang.aspx");
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
btnUpdate.Text = "Update";
updateWindowSize();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
}
private void updateWindowSize()
{
if (HiddenHeight.Value != "")
{
memLayer.ML.setSessionVal("WindowHeight", HiddenHeight.Value, true);
}
if (HiddenWidth.Value != "")
{
memLayer.ML.setSessionVal("WindowWidth", HiddenWidth.Value);
}
}
protected void HiddenHeight_ValueChanged(object sender, EventArgs e)
{
updateWindowSize();
}
protected void HiddenWidth_ValueChanged(object sender, EventArgs e)
{
updateWindowSize();
}
}
}
+114
View File
@@ -0,0 +1,114 @@
//------------------------------------------------------------------------------
// <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 MoonPro_site.WebUserControls {
public partial class mod_menuTop {
/// <summary>
/// Controllo HiddenHeight.
/// </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.HiddenField HiddenHeight;
/// <summary>
/// Controllo HiddenWidth.
/// </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.HiddenField HiddenWidth;
/// <summary>
/// Controllo btnUpdate.
/// </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 btnUpdate;
/// <summary>
/// Controllo btnLogOut.
/// </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 btnLogOut;
/// <summary>
/// Controllo lastUpdate.
/// </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 lastUpdate;
/// <summary>
/// Controllo updtPage.
/// </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.UpdateProgress updtPage;
/// <summary>
/// Controllo Image1.
/// </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.Image Image1;
/// <summary>
/// Controllo Image2.
/// </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.Image Image2;
/// <summary>
/// Controllo hlGuida.
/// </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.HyperLink hlGuida;
/// <summary>
/// Controllo imgHelp.
/// </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.Image imgHelp;
/// <summary>
/// Controllo hlSteamware.
/// </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.HyperLink hlSteamware;
}
}
@@ -0,0 +1,24 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_menuTopCompact.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_menuTopCompact" %>
<div class="row text-uppercase align-items-center w-100 mx-0 px-0">
<div class="col-4 col-md-3 my-2 text-left">
<asp:HyperLink runat="server" ID="hlTask" NavigateUrl="~/task" CssClass="btn btn-block btn-primary text-truncate"> <i class="fas fa-tasks"></i> Commesse</asp:HyperLink>
</div>
<div class="col-4 col-md-6 my-0 text-center">
<asp:HyperLink runat="server" ID="hlBarcode" NavigateUrl="~/barcode" CssClass="btn btn-block btn-light text-truncate"> <asp:Label ID="lblTitolo" runat="server" Text="" CssClass="font-weight-bold" />
</asp:HyperLink>
</div>
<div class="col-4 col-md-3 my-2 text-right">
<asp:HyperLink runat="server" ID="hlPostazioni" NavigateUrl="~/postazioni" CssClass="btn btn-block btn-primary text-truncate"> <i class="fas fa-industry"></i> Postazioni</asp:HyperLink>
</div>
</div>
<div class="row text-uppercase align-items-center w-100 mx-0 px-0">
<div class="col-4 text-left text-truncate text-warning">
<%: NomeOpr %>
</div>
<div class="col-4 text-center text-truncate text-info">
<%: CurrNumTask %>
</div>
<div class="col-4 text-right text-truncate text-warning">
<%: DescPost %>
</div>
</div>
@@ -0,0 +1,140 @@
using SteamWare;
using System;
using System.Linq;
using System.Web.UI;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_menuTopCompact : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
string lastPage = Request.Url.LocalPath.Split('/').Last();
if (!Page.IsPostBack)
{
// fix visibilità TASK
hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart");
// se l'utente NON c'è torno a login...
if (!devicesAuthProxy.stObj.isAuth)
{
if (lastPage != "" && lastPage != "login")
{
Session["nextPage"] = lastPage;
}
// SE non sono in "safe page"
if (memLayer.ML.CRS("_loginPages").IndexOf(lastPage) < 0)
{
Response.Redirect("login");
}
}
else
{
PagCorrente();
}
}
// controllo pagina...
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage);
// controllo pag auth...
if (!pageAuth)
{
Response.Redirect("~/login");
}
lblTitolo.Text = memLayer.ML.CRS("appName");
}
/// <summary>
/// salva in variabile pagina il nome della pagina corrente
/// </summary>
protected void PagCorrente()
{
string[] uri = Request.Url.LocalPath.Split('/');
// salvo pagina corrente
devicesAuthProxy.pagCorrente = uri.Last();
if (devicesAuthProxy.pagPrecedente == "")
{
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string CodPost
{
get
{
return memLayer.ML.StringSessionObj("CodPost");
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string CodOpr
{
get
{
return memLayer.ML.StringSessionObj("CodOpr");
}
}
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string DescPost
{
get
{
string answ = "";
#if false
if (memLayer.ML.isInSessionObject("DescPost"))
{
answ = memLayer.ML.StringSessionObj("DescPost");
}
if (answ == "")
{
var tabPost = dataLayer.man.taAP.getByKey(CodPost);
if (tabPost.Rows.Count > 0)
{
answ = tabPost[0].Descrizione;
}
memLayer.ML.setSessionVal("DescPost", answ);
}
#endif
return answ;
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string NomeOpr
{
get
{
string answ = "";
#if false
if (memLayer.ML.isInSessionObject("NomeOpr"))
{
answ = memLayer.ML.StringSessionObj("NomeOpr");
}
if (answ == "")
{
var tabOpr = dataLayer.man.taAO.getByKey(CodOpr);
if (tabOpr.Rows.Count > 0)
{
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
}
memLayer.ML.setSessionVal("NomeOpr", answ);
}
#endif
return answ;
}
}
}
}
@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_menuTopCompact {
/// <summary>
/// Controllo hlTask.
/// </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.HyperLink hlTask;
/// <summary>
/// Controllo hlBarcode.
/// </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.HyperLink hlBarcode;
/// <summary>
/// Controllo lblTitolo.
/// </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 lblTitolo;
/// <summary>
/// Controllo hlPostazioni.
/// </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.HyperLink hlPostazioni;
}
}
+131
View File
@@ -0,0 +1,131 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_newOdl.ascx.cs"
Inherits="MoonPro_site.WebUserControls.mod_newOdl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<div style="font-size: 0.8em; background-color: #EFEFEF;">
<div style="float: none; clear: both;">
<div style="float: left; border: 1px solid #ABABAB; padding: 2px; margin: 1px; height: 4em;">
Articolo<br />
<asp:DropDownList ID="ddlArticolo" runat="server" DataTextField="label" DataValueField="value"
AutoCompleteMode="SuggestAppend" DropDownStyle="DropDownList" AutoPostBack="True"
DataSourceID="odsArticoli" CssClass="WindowsStyle" MaxLength="0" Style="display: inline;" OnSelectedIndexChanged="ddlArticolo_SelectedIndexChanged" Font-Size="0.9em" />
<asp:ObjectDataSource ID="odsArticoli" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.v_selArticoliTableAdapter"></asp:ObjectDataSource>
</div>
<div style="float: left; border: 1px solid #ABABAB; padding: 2px; margin: 1px; height: 4em;">
Macchina<br />
<asp:DropDownList ID="ddlMacchine" runat="server" DataTextField="label" DataValueField="value"
AutoCompleteMode="SuggestAppend" DropDownStyle="DropDownList" AutoPostBack="True"
DataSourceID="odsMacchine" CssClass="WindowsStyle" MaxLength="0" Style="display: inline;" OnSelectedIndexChanged="ddlMacchine_SelectedIndexChanged" Font-Size="0.9em" />
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.v_selMacchineTableAdapter"></asp:ObjectDataSource>
</div>
<div style="float: left; border: 1px solid #ABABAB; padding: 2px; margin: 1px; height: 4em;">
Pezzi<br />
<asp:TextBox ID="txtPezzi" runat="server" Width="4em" />
<asp:RequiredFieldValidator ID="rfvPezzi" ControlToValidate="txtPezzi" runat="server"
ErrorMessage="!!!" />
</div>
<div style="float: left; border: 1px solid #ABABAB; padding: 2px; margin: 1px; height: 4em;">
Scarico As400<br />
<asp:CheckBox runat="server" ID="chkToAs400" Checked="true" ToolTip="Abilita scarico su AS400" />
</div>
<div style="float: left; border: 1px solid #ABABAB; padding: 2px; margin: 1px; height: 4em;">
Tempo Ciclo min.cent<br />
<asp:TextBox ID="txtTempoCiclo" runat="server" Width="4em"
OnTextChanged="txtTempoCiclo_TextChanged" AutoPostBack="True" />
( =
<asp:Label runat="server" ID="lblMinSec" />
min:sec)
<asp:RequiredFieldValidator ID="rfvTempoCiclo" ControlToValidate="txtTempoCiclo"
runat="server" ErrorMessage="!!!" />
</div>
<div style="float: left; border: 1px solid #ABABAB; padding: 2px; margin: 1px; height: 4em;">
Pezzi Pallet<br />
<asp:TextBox ID="txtPzPallet" runat="server" Width="4em" />
<asp:RequiredFieldValidator ID="rfvPzPallet" ControlToValidate="txtPzPallet" runat="server"
ErrorMessage="!!!" />
</div>
<div style="float: left; border: 1px solid #ABABAB; padding: 2px; margin: 1px; height: 4em;">
Commessa As400<br />
<asp:TextBox ID="txtCommessa" runat="server" Width="10em" />
</div>
</div>
<div style="float: none; text-align: center; margin: auto; clear: both; margin: 2px; padding: 2px;">
<span style="padding: 0px 50px;">
<asp:Button ID="btnOk" runat="server" Text="Ok" OnClick="btnOk_Click" Width="120px" />
</span>
<span style="padding: 0px 50px;">
<asp:Button ID="btnCancel" runat="server" Text="Annulla" OnClick="btnCancel_Click" CausesValidation="false" Width="120px" />
</span>
</div>
<div runat="server" id="divTempi" style="clear: both;">
<asp:GridView ID="grViewTempi" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="IdxODL" DataSourceID="odsTempi" ForeColor="Black" GridLines="None" OnSelectedIndexChanged="grViewTempi_SelectedIndexChanged" Width="100%">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
<EmptyDataRowStyle BackColor="Tan" Font-Bold="True" />
<EmptyDataTemplate>
Nessun record storico trovato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False">
<HeaderTemplate>
<asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click"><i class="fa fa-refresh fa-2x"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Selezione"><i class="fa fa-arrow-circle-right fa-2x"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
<asp:BoundField DataField="CodArticolo" HeaderText="CodArticolo" SortExpression="CodArticolo" />
<asp:BoundField DataField="CodMacchina" HeaderText="CodMacchina" SortExpression="CodMacchina" />
<asp:BoundField DataField="IdxMacchina" HeaderText="IdxMacchina" SortExpression="IdxMacchina" />
<asp:BoundField DataField="DescArticolo" HeaderText="DescArticolo" SortExpression="DescArticolo" />--%>
<asp:BoundField DataField="CommessaAs400" HeaderText="CommessaAs400" SortExpression="CommessaAs400" />
<asp:BoundField DataField="IdxODL" HeaderText="IdxODL" InsertVisible="False" ReadOnly="True" SortExpression="IdxODL" />
<asp:BoundField DataField="NumPezzi" HeaderText="NumPezzi" SortExpression="NumPezzi" />
<asp:TemplateField HeaderText="TCAssegnato" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("TCAssegnato", "{0:N2}") %>' />
<div style="color: #696969; font-size: 0.7em;">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("TCRichAttr", "{0:N2} (attr.)") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PzPallet" HeaderText="PzPallet" SortExpression="PzPallet" />
<asp:TemplateField HeaderText="Note" SortExpression="Note">
<ItemTemplate>
<asp:Label ID="lblNote" runat="server" Text='<%# Eval("Note") %>' />
<div style="color: #696969; font-size: 0.7em;">
<asp:Label ID="lblCodArticolo" runat="server" Text='<%# Eval("CodArticolo","({0})") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />--%>
<asp:TemplateField HeaderText="DataInizio" SortExpression="DataInizio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("DataInizio","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataFine" SortExpression="DataFine" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("DataFine","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsTempi" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByMacchinaArticolo" TypeName="MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="ddlMacchine" DefaultValue="0" Name="IdxMacchina" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ddlArticolo" DefaultValue="0" Name="CodArticolo" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
+158
View File
@@ -0,0 +1,158 @@
using SteamWare;
using System;
namespace MoonPro_site.WebUserControls
{
public partial class mod_newOdl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
#region gestione eventi
public event EventHandler eh_nuovoValore;
#endregion
/// <summary>
/// conferma inserimento TC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
// controllo se ho tutti i valori ok...
string CodArticolo = "";
string IdxMacchina = "";
int numPezzi = 0;
int pzPallet = 1;
decimal TCiclo = 0;
try
{
CodArticolo = ddlArticolo.SelectedValue;
IdxMacchina = ddlMacchine.SelectedValue;
//IdxMacchina = txtMacchina.Text.Trim();
// se IdxMacchina è vuoto metto null...
if (IdxMacchina == "")
{
IdxMacchina = "0";
}
numPezzi = Convert.ToInt32(txtPezzi.Text.Trim());
TCiclo = Convert.ToDecimal(txtTempoCiclo.Text.Trim().Replace(".", ","));
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
MapoDb.DataLayer.obj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
}
catch
{
logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire l'ODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4}", CodArticolo, IdxMacchina, numPezzi, TCiclo, pzPallet), tipoLog.ERROR);
}
// segnalo update
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// annullamento inserimento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// aggiorno label min e centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempoCiclo_TextChanged(object sender, EventArgs e)
{
string text = "";
string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ",");
int min = 0;
int sec = 0;
try
{
// cerco di convertire in min/sec
min = Convert.ToInt32(Math.Floor(Convert.ToDouble(txtMinCent)));
sec = Convert.ToInt32((Convert.ToDouble(txtMinCent) - min) * 60);
text = string.Format("{0}:{1:00}", min, sec);
}
catch
{ }
lblMinSec.Text = text;
}
/// <summary>
/// selezione articolo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// mostro elenco ultimi 5 tempi e note...
/// </summary>
private void showLastTimeAndNote()
{
// update tempi ciclo!
grViewTempi.DataBind();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grViewTempi.SelectedIndex = -1;
grViewTempi.DataBind();
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grViewTempi.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
// precompilo dati pezzi/tempi
txtPezzi.Text = rigaOdl.NumPezzi.ToString();
txtTempoCiclo.Text = rigaOdl.TCAssegnato.ToString("0.00");
txtPzPallet.Text = rigaOdl.PzPallet.ToString();
}
}
}
+178
View File
@@ -0,0 +1,178 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MoonPro_site.WebUserControls
{
public partial class mod_newOdl {
/// <summary>
/// ddlArticolo 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.DropDownList ddlArticolo;
/// <summary>
/// odsArticoli 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.ObjectDataSource odsArticoli;
/// <summary>
/// ddlMacchine 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.DropDownList ddlMacchine;
/// <summary>
/// odsMacchine 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.ObjectDataSource odsMacchine;
/// <summary>
/// txtPezzi 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.TextBox txtPezzi;
/// <summary>
/// rfvPezzi 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.RequiredFieldValidator rfvPezzi;
/// <summary>
/// chkToAs400 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.CheckBox chkToAs400;
/// <summary>
/// txtTempoCiclo 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.TextBox txtTempoCiclo;
/// <summary>
/// lblMinSec 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 lblMinSec;
/// <summary>
/// rfvTempoCiclo 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.RequiredFieldValidator rfvTempoCiclo;
/// <summary>
/// txtPzPallet 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.TextBox txtPzPallet;
/// <summary>
/// rfvPzPallet 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.RequiredFieldValidator rfvPzPallet;
/// <summary>
/// txtCommessa 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.TextBox txtCommessa;
/// <summary>
/// btnOk 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.Button btnOk;
/// <summary>
/// btnCancel 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.Button btnCancel;
/// <summary>
/// divTempi control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTempi;
/// <summary>
/// grViewTempi 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.GridView grViewTempi;
/// <summary>
/// odsTempi 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.ObjectDataSource odsTempi;
}
}
@@ -0,0 +1,193 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_newPromessaODL.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_newPromessaODL" %>
<div class="row my-2 textCondens font-weight-bold">
<div class="col-4 pr-0">
<div class="text-truncate">
Articolo (ricerca + selezione)
</div>
<div class="my-0 small">
<div class="input-group mb-3">
<div class="input-group-prepend">
<asp:TextBox runat="server" ID="txtSearch" CssClass="form form-control form-control-sm" AutoPostBack="True" OnTextChanged="txtSearch_TextChanged" placeholder="Ricerca" Width="5em" />
</div>
<asp:DropDownList runat="server" ID="ddlArticolo" DataSourceID="odsArticoli" DataTextField="label" DataValueField="value" CssClass="form-control form-control-sm" OnSelectedIndexChanged="ddlArticolo_SelectedIndexChanged"></asp:DropDownList>
<asp:ObjectDataSource ID="odsArticoli" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="MapoDb.DS_UtilityTableAdapters.v_selArticoliTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" DefaultValue="Non definito" Name="conditio" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Gruppo
</div>
<div class="my-0 small">
<asp:DropDownList ID="ddlGruppi" runat="server" DataTextField="label" DataValueField="value" AutoPostBack="True" DataSourceID="odsGruppi" CssClass="form-control form-control-sm" OnSelectedIndexChanged="ddlGruppi_SelectedIndexChanged"/>
<asp:ObjectDataSource ID="odsGruppi" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="MapoDb.DS_UtilityTableAdapters.v_selGruppiTableAdapter">
<SelectParameters>
<asp:Parameter DefaultValue="FASE" Name="conditio" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Macchina
</div>
<div class="my-0 small">
<asp:DropDownList ID="ddlMacchine" runat="server" DataTextField="label" DataValueField="value" AutoPostBack="True" DataSourceID="odsMacchine" CssClass="form-control form-control-sm" OnSelectedIndexChanged="ddlMacchine_SelectedIndexChanged"/>
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="getByConditio" TypeName="MapoDb.DS_UtilityTableAdapters.v_selMacchineTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="ddlGruppi" DefaultValue="0" Name="conditio" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Num Pz
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtNumPz" CssClass="form form-control form-control-sm text-right" TextMode="Number" />
</div>
</div>
<div class="col-2 pl-0" runat="server" id="divTCms">
<div class="text-truncate">
T.Ciclo min:sec
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtTCms" CssClass="form form-control form-control-sm text-right" />
</div>
</div>
<div class="col-2 pl-0" runat="server" id="divTCmc">
<div class="text-truncate">
T.Ciclo min.cent
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtTCmc" CssClass="form form-control form-control-sm text-right" />
</div>
</div>
</div>
<div class="row my-2 textCondens">
<div class="col-2 pr-0">
<div class="text-truncate">
Commessa / Ordine Ext
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtKeyExt" CssClass="form form-control text-right" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Priorita
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtPrio" CssClass="form form-control text-right" TextMode="Number" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
Attivabile
</div>
<div class="my-0">
<asp:CheckBox runat="server" ID="chkAttiv" Checked="true" CssClass="form form-check-input text-right" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
PzPallet
</div>
<div class="my-0">
<asp:TextBox runat="server" ID="txtPzPallet" CssClass="form form-control text-right" TextMode="Number" />
</div>
</div>
<div class="col-2 pr-0 pl-1">
<div class="text-truncate">
&nbsp;
</div>
<div class="my-0">
<asp:LinkButton ID="lbtOk" runat="server" Text="Ok" OnClick="btnOk_Click" CssClass="btn btn-block btn-success" OnClientClick="return confirm('Sicuro di voler creare la Promessa ODL?');" ><i class="fa fa-plus"></i> <%: testoConf %></asp:LinkButton>
</div>
</div>
<div class="col-2 pl-1">
<div class="text-truncate">
&nbsp;
</div>
<div class="my-0">
<asp:LinkButton ID="lbtCancel" runat="server" Text="Annulla" OnClick="btnCancel_Click" CssClass="btn btn-block btn-warning"><i class="fa fa-ban"></i> Annulla</asp:LinkButton>
</div>
</div>
</div>
<div style="font-size: 0.8em; background-color: #EFEFEF;">
<div runat="server" id="divTempi" style="clear: both;">
<asp:GridView ID="grViewTempi" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="IdxODL" DataSourceID="odsTempi" ForeColor="Black" GridLines="None" OnSelectedIndexChanged="grViewTempi_SelectedIndexChanged" Width="100%">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
<EmptyDataRowStyle BackColor="Tan" Font-Bold="True" />
<EmptyDataTemplate>
Nessun record storico trovato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False">
<HeaderTemplate>
<asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click"><i class="fa fa-refresh fa-2x"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Selezione"><i class="fa fa-arrow-circle-right fa-2x"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CommessaAs400" HeaderText="CommessaAs400" SortExpression="CommessaAs400" />
<asp:BoundField DataField="IdxODL" HeaderText="IdxODL" InsertVisible="False" ReadOnly="True" SortExpression="IdxODL" />
<asp:BoundField DataField="NumPezzi" HeaderText="NumPezzi" SortExpression="NumPezzi" />
<asp:TemplateField HeaderText="TCAssegnato" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("TCAssegnato", "{0:N2}") %>' />
<div style="color: #696969; font-size: 0.7em;">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("TCRichAttr", "{0:N2} (attr.)") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="PzPallet" HeaderText="PzPallet" SortExpression="PzPallet" />
<asp:TemplateField HeaderText="Note" SortExpression="Note">
<ItemTemplate>
<asp:Label ID="lblNote" runat="server" Text='<%# Eval("Note") %>' />
<div style="color: #696969; font-size: 0.7em;">
<asp:Label ID="lblCodArticolo" runat="server" Text='<%# Eval("CodArticolo","({0})") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataInizio" SortExpression="DataInizio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("DataInizio","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DataFine" SortExpression="DataFine" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("DataFine","{0:dd/MM/yyyy}</br>{0:HH:mm}") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsTempi" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByMacchinaArticolo" TypeName="MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="ddlMacchine" DefaultValue="0" Name="IdxMacchina" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ddlArticolo" DefaultValue="0" Name="CodArticolo" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
@@ -0,0 +1,303 @@
using MapoDb;
using SteamWare;
using System;
using System.Web.UI;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_newPromessaODL : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
setDefaults();
}
}
/// <summary>
/// Testo conferma salvataggio (create/Edit)
/// </summary>
public string testoConf
{
get
{
string answ = "Crea Promessa ODL";
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
answ = "Edit Promessa ODL";
}
return answ;
}
}
public void doSelPODL()
{
// se ho una promessa da clonare copio dati da quella...
int idxProm = 0;
if (memLayer.ML.isInSessionObject("idxProm2Clone"))
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Clone");
}
else if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
}
// provo a selezionare
var tPODL = DataLayer.obj.taPODL.getByKey(idxProm);
if (tPODL.Rows.Count > 0)
{
var rPODL = tPODL[0];
txtSearch.Text = rPODL.CodArticolo;
ddlArticolo.DataBind();
ddlGruppi.DataBind();
ddlGruppi.SelectedValue = rPODL.CodGruppo;
txtNumPz.Text = rPODL.NumPezzi.ToString();
txtPzPallet.Text = rPODL.PzPallet.ToString();
txtPrio.Text = rPODL.Priorita.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rPODL.TCAssegnato);
}
else
{
txtTCmc.Text = rPODL.TCAssegnato.ToString("N3");
}
ddlMacchine.SelectedValue = rPODL.IdxMacchina;
txtKeyExt.Text = rPODL.KeyRichiesta;
// svuoto se ci fosse cloning......
memLayer.ML.emptySessionVal("idxProm2Clone");
}
}
private void setDefaults()
{
// se abilitato in config inserisce i valori defaults x insert...
if (memLayer.ML.cdvb("resetDefaultPromessaOdl"))
{
txtNumPz.Text = "1";
txtPzPallet.Text = "1";
txtPrio.Text = "1";
// in base ad impostazione mostro TC come min:sec o min.cent
divTCms.Visible = false;
divTCmc.Visible = false;
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
divTCms.Visible = true;
txtTCms.Text = "1:00";
}
else
{
divTCmc.Visible = true;
txtTCmc.Text = "1.00";
}
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
}
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
ddlArticolo.DataBind();
}
#region gestione eventi
public event EventHandler eh_nuovoValore;
#endregion
/// <summary>
/// conferma inserimento TC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
// controllo se ho tutti i valori ok...
string CodArticolo = "";
string Gruppo = "";
string IdxMacchina = "";
string KeyReq = "";
int numPezzi = 0;
int pzPallet = 1;
decimal TCiclo = 0;
bool attiv = false;
int prio = 0;
try
{
CodArticolo = ddlArticolo.SelectedValue;
Gruppo = ddlGruppi.SelectedValue;
IdxMacchina = ddlMacchine.SelectedValue;
KeyReq = txtKeyExt.Text.Trim();
//IdxMacchina = txtMacchina.Text.Trim();
// se IdxMacchina è vuoto metto null...
if (IdxMacchina == "")
{
IdxMacchina = "0";
}
numPezzi = Convert.ToInt32(txtNumPz.Text.Trim());
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
string[] sTC = txtTCms.Text.Trim().Split(':');
int numMin = 0;
int numSec = 0;
int.TryParse(sTC[0], out numMin);
int.TryParse(sTC[1], out numSec);
TCiclo = numMin + ((decimal)numSec) / 60;
}
else
{
decimal.TryParse(txtTCmc.Text.Replace(".", ","), out TCiclo);
}
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
attiv = chkAttiv.Checked;
int.TryParse(txtPrio.Text, out prio);
// controllo se sono in modalità EDIT faccio un update, altrimenti faccio un INSERT...
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
int idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
DataLayer.obj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm);
memLayer.ML.emptySessionVal("idxProm2Edit");
}
else
{
// 2018.09.25 --> inserisco PROMESSA ODL
//MapoDb.DataLayer.obj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
DataLayer.obj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet);
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire la PromessaODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8}{9}{10}", KeyReq, attiv, CodArticolo, IdxMacchina, numPezzi, TCiclo, prio, pzPallet, memLayer.ML.IntSessionObj("idxProm2Edit"), Environment.NewLine, exc), tipoLog.EXCEPTION);
memLayer.ML.emptySessionVal("idxProm2Edit");
}
// segnalo update
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// annullamento inserimento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// aggiorno label min e centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempoCiclo_TextChanged(object sender, EventArgs e)
{
#if false
string text = "";
string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ",");
int min = 0;
int sec = 0;
try
{
// cerco di convertire in min/sec
min = Convert.ToInt32(Math.Floor(Convert.ToDouble(txtMinCent)));
sec = Convert.ToInt32((Convert.ToDouble(txtMinCent) - min) * 60);
text = string.Format("{0}:{1:00}", min, sec);
}
catch
{ }
lblMinSec.Text = text;
#endif
}
/// <summary>
/// selezione articolo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// mostro elenco ultimi 5 tempi e note...
/// </summary>
private void showLastTimeAndNote()
{
// update tempi ciclo!
grViewTempi.DataBind();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlGruppi_SelectedIndexChanged(object sender, EventArgs e)
{
ddlMacchine.DataBind();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grViewTempi.SelectedIndex = -1;
grViewTempi.DataBind();
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grViewTempi.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
// precompilo dati pezzi/tempi
txtNumPz.Text = rigaOdl.NumPezzi.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rigaOdl.TCAssegnato);
}
else
{
txtTCmc.Text = rigaOdl.TCAssegnato.ToString("N3");
}
txtPzPallet.Text = rigaOdl.PzPallet.ToString();
}
}
}
+204
View File
@@ -0,0 +1,204 @@
//------------------------------------------------------------------------------
// <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 MoonProAdmin.WebUserControls {
public partial class mod_newPromessaODL {
/// <summary>
/// Controllo txtSearch.
/// </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 txtSearch;
/// <summary>
/// Controllo ddlArticolo.
/// </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.DropDownList ddlArticolo;
/// <summary>
/// Controllo odsArticoli.
/// </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 odsArticoli;
/// <summary>
/// Controllo ddlGruppi.
/// </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.DropDownList ddlGruppi;
/// <summary>
/// Controllo odsGruppi.
/// </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 odsGruppi;
/// <summary>
/// Controllo ddlMacchine.
/// </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.DropDownList ddlMacchine;
/// <summary>
/// Controllo odsMacchine.
/// </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 odsMacchine;
/// <summary>
/// Controllo txtNumPz.
/// </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 txtNumPz;
/// <summary>
/// Controllo divTCms.
/// </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 divTCms;
/// <summary>
/// Controllo txtTCms.
/// </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 txtTCms;
/// <summary>
/// Controllo divTCmc.
/// </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 divTCmc;
/// <summary>
/// Controllo txtTCmc.
/// </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 txtTCmc;
/// <summary>
/// Controllo txtKeyExt.
/// </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 txtKeyExt;
/// <summary>
/// Controllo txtPrio.
/// </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 txtPrio;
/// <summary>
/// Controllo chkAttiv.
/// </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 chkAttiv;
/// <summary>
/// Controllo txtPzPallet.
/// </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 txtPzPallet;
/// <summary>
/// Controllo lbtOk.
/// </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 lbtOk;
/// <summary>
/// Controllo lbtCancel.
/// </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 lbtCancel;
/// <summary>
/// Controllo divTempi.
/// </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 divTempi;
/// <summary>
/// Controllo grViewTempi.
/// </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 grViewTempi;
/// <summary>
/// Controllo odsTempi.
/// </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 odsTempi;
}
}
@@ -0,0 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="mod_pageTitleAndSearch" CodeBehind="mod_pageTitleAndSearch.ascx.cs" %>
<h3>
<asp:Label ID="lblTitolo" runat="server" />
</h3>
@@ -0,0 +1,27 @@
using SteamWare;
using System;
public partial class mod_pageTitleAndSearch : ApplicationUserControl
{
#region area protected
protected string _titolo;
protected override void traduciObj()
{
try
{
DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}.aspx' OR URL = '{0}'", _paginaCorrente))[0];
_titolo = riga.NOME;
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in decodifica titolo:{0}{1}", Environment.NewLine, exc));
_titolo = _paginaCorrente;
}
lblTitolo.Text = traduci(_titolo);
}
#endregion
}
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
public partial class mod_pageTitleAndSearch {
/// <summary>
/// Controllo lblTitolo.
/// </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 lblTitolo;
}
@@ -0,0 +1,5 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_ricercaGenerica" CodeBehind="mod_ricercaGenerica.ascx.cs" %>
<div class="boxRicerca">
<asp:TextBox ID="txtCerca" runat="server" OnTextChanged="txtCerca_TextChanged" Width="200px" />
<asp:Button ID="btnCerca" runat="server" OnClick="btnCerca_Click" Text="..." />
</div>
@@ -0,0 +1,174 @@
using SteamWare;
using System;
using System.Web.UI;
public partial class mod_ricercaGenerica : ApplicationUserControl
{
#region gestione eventi
public event EventHandler eh_nuovaRicerca;
#endregion
# region area protected
#region area ricerche dettaglio specifiche
protected bool _cercaMatricole = false;
protected bool _cercaUsername = false;
//protected bool _cercaManufacturer = false;
//protected bool _cercaCategorie = false;
protected bool _cercaModelli = false;
protected bool _cercaMag = false;
#endregion
protected override void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
updateText();
btnCerca.Text = traduci("lblCerca");
}
/// <summary>
/// cambiato valore in ricerca
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtCerca_TextChanged(object sender, EventArgs e)
{
salvaCerca();
}
/// <summary>
/// pressione del button di ricerca
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCerca_Click(object sender, EventArgs e)
{
salvaCerca();
}
/// <summary>
/// testo ricerca trimmato da spazi
/// </summary>
protected string testoRicerca
{
get
{
return txtCerca.Text.Trim();
}
set
{
txtCerca.Text = value;
}
}
protected void salvaCerca()
{
if (testoRicerca == "")
{
SteamWare.memLayer.ML.emptySessionVal("valoreCercato");
SteamWare.memLayer.ML.emptySessionVal("listaMatricoleSearch");
}
else
{
SteamWare.memLayer.ML.setSessionVal("valoreCercato", testoRicerca);
// verifico ricerche accessorie
if (_cercaMatricole)
{
salvaCercaMatricole();
}
if (_cercaUsername)
{
salvaCercaUsername();
}
// raise dell'evento
if (eh_nuovaRicerca != null)
{
eh_nuovaRicerca(this, new EventArgs());
}
}
}
/// <summary>
/// ricerca utenti e salva lista matricole x SQL IN
/// </summary>
protected void salvaCercaMatricole()
{
// salvo anche l'elenco delle matricole compatibili...
DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca);
string listaMatricoleSearch = "";
foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti)
{
listaMatricoleSearch += string.Format("'{0}', ", riga.MATRICOLA);
}
if (listaMatricoleSearch.Length > 0)
{
listaMatricoleSearch = listaMatricoleSearch.Remove(listaMatricoleSearch.Length - 2);
}
SteamWare.memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch);
}
/// <summary>
/// ricerca utenti e salva lista username x SQL IN
/// </summary>
protected void salvaCercaUsername()
{
// salvo anche l'elenco delle matricole compatibili...
DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca);
string listaUsernameSearch = "";
foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti)
{
listaUsernameSearch += string.Format("'{0}', ", riga.USER_NAME);
}
if (listaUsernameSearch.Length > 0)
{
listaUsernameSearch = listaUsernameSearch.Remove(listaUsernameSearch.Length - 2);
}
SteamWare.memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch);
}
#endregion
#region area public
/// <summary>
/// aggiorna il testo cercato
/// </summary>
public void updateText()
{
if (SteamWare.memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack)
{
testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercato");
}
}
/// <summary>
/// indica se generare da stringa search un elenco delle matricole corrispondenti
/// </summary>
public bool cercaMatricole
{
get
{
return _cercaMatricole;
}
set
{
_cercaMatricole = value;
}
}
/// <summary>
/// indica se generare da stringa search un elenco di username corrispondenti
/// </summary>
public bool cercaUsername
{
get
{
return _cercaUsername;
}
set
{
_cercaUsername = value;
}
}
#endregion
}
@@ -0,0 +1,32 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class mod_ricercaGenerica {
/// <summary>
/// txtCerca 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.TextBox txtCerca;
/// <summary>
/// btnCerca 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.Button btnCerca;
}
+101
View File
@@ -0,0 +1,101 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_storicoTC.ascx.cs" Inherits="MoonProAdmin.WebUserControls.mod_storicoTC" %>
<div style="text-align: center; margin: auto; vertical-align: middle; min-width: 800px; width: 100%; background: #DCDCDC;">
<div>
<div style="width: 50%; min-width: 350px; float: left; text-align: center; margin: auto; vertical-align: middle;">
Articolo
<br />
<asp:DropDownList ID="ddlArticolo" runat="server" DataTextField="label" DataValueField="value"
AutoCompleteMode="SuggestAppend" DropDownStyle="DropDownList" AutoPostBack="True"
DataSourceID="odsArticoli" CssClass="WindowsStyle" MaxLength="0" Style="display: inline;" OnSelectedIndexChanged="ddlArticolo_SelectedIndexChanged" />
<asp:ObjectDataSource ID="odsArticoli" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.v_selArticoliTableAdapter"></asp:ObjectDataSource>
</div>
<div style="width: 50%; min-width: 350px; float: right; text-align: center; margin: auto; vertical-align: middle;">
Impianto
<br />
<asp:DropDownList ID="ddlMacchine" runat="server" DataTextField="label" DataValueField="value"
AutoCompleteMode="SuggestAppend" DropDownStyle="DropDownList" AutoPostBack="True"
DataSourceID="odsMacchine" CssClass="WindowsStyle" MaxLength="0" Style="display: inline;" OnSelectedIndexChanged="ddlMacchine_SelectedIndexChanged" />
<asp:ObjectDataSource ID="odsMacchine" runat="server" OldValuesParameterFormatString="Original_{0}"
SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.v_selMacchineTableAdapter"></asp:ObjectDataSource>
</div>
</div>
<div style="text-align: center; margin: auto; vertical-align: middle;">
<asp:GridView ID="grViewTempi" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="IdxODL" DataSourceID="odsTempi" ForeColor="Black" GridLines="None" Width="100%">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
<EmptyDataRowStyle BackColor="Tan" Font-Bold="True" />
<EmptyDataTemplate>
Nessun record storico trovato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="Articolo" SortExpression="CodArticolo">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("CodArticolo") %>' />
<div style="color: #696969; font-size: 0.75em;">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("DescArticolo") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="IdxODL" HeaderText="IdxODL" InsertVisible="False" ReadOnly="True" SortExpression="IdxODL" />--%>
<asp:BoundField DataField="CommessaAs400" HeaderText="CommessaAs400" SortExpression="CommessaAs400" />
<asp:TemplateField HeaderText="TCiclo" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("TCAssegnato", "{0:N2}") %>' />
<div style="color: #696969; font-size: 0.85em;">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("TCRichAttr", "{0:N2} (attr.)") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Note" SortExpression="Note">
<ItemTemplate>
<div style="font-size: 0.75em;">
<asp:Label ID="Label7" runat="server" Text='<%# Eval("Note") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Periodo" SortExpression="DataInizio" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<div style="color: #696969; font-size: 0.75em; white-space: nowrap;">
<asp:Label ID="Label2" runat="server" Text='<%# Eval("DataInizio","{0:dd/MM/yy HH:mm}...") %>' />
<br />
<asp:Label ID="Label3" runat="server" Text='<%# Eval("DataFine","...{0:dd/MM/yy HH:mm}") %>' />
</div>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impianto" SortExpression="Nome">
<ItemTemplate>
<div style="white-space: nowrap; font-size: 0.9em;">
<asp:Label ID="Label6" runat="server" Text='<%# Eval("Nome") %>' />
<div style="color: #696969; font-size: 0.9em;">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("NumPezzi", "{0:N0} pz") %>' />
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsTempi" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByMacchinaArticolo" TypeName="MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="ddlMacchine" DefaultValue="0" Name="IdxMacchina" PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ddlArticolo" DefaultValue="0" Name="CodArticolo" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div style="text-align: center; margin: auto; vertical-align: middle; padding: 4px 2px; height: 1.5em;">
<div style="float: right;">
mostra:
<asp:TextBox runat="server" ID="txtPageSize" Text="10" Width="2em" OnTextChanged="txtPageSize_TextChanged" />
</div>
</div>
</div>
@@ -0,0 +1,65 @@
using System;
using System.Web.UI;
namespace MoonProAdmin.WebUserControls
{
public partial class mod_storicoTC : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// seleziono valori "0"
ddlArticolo.SelectedIndex = 0;
ddlMacchine.SelectedIndex = 0;
grViewTempi.PageSize = pageSize;
}
}
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
updateElenco();
}
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
updateElenco();
}
/// <summary>
/// effettua update elenco tempi per articolo/impianto
/// </summary>
private void updateElenco()
{
// carico update!
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grViewTempi.PageSize = pageSize;
}
}
}
+79
View File
@@ -0,0 +1,79 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MoonProAdmin.WebUserControls
{
public partial class mod_storicoTC {
/// <summary>
/// ddlArticolo 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.DropDownList ddlArticolo;
/// <summary>
/// odsArticoli 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.ObjectDataSource odsArticoli;
/// <summary>
/// ddlMacchine 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.DropDownList ddlMacchine;
/// <summary>
/// odsMacchine 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.ObjectDataSource odsMacchine;
/// <summary>
/// grViewTempi 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.GridView grViewTempi;
/// <summary>
/// odsTempi 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.ObjectDataSource odsTempi;
/// <summary>
/// txtPageSize 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.TextBox txtPageSize;
}
}
@@ -0,0 +1,16 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="MoonPro_site.WebUserControls.mod_unauthorized" Codebehind="mod_unauthorized.ascx.cs" %>
<table id="Table7" cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td class="UnauthAppTitle">
<asp:Label runat="server" ID="lblTitleMain" Text="MoonPro" />
</td>
</tr>
<tr>
<td>
<asp:Label id="lblTitle" CssClass="UnauthTitle" runat="server" /></td>
</tr>
<tr>
<td>
<asp:Label id="lblMess" CssClass="UnauthMess" runat="server" /></td>
</tr>
</table>
@@ -0,0 +1,14 @@
using SteamWare;
using System;
namespace MoonPro_site.WebUserControls
{
public partial class mod_unauthorized : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
lblTitle.Text = user_std.UtSn.Traduci("NonDisponibile");
lblMess.Text = user_std.UtSn.Traduci("NonAuth");
}
}
}
+44
View File
@@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MoonPro_site.WebUserControls
{
public partial class mod_unauthorized {
/// <summary>
/// lblTitleMain 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 lblTitleMain;
/// <summary>
/// lblTitle 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 lblTitle;
/// <summary>
/// lblMess 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 lblMess;
}
}