Aggiunto progetto tablet con relativa solution...

This commit is contained in:
Samuele E. Locatelli
2016-11-14 11:10:03 +01:00
parent 9b530d8b67
commit 04bf56389a
574 changed files with 148022 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_ODL.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_ODL" %>
<%@ Register Src="~/WebUserControls/mod_tempoMSMC.ascx" TagPrefix="uc1" TagName="mod_tempoMSMC" %>
<% if (false)
{ %>
<link href="../Style.css" rel="stylesheet" type="text/css" />
<% } %>
<div class="clearDiv" style="background-color: transparent;">
<h1>Attrezzaggio</h1>
<div class="ui-grid-a">
<div class="ui-block-a" data-role="content">
<asp:DropDownList runat="server" ID="ddlODL" DataSourceID="odsODL" DataTextField="label" DataValueField="value" OnSelectedIndexChanged="ddlODL_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsODL" OldValuesParameterFormatString="original_{0}" SelectMethod="getUnused" TypeName="MapoDb.DS_UtilityTableAdapters.v_selODLTableAdapter"></asp:ObjectDataSource>
<div runat="server" id="divNote" visible="false">
<asp:TextBox runat="server" ID="txtNote" TextMode="MultiLine" Height="4em" placeholder="Note attrezzaggio" />
</div>
</div>
<div class="ui-block-b" data-role="content">
<asp:Button runat="server" ID="btnStartAttr" Text="INIZIO Attrezzaggio" data-role="button" data-iconpos="bottom" data-icon="check"
data-theme="b" OnClick="btnStartAttr_Click" />
<div runat="server" id="divTempo" visible="false">
<uc1:mod_tempoMSMC runat="server" ID="mod_tempoMSMC" modoControllo="selettori" modoTempo="MS" />
</div>
</div>
</div>
<div class="ui-grid-a" data-role="content">
<div class="ui-block-a" data-role="content">
<asp:Button runat="server" ID="btnStartProd" Text="FINE Attrezzaggio / INIZIO Produzione" data-role="button" data-iconpos="bottom" data-icon="check"
data-theme="e" OnClick="btnStartProd_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaInizioProd") %>' />
</div>
<div class="ui-block-b" data-role="content">
<asp:Button runat="server" ID="btnEndProd" Text="FINE Produzione" data-role="button" data-iconpos="bottom" data-icon="delete"
data-theme="b" OnClick="btnEndProd_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaFineProd") %>' />
</div>
</div>
<div class="ui-grid-a" data-role="content">
<div class="ui-block-a" data-role="content">
<asp:Button runat="server" ID="btnShowSplitODL" Text="Mostra Riattrezzaggio" data-role="button" data-iconpos="bottom" data-icon="alert"
data-theme="c" OnClick="btnShowSplitODL_Click" />
</div>
<div class="ui-block-b" data-role="content">
<asp:CheckBox runat="server" ID="chkCloseOdl" Checked="false" Text="Chiudi ODL inevaso" data-theme="e" />
<asp:Button runat="server" ID="btnSplitODL" Text="Effettua Riattrezzaggio" data-role="button" data-iconpos="bottom" data-icon="alert"
data-theme="c" OnClick="btnSplitODL_Click" Visible="false" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaRiattrezzaggio") %>' />
</div>
</div>
</div>
<div class="ui-grid-solo" data-role="content" data-theme="a">
<asp:Label runat="server" ID="lblOut" ForeColor="Red" />
</div>
+447
View File
@@ -0,0 +1,447 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapoDb;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_ODL : System.Web.UI.UserControl
{
/// <summary>
/// classe MapoDB x uso locale
/// </summary>
protected MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
/// <summary>
/// Determina se sia abilitato il controllo x editing
/// </summary>
public bool isEnabled
{
get
{
return memLayer.ML.BoolSessionObj(string.Format("OdlEnab_{0}", idxMacchina));
}
set
{
memLayer.ML.setSessionVal(string.Format("OdlEnab_{0}", idxMacchina), value);
}
}
/// <summary>
/// idx macchina selezionata
/// </summary>
public int idxMacchina
{
get
{
return memLayer.ML.IntSessionObj("IdxMacchina");
}
set
{
memLayer.ML.setSessionVal("IdxMacchina", value);
}
}
/// <summary>
/// codice odl selezionato
/// </summary>
public int idxODLSel
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(ddlODL.SelectedValue);
}
catch
{ }
return answ;
}
}
/// <summary>
/// avvio pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
checkBtnStatus();
if (!Page.IsPostBack)
{
lblOut.Text = "";
}
}
/// <summary>
/// controlla stato bottoni abilitato
/// </summary>
private void checkBtnStatus()
{
// di default rendo abilitato / disabilitato tutto in base al valore "isEnabled"
btnShowSplitODL.Enabled = isEnabled;
btnSplitODL.Enabled = isEnabled;
chkCloseOdl.Enabled = isEnabled;
// controllo se la macchina è in attrezzaggio...
DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina.ToString())[0];
// condizioni booleane
bool inAttr = (rigaStato.IdxStato == 2);
bool currHasOdl = false;
try
{
currHasOdl = DataLayer.obj.taMSE.getByIdxMacchina(idxMacchina.ToString())[0].idxODL != 0;
}
catch
{ }
bool hasNewOdl = DataLayer.obj.taSelOdlFree.getUnused().Rows.Count > 1;
// sistemo buttons!
btnStartAttr.Enabled = (isEnabled && (!inAttr && hasNewOdl));
btnStartProd.Enabled = (isEnabled && inAttr);
btnEndProd.Enabled = (isEnabled && (!inAttr && currHasOdl));
ddlODL.Enabled = (isEnabled && (!inAttr && hasNewOdl));
odsODL.DataBind();
// sistemo show tempo/note attrezzaggio..
if (inAttr)
{
showNoteTC(true);
// sistemo SOLO se non si trtta di un postback...
if (!Page.IsPostBack)
{
int idxOdl = DataLayer.obj.taMSE.getByIdxMacchina(idxMacchina.ToString())[0].idxODL;
try
{
updateTempoTc(idxOdl);
updateNoteTC(idxOdl);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in recupero dati ODL! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
}
}
}
/// <summary>
/// processa evento richiesto
/// </summary>
/// <param name="idxEvento"></param>
/// <param name="userMsg"></param>
/// <param name="idxODL"></param>
private void processaEvento(int idxEvento, string userMsg, int idxODL)
{
DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina.ToString())[0];
// ricavo codice articolo + kanban...
string CodArticolo = DataLayer.obj.taODL.getByIdx(idxODL, false)[0].CodArticolo;
string MatrKanban = DataLayer.obj.taKanban.getByCodArt(CodArticolo)[0].MatricolaKanban;
// processo evento...
MapoDb.inputComando inCmd = controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), idxEvento, MatrKanban, "", rigaStato.MatrOpr, rigaStato.pallet);
if (inCmd.needStatusRefresh)
{
// chiamo refresh MSE
DataLayer.obj.taMSE.getByRefreshData(memLayer.ML.confReadInt("refrMSE_0"));
}
lblOut.Text = userMsg;
checkBtnStatus();
}
/// <summary>
/// valore decimal del TC richiesto...
/// </summary>
protected decimal TCRichAttr
{
get
{
decimal answ = 0;
try
{
answ = mod_tempoMSMC.tempoMC;
}
catch
{ }
return answ;
}
set
{
mod_tempoMSMC.tempoMC = value;
}
}
/// <summary>
/// valore decimal del TC ASSEGNATO...
/// </summary>
protected decimal TCAssegnato(int idxODL)
{
decimal answ = 0;
// leggo idxOdl da ultimo odl attivo x macchina
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxODL, false)[0];
answ = rigaOdl.TCAssegnato;
return answ;
}
/// <summary>
/// dichiara inizio attrezzaggio ODL indicato..
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnStartAttr_Click(object sender, EventArgs e)
{
confermaProdOdl(false);
if (idxODLSel > 0)
{
// se vedesse TCRich a zero lo reimposta a quello assegnato...
if (TCRichAttr == 0)
{
TCRichAttr = TCAssegnato(idxODLSel);
}
// splitto VECCHIO ODL (se è rimasto qualcosa da produrre e se ce ne è rimasto uno.......)
int idxODL = 0;
try
{
idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
DataLayer.obj.taODL.splitODL(idxODL, idxMacchina.ToString(), TCAssegnato(idxODL), string.Format("Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
}
catch
{ }
// avvio NUOVO ODL
DataLayer.obj.taODL.inizioSetup(idxODLSel, idxMacchina.ToString(), TCRichAttr, txtNote.Text);
int idxEvento = 2; // !!!HARD CODED
processaEvento(idxEvento, String.Format("Registrata inizio attrezzaggio per ODL {0}", idxODLSel), idxODLSel);
// ricarico...
Response.Redirect("~/ODL.aspx");
}
else
{
lblOut.Text = "Selezionare un ODL valido!";
}
}
/// <summary>
/// inizio prod
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnStartProd_Click(object sender, EventArgs e)
{
confermaProdOdl(true);
// se vedesse TCRich a zero lo reimposta a quello assegnato...
if (TCRichAttr == 0)
{
TCRichAttr = TCAssegnato(idxODLSel);
}
// leggo idxOdl da ultimo odl attivo x macchina
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
int idxEvento = 1; // !!!HARD CODED
// aggiorno (se necessario) note e tempo setup
DataLayer.obj.taODL.updateSetup(idxODL, TCRichAttr, txtNote.Text);
// controllo se TC Assegnato != TCRichiesto allora invio email x verifiche...
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxODL, false)[0];
if (rigaOdl.TCAssegnato != TCRichAttr)
{
// invio email!
DataLayer.obj.sendWarnTcChangeReq(memLayer.ML.confReadString("_adminEmail"));
}
// processo chiusura setup
processaEvento(idxEvento, String.Format("Registrata inizio produzione per ODL {0}", idxODL), idxODL);
// nascondo note!
showNoteTC(false);
}
/// <summary>
/// fine prod
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEndProd_Click(object sender, EventArgs e)
{
// leggo idxOdl da ultimo odl attivo x macchina
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
int idxEvento = 7; // !!!HARD CODED
// confermo prod vecchio ODL
confermaProdOdl(false);
// se chk flaggato ovvero richiesta di chiudere ODL procedo come prima (chiudendo ODL senza averne altri...)
if (chkCloseOdl.Checked)
{
// aggiungo try/catch x capire se sia qui che si "impasta" in chiusura ODL
try
{
// processo
DataLayer.obj.taODL.fineProd(idxODL, idxMacchina.ToString());
processaEvento(idxEvento, String.Format("Registrata fine produzione per ODL {0}", idxODL), idxODL);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in operazione chiusura ODL! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Response.Redirect("~/DettaglioMacchina.aspx");
}
}
// altrimenti split ODL x completare IN FUTURO la produzione...
else
{
try
{
// effettuo split su nuovo ODL
DataLayer.obj.taODL.splitODL(idxODL, idxMacchina.ToString(), TCAssegnato(idxODL), string.Format("Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
// processo chiusura setup
processaEvento(idxEvento, String.Format("Registrata fine produzione per ODL {0}, nuovo ODL per quantità residua", idxODL), idxODL);
// sistemo buttons!
bool splitOdl = false;
fixSplitBtn(splitOdl);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in operazione Chiusura + Split ODL su nuovo! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Response.Redirect("~/DettaglioMacchina.aspx");
}
}
// ricarico...
Response.Redirect("~/ODL.aspx");
}
/// <summary>
/// verifica se sia necessario confermare la prod dell'ODL precedente prima di chiudere e lo fa in automatico...
/// </summary>
/// <param name="confZero">boolean, true = deve confermare 0 pezzi (es. in setup)</param>
private void confermaProdOdl(bool confZero)
{
if (confZero)
{
// confermo produzione ZERO pezzi (in setup)
DataLayer.obj.confermaProdMacchina(idxMacchina.ToString(), memLayer.ML.confReadInt("modoConfProd"), 0);
}
else // se NON sono in setup verifico se ho pz da confermare
{
// recupero pz da confermare
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
if (rigaProd.pezziNonConfermati > 0)
{
DataLayer.obj.confermaProdMacchina(idxMacchina.ToString(), memLayer.ML.confReadInt("modoConfProd"), rigaProd.pezziNonConfermati);
}
}
}
/// <summary>
/// mostra dati ed opzione x split ODL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnShowSplitODL_Click(object sender, EventArgs e)
{
bool splitOdl = true;
fixSplitBtn(splitOdl);
// recupero current idx
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
updateTempoTc(currODL);
updateNoteTC(currODL);
}
/// <summary>
/// sistema buttons split
/// </summary>
/// <param name="splitOdl"></param>
private void fixSplitBtn(bool splitOdl)
{
btnShowSplitODL.Visible = !splitOdl;
chkCloseOdl.Visible = !splitOdl;
btnSplitODL.Visible = splitOdl;
showNoteTC(splitOdl);
ddlODL.Visible = !splitOdl;
btnStartAttr.Visible = !splitOdl;
btnStartProd.Visible = !splitOdl;
btnEndProd.Visible = !splitOdl;
}
/// <summary>
/// split ODL con creazione nuovo ODL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSplitODL_Click(object sender, EventArgs e)
{
// chiamo stored che genera nuovo ODL, mette note e tempo, chiude vecchi e assegna nuovo...
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
int idxEvento = 1; // !!!HARD CODED
// controllo se TC è valorizzato..
if (TCRichAttr == 0)
{
mod_tempoMSMC.checkTC();
}
// confermo prod vecchio ODL
confermaProdOdl(false);
// effettuo split su nuovo ODL
DataLayer.obj.taODL.splitODL(currODL, idxMacchina.ToString(), TCRichAttr, txtNote.Text, true);
// invio email!
DataLayer.obj.sendWarnTcChangeReq(memLayer.ML.confReadString("_adminEmail"));
// processo chiusura setup
processaEvento(idxEvento, String.Format("Registrato Riattrezzaggio ODL (old: {0})", currODL), currODL);
// sistemo buttons!
bool splitOdl = false;
fixSplitBtn(splitOdl);
}
/// <summary>
/// selezionato un ODL mostro note/tempo da validare
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlODL_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlODL.SelectedIndex > 0)
{
showNoteTC(true);
updateTempoTc(idxODLSel);
updateNoteTC(idxODLSel);
}
else
{
showNoteTC(false);
}
}
/// <summary>
/// mostra/nasconde note
/// </summary>
private void showNoteTC(bool show)
{
// mostra/nasconde note da compilare
divTempo.Visible = show;
divNote.Visible = show;
}
/// <summary>
/// aggiorna note ODL
/// </summary>
/// <param name="idxOdl"></param>
private void updateNoteTC(int idxOdl)
{
string testo = "";
if (idxOdl > 0)
{
try
{
testo = DataLayer.obj.taODL.getByIdx(idxOdl, false)[0].Note;
}
catch
{ }
}
txtNote.Text = testo;
}
/// <summary>
/// update TC mostrato
/// </summary>
/// <param name="idxOdl"></param>
private void updateTempoTc(int idxOdl)
{
// riporta TC
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
decimal TCRichAttr = 0;
if (rigaOdl.TCRichAttr > 0)
{
TCRichAttr = rigaOdl.TCRichAttr;
}
else
{
TCRichAttr = rigaOdl.TCAssegnato;
}
// mostro!
mod_tempoMSMC.tempoMC = TCRichAttr;
}
}
}
+132
View File
@@ -0,0 +1,132 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_ODL {
/// <summary>
/// ddlODL 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 ddlODL;
/// <summary>
/// odsODL 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 odsODL;
/// <summary>
/// divNote 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 divNote;
/// <summary>
/// txtNote 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 txtNote;
/// <summary>
/// btnStartAttr 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 btnStartAttr;
/// <summary>
/// divTempo 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 divTempo;
/// <summary>
/// mod_tempoMSMC control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::MoonProTablet.WebUserControls.mod_tempoMSMC mod_tempoMSMC;
/// <summary>
/// btnStartProd 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 btnStartProd;
/// <summary>
/// btnEndProd 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 btnEndProd;
/// <summary>
/// btnShowSplitODL 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 btnShowSplitODL;
/// <summary>
/// chkCloseOdl 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 chkCloseOdl;
/// <summary>
/// btnSplitODL 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 btnSplitODL;
/// <summary>
/// lblOut 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 lblOut;
}
}
@@ -0,0 +1,82 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_RepProd_GG.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_RepProd_GG" %>
<div data-theme="c">
<div class="ui-grid-a">
<div class="ui-block-a" style="text-align: center; margin: auto; vertical-align: middle;">
Articolo
<br />
<asp:DropDownList ID="ddlArticolo" runat="server" DataTextField="label" DataValueField="value" ForeColor="Black"
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 class="ui-block-b" style="text-align: center; margin: auto; vertical-align: middle;">
<h3>Storico Tempi Ciclo</h3>
</div>--%>
<div class="ui-block-b" style="text-align: center; margin: auto; vertical-align: middle;">
Impianto
<br />
<asp:DropDownList ID="ddlMacchine" runat="server" DataTextField="label" DataValueField="value" ForeColor="Black"
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 class="ui-grid-solo" style="text-align: center; margin: auto; vertical-align: middle;">
<asp:GridView ID="grView" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ods" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" AllowPaging="True" ForeColor="Black" GridLines="None" Width="100%">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
<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:BoundField DataField="CodArticolo" HeaderText="Articolo" SortExpression="CodArticolo" />
<asp:TemplateField HeaderText="Data" SortExpression="Data">
<ItemTemplate>
<asp:Label ID="lblData" runat="server" Text='<%# Eval("Data", "{0:ddd dd/MM/yyyy}") %>' />
<br />
<asp:Label ID="lblIdxODL" runat="server" Text='<%# Eval("IdxODL","ODL: {0}") %>' Font-Size="0.8em" ForeColor="#696969" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TCiclo" SortExpression="TCAssegnato">
<ItemTemplate>
<asp:Label ID="lblTCAssMS" runat="server" Text='<%# SteamWare.TempiCiclo.minSec(Eval("TCAssegnato", "{0:N3}")) %>' />
<br />
<asp:Label ID="lblTCAssMC" runat="server" Text='<%# Bind("TCAssegnato", "{0:N2} min.cent") %>' Font-Size="0.8em" ForeColor="#696969" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Confermati" SortExpression="pzConf">
<ItemTemplate>
<asp:Label ID="lblpzConf" runat="server" Text='<%# Eval("pzConf") %>' />
<div style="color: #636363; font-size: 0.8em;">
<asp:Label ID="lblpzProd" runat="server" Text='<%# Eval("pzProd","({0} prod)") %>' />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Nome" HeaderText="Impianto" SortExpression="Nome" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_ProdTempiTableAdapters.ResProdDett_splitGGTableAdapter">
<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" />
<asp:ControlParameter ControlID="hfDataFrom" Name="dataFrom" PropertyName="Value" Type="DateTime" />
<asp:ControlParameter ControlID="hfDataTo" Name="dataTo" PropertyName="Value" Type="DateTime" />
<asp:ControlParameter ControlID="hfOpenOnly" Name="openOdlOnly" PropertyName="Value" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfDataFrom" />
<asp:HiddenField runat="server" ID="hfDataTo" />
<asp:HiddenField runat="server" ID="hfOpenOnly" Value="true" />
</div>
</div>
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonProTablet.WebUserControls
{
public partial class mod_RepProd_GG : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// seleziono valori "0"
ddlArticolo.SelectedIndex = 0;
ddlMacchine.SelectedIndex = 0;
// data. ultimi 30 gg di default!
hfDataFrom.Value = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
hfDataTo.Value = DateTime.Now.ToString("yyyy-MM-dd");
}
updateElenco();
}
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!
grView.DataBind();
}
}
}
@@ -0,0 +1,96 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_RepProd_GG {
/// <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>
/// 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;
/// <summary>
/// hfDataFrom 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.HiddenField hfDataFrom;
/// <summary>
/// hfDataTo 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.HiddenField hfDataTo;
/// <summary>
/// hfOpenOnly 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.HiddenField hfOpenOnly;
}
}
@@ -0,0 +1,52 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_commenti.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_commenti" %>
<div data-role="content">
<asp:Label runat="server" ID="lblNumGG" Text="Commenti da mostrare" AssociatedControlID="rblPageSize" />
<fieldset data-role="controlgroup" data-type="horizontal">
<asp:RadioButtonList ID="rblPageSize" runat="server" RepeatDirection="Horizontal" AutoPostBack="true">
<asp:ListItem Text="5" Value="5" Selected="True" />
<asp:ListItem Text="10" Value="10" />
<asp:ListItem Text="25" Value="25" />
<asp:ListItem Text="50" Value="50" />
</asp:RadioButtonList>
</fieldset>
<ul data-role="listview" data-inset="true">
<asp:Repeater ID="repComm" runat="server" DataSourceID="odsComm">
<ItemTemplate>
<li>
<div class="divSx">
<asp:ImageButton runat="server" ID="btnEdit" ImageUrl="~/images/edit_l.png" CommandArgument='<%# Eval("InizioStato") %>' OnClick="btnEdit_Click" Visible='<%# enableEdit %>' />
</div>
<div class="divDx">
<asp:ImageButton runat="server" ID="btnDel" ImageUrl="~/images/elimina_l.png" CommandArgument='<%# Eval("InizioStato") %>' OnClick="btnDel_Click" Visible='<%# enableEdit %>' />
</div>
<div style="font-size: smaller;">
<div>
<div class="divSx" style="font-size: x-small;">
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Operatore", "<b>{0}</b>") %>' ForeColor="#ACACAC" />
</div>
</div>
<div class="clearDiv">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Value") %>' Font-Bold="false" />
</div>
<div class="clearDiv" style="font-size: xx-small; border-top: 1px solid #ACACAC; color: #ACACAC">
<div class="divSx">
<asp:Label ID="Label5" runat="server" Text='<%# Eval("InizioStato", "{0:dd/MM/yyyy HH:mm:ss}") %>' Font-Bold="false" />
</div>
<div class="divDx">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("CodArticolo") %>' Font-Bold="false" />
<asp:Label runat="server" ID="Label2" Text='<%# Eval("idxODL","ODL{0}") %>' Font-Bold="false" />
</div>
</div>
</div>
<div class="clearDiv"></div>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
<asp:ObjectDataSource ID="odsComm" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.CommentiTableAdapter">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="idxMacchina" Type="String" />
<asp:ControlParameter ControlID="rblPageSize" DefaultValue="10" Name="showMax" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapoDb;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_commenti : System.Web.UI.UserControl
{
/// <summary>
/// registrata richiesta
/// </summary>
public event EventHandler eh_reqEdit;
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// abilitazione edit commenti
/// </summary>
public bool enableEdit
{
get
{
return memLayer.ML.confReadBool("commEnableEditDel");
}
}
public void doUpdate()
{
repComm.DataBind();
}
/// <summary>
/// carico x edit commento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEdit_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgBtn = (ImageButton)sender;
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
memLayer.ML.setSessionVal("inizioStato", inizioStato);
// sollevo evento!
if (eh_reqEdit != null)
{
eh_reqEdit(this, new EventArgs());
}
//string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
//DS_applicazione.EventListRow riga = null;
//try
//{
// riga = DataLayer.obj.taEventi.GetByMacchinaPeriodo(idxMacchina, inizioStato, inizioStato)[0];
//txtDate.Text = riga.InizioStato.ToString("yyyy-MM-dd");
//txtTime.Text = riga.InizioStato.ToString("HH:mm");
//txtCommento.Text = riga.Value;
//}
//catch
//{ }
//fixPanels(false, true, false);
}
/// <summary>
/// elimina commento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDel_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgBtn = (ImageButton)sender;
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
DataLayer.obj.taEventi.DeleteQuery(idxMacchina, inizioStato);
doUpdate();
}
}
}
+51
View File
@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_commenti {
/// <summary>
/// lblNumGG 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 lblNumGG;
/// <summary>
/// rblPageSize 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.RadioButtonList rblPageSize;
/// <summary>
/// repComm 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.Repeater repComm;
/// <summary>
/// odsComm 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 odsComm;
}
}
@@ -0,0 +1,19 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_confProd.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_confProd" %>
<div data-role="content">
<div class="ui-grid-a">
<div class="ui-block-a" data-role="content">
<asp:Button runat="server" ID="btnShowConfProd" Text="Mostra Conferma" data-role="button" data-iconpos="bottom" data-icon="check"
data-theme="b" data-inline="true" OnClick="btnShowConfProd_Click" />
</div>
<div class="ui-block-b" data-role="content">
<asp:Button runat="server" ID="btnSalva" Text="Conferma Produzione" data-role="button" data-iconpos="bottom" data-icon="plus"
data-theme="e" data-inline="true" Visible="false" OnClick="btnSalva_Click" />
</div>
</div>
<div class="ui-grid-solo">
<asp:TextBox runat="server" ID="txtNumPezzi" Font-Size="XX-Large" Width="5em" Visible="false" />
</div>
<div class="ui-grid-solo">
<asp:Label runat="server" ID="lblOut" ForeColor="Red" />
</div>
</div>
@@ -0,0 +1,266 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet.WebUserControls
{
public partial class mod_confProd : System.Web.UI.UserControl
{
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_inserting;
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_newVal;
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_reset;
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lblOut.Text = "";
}
}
/// <summary>
/// idx macchina selezionata
/// </summary>
public int idxMacchina
{
get
{
return memLayer.ML.IntSessionObj("IdxMacchina");
}
set
{
memLayer.ML.setSessionVal("IdxMacchina", value);
}
}
/// <summary>
/// cambio stato visibilità pannello e testo button
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnShowConfProd_Click(object sender, EventArgs e)
{
switchBtnConferma();
}
/// <summary>
/// determina comportamento btn conferma
/// </summary>
private void switchBtnConferma()
{
txtNumPezzi.Visible = !txtNumPezzi.Visible;
btnSalva.Visible = txtNumPezzi.Visible;
if (txtNumPezzi.Visible)
{
btnShowConfProd.Text = "Nascondi Conferma";
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
try
{
txtNumPezzi.Text = rigaProd.pezziNonConfermati.ToString();
// sollevo evento!
if (eh_inserting != null)
{
eh_inserting(this, new EventArgs());
}
}
catch
{
txtNumPezzi.Text = "0";
logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchina), tipoLog.ERROR);
}
}
else
{
btnShowConfProd.Text = "Mostra Conferma";
// sollevo evento!
if (eh_reset != null)
{
eh_reset(this, new EventArgs());
}
}
}
/// <summary>
/// Numero pezzi confermati
/// </summary>
protected int numPzConfermati
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(txtNumPezzi.Text);
}
catch
{ }
return answ;
}
}
/// <summary>
/// salvo produzione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSalva_Click(object sender, EventArgs e)
{
if (memLayer.ML.confReadInt("modoConfProd") == 2)
{
confermaPerTurni();
}
else
{
confermaPerGiorni();
}
// refresh tabella dati tablet...
DataLayer.obj.taMSE.getByRefreshData(memLayer.ML.confReadInt("refrMSE_0"));
// mostro output
lblOut.Text = string.Format("Confermata la produzione per {0} pezzi!", numPzConfermati);
// cambio button conferma...
switchBtnConferma();
// sollevo evento!
if (eh_newVal != null)
{
eh_newVal(this, new EventArgs());
}
}
/// <summary>
/// effettua conferma per giorni della produzione
/// </summary>
private void confermaPerGiorni()
{
// vecchia chiamata esplicita, uso metodo datalayer (singleton) nuovo...
#if false
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
// chiamo stored stp_ConfermaProduzCompleta(idxMacchina,MatrApp,dataFrom,dataTo,pezziConf)
DataLayer.obj.taPzProd2conf.stp_ConfermaProduzCompleta(idxMacchina.ToString(), DataLayer.MatrOpr, rigaProd.DataFrom, rigaProd.DataTo, numPzConfermati, memLayer.ML.confReadInt("modoConfProd"));
#endif
DataLayer.obj.confermaProdMacchina(idxMacchina.ToString(), memLayer.ML.confReadInt("modoConfProd"), numPzConfermati);
}
/// <summary>
/// effettua conferma per turni della produzione
/// </summary>
private void confermaPerTurni()
{
// vecchia chiamata esplicita, uso metodo datalayer (singleton) nuovo...
#if false
// carico i dati preliminari: ODL
int idxOdl = 0; // userò ODL del turno
try
{
idxOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
}
catch
{
logger.lg.scriviLog(string.Format("Errore a recuperare ODL per la macchina {0}", idxMacchina), tipoLog.ERROR);
}
// carico i dati preliminari: operatore
int MatrAppr = DataLayer.MatrOpr;
// variabile per ODL del turno
DS_ProdTempi.ODLDataTable elencoOdlTurno;
// carico i dati da confermare...
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
// chiamo la stored
try
{
// ricavo i turni della macchina da anagrafica
// !!!FARE!!! da db incrociando dati da anagrafica... x ora calcolo con turno 8 h x 7 gg/week
int shiftTurno = 6;
int durataTurno = 8;
// calcolo quanti turni da approvare ci siano
int numTurni2appr = (int)Math.Ceiling(rigaProd.DataTo.Subtract(rigaProd.DataFrom).TotalHours / durataTurno);
// questa dataora rappresenta l'inizio del turno che man mano vado ad approvare
DateTime dataCurr = rigaProd.DataFrom;
turnoLavoro turnoCurr;
int pzProd = 0;
int idxStatoProd = 13; // hard coded!!!
// definisco intervallo date x fare query (inizialmente è turno)
intervalloDate periodoOdl = new intervalloDate();
intervalloDate periodoProd = new intervalloDate();
// vado a ciclare da dataFrom a dataTo per ogni turno compreso fino all'ultimo turno intero
for (int i = 0; i < numTurni2appr; i++)
{
// calcolo il turno che comprende la data da approvare
turnoCurr = datario.mngr.getTurnoByDateTime(dataCurr, shiftTurno, durataTurno);
// recupero elenco ODL del turno (in modo che se ne ho + di 1 faccio + inserimenti produzione)
elencoOdlTurno = DataLayer.obj.taODL.getByMacchinaPeriodoNoNull(idxMacchina.ToString(), turnoCurr.inizio, turnoCurr.fine);
// se ho almeno 1 ODL approvo...
foreach (DS_ProdTempi.ODLRow odl in elencoOdlTurno)
{
idxOdl = odl.IdxODL;
// calcolo periodo ODL
periodoOdl = datario.mngr.setIntervallo(odl.DataInizio, odl.DataFine);
// calcolo intersezione periodi: tra turno e validità ODL
periodoProd = datario.mngr.intersecaIntervalli(periodoOdl, turnoCurr.periodo);
// calcolo i pezzi da confermare x l'ODL in esame... ovvero imposto inizio/fine periodo da intersezione periodo ODL + turno
try
{
// approvando tanto la produzione
pzProd = DataLayer.obj.taPzProd2conf.getByMacchinaPeriodo(idxMacchina.ToString(), periodoProd.inizio, periodoProd.fine)[0].pezziNonConfermati;
}
catch
{
pzProd = 0;
}
// carico i dati x Turno ed ODL
try
{
DataLayer.obj.taPzProd2conf.stp_DatiConf_conferma(idxOdl, idxMacchina.ToString(), MatrAppr, turnoCurr.inizio, turnoCurr.fine, turnoCurr.TNum, idxStatoProd, pzProd);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in INSERT dati x tab DatiConfermati: odl: {0}, idxMacchina: {1}, turno da {2} a {3}, errore{4}{5}", idxOdl, idxMacchina, turnoCurr.inizio, turnoCurr.fine, Environment.NewLine, exc), tipoLog.ERROR);
}
}
// qui non ho + cambiato nulla per multi/ODL
try
{
// chiamo stored inserimento dati produzione per il turno
DataLayer.obj.taDatiProd.stp_DatiProd_insAllPeriodo(idxMacchina.ToString(), turnoCurr.inizio, turnoCurr.fine, turnoCurr.inizio.Date, turnoCurr.TNum, MatrAppr);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in insert x tab DatiProduzione per il turno: odl: {0}, idxMacchina: {1}, turno da {2} a {3}, errore{4}{5}", idxOdl, idxMacchina, turnoCurr.inizio, turnoCurr.fine, Environment.NewLine, exc), tipoLog.ERROR);
}
dataCurr = dataCurr.AddHours(durataTurno);
}
// IN FINE confermo la produzione della DIFFERENZA tra quanto rilevato a sistema dai tempi ciclo rilevati e quanto dichiarato all'istante della dichiarazione
try
{
pzProd = DataLayer.obj.taPzProd2conf.getByMacchinaPeriodo(idxMacchina.ToString(), rigaProd.DataFrom, rigaProd.DataTo)[0].pezziNonConfermati;
}
catch
{
pzProd = 0;
}
// confermo DELTA tab DatiConfermati
DataLayer.obj.taPzProd2conf.stp_DatiConf_conferma(idxOdl, idxMacchina.ToString(), MatrAppr, DateTime.Now, DateTime.Now, 1, idxStatoProd, numPzConfermati - pzProd);
// confermo DELTA tab DatiProduzione - ATTENZIONE NON METTO TEMPO NEGATIVO!!!
DataLayer.obj.taDatiProd.stp_DatiProd_insert(idxOdl, idxMacchina.ToString(), MatrAppr, DateTime.Now, DateTime.Now, 1, numPzConfermati - pzProd, 0, "T_CorrProd");
// mostro output
lblOut.Text = string.Format("Confermata la produzione per {0} pezzi!", numPzConfermati);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore nella chiamata a stored di conferma dati!{0}{1}", Environment.NewLine, exc), tipoLog.ERROR);
}
#endif
DataLayer.obj.confermaProdMacchina(idxMacchina.ToString(), memLayer.ML.confReadInt("modoConfProd"), numPzConfermati);
}
}
}
+51
View File
@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_confProd {
/// <summary>
/// btnShowConfProd 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 btnShowConfProd;
/// <summary>
/// btnSalva 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 btnSalva;
/// <summary>
/// txtNumPezzi 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 txtNumPezzi;
/// <summary>
/// lblOut 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 lblOut;
}
}
@@ -0,0 +1,61 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dettMacchina.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_dettMacchina" %>
<%--Riporto dettaglio singola macchina--%>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Panel runat="server" ID="pnlFullDet">
<div id="dettMacch">
<ul data-role="listview" data-inset="true">
<asp:Repeater ID="repLI" runat="server" DataSourceID="ods">
<ItemTemplate>
<li><a href="#" c>
<img src='<%# ImgUrl(Eval("url")) %>' alt='<%# Eval("CodMacchina") %>'>
<h2>
<asp:Label runat="server" ID="lblTitle" Text='<%# Eval("Nome") %>' /></h2>
<p>
<span class='<%# cssDaSemaforo(Eval("Semaforo")) %>' style="width: 100%; display: block; padding-right: 0px;"><span style="float: left;">
<b>
<asp:Label runat="server" ID="lblStato" Text='<%# Eval("DescrizioneStato") %>' /></b></span> <span style="float: right; padding-right: 8px;">
<asp:Label runat="server" ID="lblDurata" Text='<%# formatDurata(Eval("Durata")) %>' /></span>
<br />
<span style="float: left;">
<asp:Label runat="server" ID="Label2" Text='<%# Eval("PezziProd","prod: {0}") %>' ToolTip="pz prodotti" />
/
<asp:Label runat="server" ID="lblPzLanciati" Text='<%# Eval("NumPezzi","tot: {0}") %>' ToolTip="pz lanciati" />
</span><span style="float: right; padding-right: 8px;">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("PezziConf","conf: {0}") %>' ToolTip="pz confermati" />
</span></span>
</p>
<p class="ui-li-aside">
<asp:Label runat="server" ID="lblBadge" Text='<%# Eval("CodArticolo","art: {0}") %>' />
<asp:Label runat="server" ID="lblODC" Text='<%# Eval("idxODL","(ODL {0})") %>' />
</p>
</a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
</asp:Panel>
<asp:Panel runat="server" ID="pnlLessDet" Visible="false">
<asp:Repeater ID="repTestata" runat="server" DataSourceID="ods">
<ItemTemplate>
<div class='<%# cssDaSemaforo(Eval("Semaforo")) %>' style="padding: 2px 0px; text-align: center; margin: auto; font-size: 20pt;">
<asp:Label runat="server" ID="lblTitle" Text='<%# Eval("Nome") %>' />
</div>
</ItemTemplate>
</asp:Repeater>
</asp:Panel>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByRefreshData"
TypeName="MapoDb.DS_ProdTempiTableAdapters.MappaStatoExplTableAdapter" FilterExpression="IdxMacchina = {0}">
<FilterParameters>
<asp:SessionParameter Type="Int32" DefaultValue="0" SessionField="IdxMacchina" Name="IdxMacchina" />
</FilterParameters>
<SelectParameters>
<asp:Parameter DefaultValue="1" Name="maxAgeSec" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<!-- timer refresh dettaglio macchina: 1 sec, 1'000 ms -->
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet.WebUserControls
{
public partial class mod_dettMacchina : System.Web.UI.UserControl
{
/// <summary>
/// idx macchina selezionata
/// </summary>
public int idxMacchina
{
get
{
return memLayer.ML.IntSessionObj("IdxMacchina");
}
set
{
memLayer.ML.setSessionVal("IdxMacchina", value);
}
}
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
// controllo se ho dett macchina altrimenti ritorno a pagina generale...
if (idxMacchina < 0)
{
Response.Redirect("~/MappaStato.aspx");
}
}
/// <summary>
/// url completo immagine
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public string ImgUrl(object url)
{
return string.Format("./images/macchine/{0}", url);
}
/// <summary>
/// restituisce cod CSS dato cod semaforo
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public string cssDaSemaforo(object semaforo)
{
return resoconti.mngr.cssDaCodColore(semaforo.ToString());
}
/// <summary>
/// fomratta durata in minuti/ore/gg a seconda del totale...
/// </summary>
/// <param name="minuti"></param>
/// <returns></returns>
public string formatDurata(object min)
{
return utility.formatDurata(min);
}
/// <summary>
/// fa update del controllo
/// </summary>
public void doUpdate()
{
ods.DataBind();
repLI.DataBind();
}
/// <summary>
/// timeout scaduto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Timer1_Tick(object sender, EventArgs e)
{
doUpdate();
//ScriptManager.RegisterStartupScript(Page, GetType(), "temp", "<script type='text/javascript'>$('div').trigger('create');</script>", false);
ScriptManager.RegisterStartupScript(Page, GetType(), "temp", "<script type='text/javascript'>$('#dettMacch').trigger('create');</script>", false);
}
/// <summary>
/// determian se nascondere la visualizzaizone compelta (e mostrare solo nome macchina)
/// </summary>
/// <param name="full">mostra tutto (true) o solo header(false)</param>
public void detailLevel(bool full)
{
pnlFullDet.Visible = full;
pnlLessDet.Visible = !full;
}
}
}
@@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_dettMacchina {
/// <summary>
/// UpdatePanel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel UpdatePanel1;
/// <summary>
/// pnlFullDet 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 pnlFullDet;
/// <summary>
/// repLI 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.Repeater repLI;
/// <summary>
/// pnlLessDet 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 pnlLessDet;
/// <summary>
/// repTestata 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.Repeater repTestata;
/// <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>
/// Timer1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.Timer Timer1;
}
}
@@ -0,0 +1,44 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dettTurni.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_dettTurni" %>
<div>
<div style="width: 100px;">
<b>Turni Attivi</b>
<asp:DetailsView ID="dtView" runat="server" DataSourceID="odsTurni" AutoGenerateRows="False" DataKeyNames="IdxMacchina" Width="100px">
<Fields>
<asp:TemplateField HeaderText="T1">
<ItemTemplate>
<asp:Panel runat="server" ID="pnlT1" CssClass='<%# coloreDaTurno(Eval("T1")) %>'>
<asp:Label ID="Label1" in="lblT1" runat="server" Text="Turno 1" />
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="T2">
<ItemTemplate>
<asp:Panel runat="server" ID="pnlT1" CssClass='<%# coloreDaTurno(Eval("T2")) %>'>
<asp:Label ID="lblT2" in="lblT2" runat="server" Text="Turno 2" />
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="T3">
<ItemTemplate>
<asp:Panel runat="server" ID="pnlT1" CssClass='<%# coloreDaTurno(Eval("T3")) %>'>
<asp:Label ID="lblT3" in="lblT3" runat="server" Text="Turno 3" />
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
<asp:ObjectDataSource ID="odsTurni" runat="server" SelectMethod="getByIdxMacc" TypeName="MapoDb.DS_ProdTempiTableAdapters.TurniMacchinaTableAdapter">
<SelectParameters>
<asp:SessionParameter Name="IdxMacchina" SessionField="idxMacchina" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div style="width: 100px;">
<div class="semaforoVerde">
Turno Aperto
</div>
<div class="semaforoSpento">
Turno Chiuso
</div>
</div>
</div>
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapoDb;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_dettTurni : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
updateTurni();
}
/// <summary>
/// aggiorna classi grafiche turni
/// </summary>
protected void updateTurni()
{
}
/// <summary>
/// fornisce classe CSS x colorare il turno secondo apertura o meno
/// </summary>
/// <param name="turno"></param>
/// <returns></returns>
public string coloreDaTurno(object turno)
{
string answ = "semaforoSpento";
bool aperto = false;
try
{
aperto = Convert.ToBoolean(turno);
}
catch
{ }
if (aperto) answ = "semaforoVerde";
return answ;
}
}
}
+33
View File
@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_dettTurni {
/// <summary>
/// dtView 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.DetailsView dtView;
/// <summary>
/// odsTurni 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 odsTurni;
}
}
@@ -0,0 +1,111 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dettaglioProd.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_dettaglioProd" %>
<% if (false)
{ %>
<link href="../Style.css" rel="stylesheet" type="text/css" />
<% } %>
<div style="text-align: center; margin: auto;">
<div style="text-align: center; margin: auto; min-width: 400px;">
<%--<table class="UI">--%>
<table cellpadding="3" cellspacing="0" style="font-size: x-small; border: solid 1px #666666;">
<tr>
<td colspan="4" style="min-width: 400px; color: White; background-color: #333333;">
<asp:Label runat="server" ID="lblOdl" Font-Bold="true" />
</td>
</tr>
<tr class="alternatingRowStyle stdFont" style="text-align: center; font-size: x-small">
<td>
Cod articolo
</td>
<td>
Nr pezzi lanciati
</td>
<td>
Nr pezzi confermati
</td>
<td>
Nr pezzi fatti
</td>
</tr>
<tr class="rowStyle stdFont" style="font-weight: bold;">
<td>
<asp:Label runat="server" ID="lblCodArticolo" />
</td>
<td>
<asp:Label runat="server" ID="lblNumPzLanciati" />
</td>
<td>
<asp:Label runat="server" ID="lblNumPzConf" />
</td>
<td>
<asp:Label runat="server" ID="lblNumPzFatti" Font-Bold="false" />
</td>
</tr>
<tr class="alternatingRowStyle stdFont" style="text-align: center;">
<td colspan="1">
Efficienza Globale
</td>
<td colspan="1">
Efficienza Lavoro
</td>
<td colspan="1">
Efficienza Teorica
</td>
<td>
</td>
</tr>
<tr class="rowStyle stdFont">
<td colspan="1">
<asp:Label runat="server" ID="lblEfficienzaTot" Font-Bold="true" />
<br />
<asp:Label runat="server" ID="lblEfficienzaTotRT" />
</td>
<td colspan="1">
<asp:Label runat="server" ID="lblEfficienzaLavoro" Font-Bold="true" />
<br />
<asp:Label runat="server" ID="lblEfficienzaLavoroRT" />
</td>
<td colspan="1">
<asp:Label runat="server" ID="lblEfficienzaEff" Font-Bold="true" />
<br />
<asp:Label runat="server" ID="lblEfficienzaEffRT" />
</td>
<td>
</td>
</tr>
<tr class="alternatingRowStyle stdFont" style="text-align: center;">
<td>
Tc Medio
</td>
<td>
Tc Lavoro
</td>
<td>
Tc Tecnico
</td>
<td>
Tc impostato
</td>
</tr>
<tr class="rowStyle stdFont" style="font-weight: bold;">
<td>
<asp:Label runat="server" ID="lblTcMedio" />
<br />
<asp:Label runat="server" ID="lblTcMedioRT" Font-Bold="false" />
</td>
<td>
<asp:Label runat="server" ID="lblTcLavoro" />
<br />
<asp:Label runat="server" ID="lblTcLavoroRT" Font-Bold="false" />
</td>
<td>
<asp:Label runat="server" ID="lblTcEffettivo" />
<br />
<asp:Label runat="server" ID="lblTcEffettivoRT" Font-Bold="false" />
</td>
<td>
<asp:Label runat="server" ID="lblTcImpostato" />
</td>
</tr>
</table>
</div>
</div>
@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapoDb;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_dettaglioProd : System.Web.UI.UserControl
{
/// <summary>
/// effettua traduzione del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
popolaLabels();
}
/// <summary>
/// popola le labels
/// </summary>
private void popolaLabels()
{
// cambio: leggo NUOVA riga report...
DS_ProdTempi.MappaStatoExplDataTable tabDati = DataLayer.obj.taMSE.getByRefreshData(memLayer.ML.confReadInt("refrMSE_5"));
DS_ProdTempi.MappaStatoExplRow rigaDati = (DS_ProdTempi.MappaStatoExplRow)tabDati.Rows.Find(idxMacchina);
// carico le info!
lblOdl.Text = string.Format("ODL num: {0}, iniziato il {1:dd/MM/yy} alle {1:HH:mm}", rigaDati.idxODL, rigaDati.DataInizioODL);
/************************************
* data la postazione corrente decide cosa mostrare e come
************************************/
lblCodArticolo.Text = rigaDati.CodArticolo;
lblNumPzLanciati.Text = string.Format("{0} pz.", rigaDati.NumPezzi);
lblNumPzConf.Text = string.Format("{0} pz.", rigaDati.PezziConf);
lblNumPzFatti.Text = string.Format("({0} pz.)", rigaDati.PezziProd);
/************************************
* calcolo efficienza totale
* se il calcolo non è possibile mette n/a
************************************/
decimal tempoProd = rigaDati.TCAssegnato * rigaDati.PezziConf;
try
{
lblEfficienzaTot.Text = Convert.ToString(String.Format("{0:p2}", tempoProd / rigaDati.TempoOn / 100));
}
catch
{
lblEfficienzaTot.Text = "n/a";
}
// calcolo efficienza lavoro - se il calcolo non è possibile mette n/a
try
{
lblEfficienzaLavoro.Text = Convert.ToString(String.Format("{0:p2}", tempoProd / rigaDati.TempoAuto / 100));
}
catch
{
lblEfficienzaLavoro.Text = "n/a";
}
// calcolo efficienza Teorica - se il calcolo non è possibile mette n/a
try
{
lblEfficienzaEff.Text = Convert.ToString(String.Format("{0:p2}", tempoProd / rigaDati.TempoRun / 100));
}
catch
{
lblEfficienzaEff.Text = "n/a";
}
/************************************
* imposto i TEMPI CICLO
************************************/
// riporto Tempo ciclo impostato
lblTcImpostato.Text = Convert.ToString(String.Format("{0:0.###}", rigaDati.TCAssegnato));
// riporto Tempo ciclo medio
lblTcMedio.Text = Convert.ToString(String.Format("{0:0.###}", rigaDati.TCMedio));
lblTcMedioRT.Text = Convert.ToString(String.Format("({0:0.###})", rigaDati.TCMedioRT));
// riporto Tempo ciclo lavoro
lblTcLavoro.Text = Convert.ToString(String.Format("{0:0.###}", rigaDati.TCLav));
lblTcLavoroRT.Text = Convert.ToString(String.Format("({0:0.###})", rigaDati.TCLavRT));
// riporto Tempo ciclo effettivo/tecnico, come media dei 10 migliori delle ultime 8 ore
lblTcEffettivo.Text = Convert.ToString(String.Format("{0:0.###}", rigaDati.TCEff));
lblTcEffettivoRT.Text = Convert.ToString(String.Format("({0:0.###})", rigaDati.TCEffRT));
/************************************
* Sistemo efficienze RT da tempi ciclo
************************************/
try
{
lblEfficienzaTotRT.Text = Convert.ToString(String.Format("({0:p2})", rigaDati.TCAssegnato / rigaDati.TCMedioRT));
}
catch
{
lblEfficienzaTotRT.Text = "n/a";
}
// calcolo efficienza lavoro - se il calcolo non è possibile mette n/a
try
{
lblEfficienzaLavoroRT.Text = Convert.ToString(String.Format("({0:p2})", rigaDati.TCAssegnato / rigaDati.TCLavRT));
}
catch
{
lblEfficienzaLavoroRT.Text = "n/a";
}
// calcolo efficienza Teorica - se il calcolo non è possibile mette n/a
try
{
lblEfficienzaEffRT.Text = Convert.ToString(String.Format("({0:p2})", rigaDati.TCAssegnato / rigaDati.TCEffRT));
}
catch
{
lblEfficienzaEffRT.Text = "n/a";
}
}
/// <summary>
/// idxMacchina
/// </summary>
public string idxMacchina
{
get
{
return memLayer.ML.StringSessionObj("idxMacchina");
}
set
{
memLayer.ML.setSessionVal("idxMacchina", value);
}
}
}
}
@@ -0,0 +1,177 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_dettaglioProd {
/// <summary>
/// lblOdl 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 lblOdl;
/// <summary>
/// lblCodArticolo 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 lblCodArticolo;
/// <summary>
/// lblNumPzLanciati 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 lblNumPzLanciati;
/// <summary>
/// lblNumPzConf 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 lblNumPzConf;
/// <summary>
/// lblNumPzFatti 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 lblNumPzFatti;
/// <summary>
/// lblEfficienzaTot 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 lblEfficienzaTot;
/// <summary>
/// lblEfficienzaTotRT 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 lblEfficienzaTotRT;
/// <summary>
/// lblEfficienzaLavoro 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 lblEfficienzaLavoro;
/// <summary>
/// lblEfficienzaLavoroRT 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 lblEfficienzaLavoroRT;
/// <summary>
/// lblEfficienzaEff 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 lblEfficienzaEff;
/// <summary>
/// lblEfficienzaEffRT 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 lblEfficienzaEffRT;
/// <summary>
/// lblTcMedio 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 lblTcMedio;
/// <summary>
/// lblTcMedioRT 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 lblTcMedioRT;
/// <summary>
/// lblTcLavoro 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 lblTcLavoro;
/// <summary>
/// lblTcLavoroRT 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 lblTcLavoroRT;
/// <summary>
/// lblTcEffettivo 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 lblTcEffettivo;
/// <summary>
/// lblTcEffettivoRT 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 lblTcEffettivoRT;
/// <summary>
/// lblTcImpostato 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 lblTcImpostato;
}
}
@@ -0,0 +1,22 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dichiarazione.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_dichiarazione" %>
<div class="ui-grid-solo">
<asp:Label runat="server" ID="lblOut" ForeColor="Red" />
</div>
<div class="elDich">
<ul data-role="listview" data-inset="true">
<asp:Repeater ID="repLI" runat="server" DataSourceID="ods">
<ItemTemplate>
<li>
<asp:LinkButton ID="hlEvento" runat="server" OnClick="hlEvento_Click" CommandArgument='<%# Eval("value") %>'>
<img src='<%# ImgUrl(Eval("value")) %>' alt='<%# Eval("label") %>'>
<p class="ui-li-dich" style="font-size: 12pt;">
<asp:Label runat="server" ID="lblTitle" Text='<%# Eval("label") %>' />
</p>
</asp:LinkButton>
</li>
</ItemTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.v_selEventiBCodeTableAdapter">
</asp:ObjectDataSource>
</ul>
</div>
@@ -0,0 +1,194 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet.WebUserControls
{
public partial class mod_dichiarazione : System.Web.UI.UserControl
{
/// <summary>
/// classe MapoDB x uso locale
/// </summary>
protected MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_newVal;
/// <summary>
/// idx macchina selezionata
/// </summary>
public int idxMacchina
{
get
{
return memLayer.ML.IntSessionObj("IdxMacchina");
}
set
{
memLayer.ML.setSessionVal("IdxMacchina", value);
}
}
/// <summary>
/// caricamento principale
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
repLI.DataBind();
}
/// <summary>
/// rimanda alla pagina di dettaglio della macchina scelta
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void hlEvento_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = (LinkButton)sender;
int idxEvento = 0;
try
{
idxEvento = Convert.ToInt32(lnkbtn.CommandArgument);
}
catch
{ }
if (idxEvento > 0)
{
DS_applicazione.AnagraficaEventiRow rigaEvento = DataLayer.obj.taAnagEventi.GetByIdx(idxEvento)[0];
if (rigaEvento != null)
{
DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina.ToString())[0];
// processo evento...
if (insRealtime)
{
// se realtime
controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), idxEvento, rigaStato.MatricolaKanban, "DRT", DataLayer.MatrOpr, rigaStato.pallet);
}
else
{
// in primis disabilito insert...
DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina.ToString(), false);
// calcolo evento
string evento = idxEvento.ToString();
string commento = "";
try
{
evento = DataLayer.obj.taAnagEventi.GetByIdx(idxEvento)[0].Nome.Replace("Barcode - ", "");
}
catch
{ }
// genero stringa pseudo-univoca
string codRich = string.Format("{0:yyMMddHHmmss}-{1}", DateTime.Now, idxEvento);
// x prima cosa scrivo un evento tipo "1" x chiudere la durata appena prima dell'evento successivo
try
{
// cerco da 1 sec DOPO evento...
DS_applicazione.DiarioDiBordoDataTable tabNext = controllerMapo.nextEventoImpiantoFrom(idxMacchina.ToString(), dataOraEv.AddSeconds(1));
DateTime nextEvDT = DateTime.Now;
if (tabNext.Rows.Count > 0)
{
nextEvDT = tabNext[0].InizioStato;
}
// se non trovo chiusura evento inserisco a 1 minuto prima di adesso la chiusura...
else
{
nextEvDT = DateTime.Now.AddMinutes(-1);
}
// fix salvo la dichiarazione di chiusura
commento = string.Format("999 - M.Lav EndEvt: {0} [{1}]", evento, codRich);
controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), 1, rigaStato.MatricolaKanban, commento, DataLayer.MatrOpr, rigaStato.pallet, nextEvDT.AddSeconds(-1), DateTime.Now); // 1 hard-coded x resettare
}
catch
{ }
// update commento!
commento = string.Format("999 - Dich StartEvt: {0} [{1}]", evento, codRich);
// recupero data/ora evento da inserire (quella selezionata) ed AGGIUNGO 1 sec!!! così rimane traccia
controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), idxEvento, rigaStato.MatricolaKanban, commento, DataLayer.MatrOpr, rigaStato.pallet, dataOraEv.AddSeconds(1), DateTime.Now);
// eseguo ricalcolo!
DateTime startRicalcolo = dataOraEv.AddMinutes(memLayer.ML.confReadInt("minAnticipoRicalcolo"));
DataLayer.obj.taComm.stp_ricalcolaDatiMacchinaFromDate(idxMacchina.ToString(), startRicalcolo, 1); // nella stored imposto macchina OFFline e poi ONline, parto da "minAnticipoRicalcolo" minuti prima...
// aggiorno data evento x insert eventuale commento (5 sec...)
dataOraEv = dataOraEv.AddSeconds(5);
// riabilito insert... anche se non dovrebbe servire x stored ricalcolo precedente...
DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina.ToString(), true);
}
// mostro esito
lblOut.Text = "Registrata dichiarazione fermata";
}
else
{
lblOut.Text = string.Format("Codice evento non valido! {0}", idxEvento);
}
}
repLI.DataBind();
// sollevo evento!
if (eh_newVal != null)
{
eh_newVal(this, new EventArgs());
}
}
/// <summary>
/// url completo immagine
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public string ImgUrl(object url)
{
return string.Format("./images/iconDic/{0}.png", url);
}
/// <summary>
/// update (resetta testo)
/// </summary>
public void doUpdate()
{
lblOut.Text = "";
}
/// <summary>
/// determina se insert sia realtime o dataOra (in base a diff tra dataora sel ed evento, se superiore ad X minuto NON è realtime)
/// </summary>
public bool insRealtime
{
get
{
bool answ = true;
try
{
if (Math.Abs(dataOraEv.Subtract(DateTime.Now).TotalMinutes) > memLayer.ML.confReadInt("dltMinRealtime"))
{
answ = false;
}
}
catch
{ }
return answ;
}
}
/// <summary>
/// data-ora selezionata
/// </summary>
protected DateTime dataOraEv
{
set
{
memLayer.ML.setSessionVal("dataOraEv", value);
}
get
{
DateTime answ = DateTime.Now;
try
{
answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataOraEv"));
}
catch
{ }
return answ;
}
}
}
}
@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_dichiarazione {
/// <summary>
/// lblOut 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 lblOut;
/// <summary>
/// repLI 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.Repeater repLI;
/// <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,35 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_enrollByAuthKey.ascx.cs"
Inherits="MoonProTablet.WebUserControls.mod_enrollByAuthKey" %>
<h3>
Registrazione Con AuthKey Personale</h3>
<label for="ddlIdxDipendente">
Selezionare Operatore:</label>
<asp:DropDownList ID="ddlIdxDipendente" runat="server" DataSourceID="odsOperatori"
DataTextField="label" DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsOperatori" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.v_selOperatoriTableAdapter">
</asp:ObjectDataSource>
<br />
<label for="UserAuthKey">
UserAuthKey:</label>
<asp:TextBox runat="server" ID="txtUserAuthKey" TextMode="Password" />
<br />
<asp:Label runat="server" ID="lblWarning" Visible="false" />
<div class="ui-grid-a">
<div class="ui-block-a">
<asp:Button runat="server" ID="btnConferma" Text="Salva" data-theme="b" OnClick="btnConferma_Click" />
</div>
<div class="ui-block-b">
<asp:Button runat="server" ID="btnAnnulla" Text="Annulla" data-theme="e" CausesValidation="false"
OnClick="btnAnnulla_Click" />
</div>
</div>
<div data-role="content">
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-content-theme="a">
<h3>
Spiegazione</h3>
Questa funzione permette di inserire un devices tra quelli gestiti tramite la AuthKey
personale (da richiedere all'admin se non nota).
</div>
</div>
@@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet.WebUserControls
{
public partial class mod_enrollByAuthKey : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// salvo nuovo device...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnConferma_Click(object sender, EventArgs e)
{
bool fatto = false;
// controllo se ho i dati...
string plainUserAuthKey = txtUserAuthKey.Text.Trim();
// in primis cerco il dipendente data la authKey...
int MatrOpr = 0;
try
{
MatrOpr = Convert.ToInt32(ddlIdxDipendente.SelectedValue);
}
catch
{ }
try
{
// controllo dipendente... che sia selezionato uno valido
if (MatrOpr > 0)
{
// recupero dati...
string userAgent = "";
string DeviceName = "";
string IPv4 = "";
userAgent = Request.UserAgent;
DeviceName = Request.UserHostName;
IPv4 = Request.UserHostName;
// calcolo authKey MD5...
string md5UserAuthKey = SteamCrypto.EncryptString(plainUserAuthKey, memLayer.ML.confReadString("cookieName"));
if (DataLayer.obj.taOp.getByMatrAuthKey(MatrOpr, md5UserAuthKey).Rows.Count > 0)
{
fatto = tryEnroll(MatrOpr, userAgent, fatto, DeviceName, IPv4, md5UserAuthKey);
}
// provo con "plainUserKey"
else if (DataLayer.obj.taOp.getByMatrAuthKey(MatrOpr, plainUserAuthKey).Rows.Count > 0)
{
fatto = tryEnroll(MatrOpr, userAgent, fatto, DeviceName, IPv4, plainUserAuthKey);
}
else
{
lblWarning.Text = "AuthKey non trovata! richiedere reset ad Admin.";
lblWarning.Visible = true;
}
}
else
{
lblWarning.Text = "Dipendente non trovato!";
lblWarning.Visible = true;
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in registrazione device: {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
if (fatto)
{
Response.Redirect(memLayer.ML.confReadString("mainPage"), true);
}
}
/// <summary>
/// prova a fare enroll device data chiave...
/// </summary>
/// <param name="MatrOpr"></param>
/// <param name="userAgent"></param>
/// <param name="fatto"></param>
/// <param name="DeviceName"></param>
/// <param name="IPv4"></param>
/// <param name="userKey"></param>
/// <returns></returns>
private bool tryEnroll(int MatrOpr, string userAgent, bool fatto, string DeviceName, string IPv4, string userKey)
{
try
{
fatto = DataLayer.obj.enrollDevice(userKey, IPv4, DeviceName, userAgent, MatrOpr);
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in registrazione nuovo device con AuthKey utente: {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
return fatto;
}
/// <summary>
/// resetto tutto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAnnulla_Click(object sender, EventArgs e)
{
txtUserAuthKey.Text = "";
}
}
}
@@ -0,0 +1,69 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_enrollByAuthKey {
/// <summary>
/// ddlIdxDipendente 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 ddlIdxDipendente;
/// <summary>
/// odsOperatori 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 odsOperatori;
/// <summary>
/// txtUserAuthKey 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 txtUserAuthKey;
/// <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>
/// btnConferma 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 btnConferma;
/// <summary>
/// btnAnnulla 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 btnAnnulla;
}
}
@@ -0,0 +1,2 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_enrollByJumperAuthKey.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_enrollByJumperAuthKey" %>
<%--è una procedura automatica, niente elementi grafici!--%>
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet.WebUserControls
{
public partial class mod_enrollByJumperAuthKey : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
// procedo alla ricerca di dati via sessione x User AuthKey
tryAutoEnroll();
}
/// <summary>
/// prova a fare auto enroll
/// </summary>
public void tryAutoEnroll()
{
// recupero dati da session
string UserAuthKey = "";
int MatrOpr = 0;
string userAgent = "";
bool fatto = false;
string DeviceName = "";
string IPv4 = "";
try
{
UserAuthKey = memLayer.ML.StringSessionObj("UserAuthKey");
MatrOpr = DataLayer.MatrOpr;
userAgent = Request.UserAgent;
}
catch
{ }
// se ci sono i dati effettua tentativo di AutoEnroll del device
if (MatrOpr > 0 && UserAuthKey != "")
{
DeviceName = Request.UserHostName;
IPv4 = Request.UserHostName;
fatto = DataLayer.obj.enrollDevice(UserAuthKey, IPv4, DeviceName, userAgent, MatrOpr);
if (fatto)
{
Response.Redirect(memLayer.ML.confReadString("mainPage"));
}
}
}
}
}
@@ -0,0 +1,17 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls
{
public partial class mod_enrollByJumperAuthKey
{
}
}
@@ -0,0 +1,64 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_fermate.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_fermate" %>
<div>
<div class="ui-grid-a" style="font-size: small;">
<div class="ui-block-a">
<asp:Label runat="server" ID="lblNumGG" Text="Giorni prec." AssociatedControlID="ddlPrevDays" />
<asp:DropDownList ID="ddlPrevDays" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPrevDays_SelectedIndexChanged">
<asp:ListItem Text="1" Value="1" />
<asp:ListItem Text="2" Value="2" />
<asp:ListItem Text="3" Value="3" Selected="True" />
<asp:ListItem Text="4" Value="4" />
<asp:ListItem Text="5" Value="5" />
</asp:DropDownList>
</div>
<div class="ui-block-b">
<asp:Label runat="server" ID="lblDurataMin" Text="Durata Minima" AssociatedControlID="ddlDurataMin" />
<asp:DropDownList ID="ddlDurataMin" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlDurataMin_SelectedIndexChanged">
<asp:ListItem Text="5" Value="5" />
<asp:ListItem Text="10" Value="10" />
<asp:ListItem Text="20" Value="20" Selected="True" />
<asp:ListItem Text="30" Value="30" />
<asp:ListItem Text="60" Value="60" />
</asp:DropDownList>
</div>
</div>
<div class="elFerm">
<ul data-role="listview" data-inset="true">
<asp:Repeater ID="repComm" runat="server" DataSourceID="odsFerm">
<ItemTemplate>
<li>
<%--<div class="divSx">--%>
<asp:LinkButton runat="server" ID="btnEdit" CommandArgument='<%# Eval("InizioStato") %>' OnClick="btnEdit_Click">
<%--</div>--%>
<div style="font-size: small;" class='<%# cssDaSemaforo(Eval("Semaforo")) %>'>
<div style="padding-top: 6px;">
<div class="divSx" style="font-size: small;">
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Stato", "<b>{0}</b>") %>' />
</div>
<div class="divDx">
<asp:Label ID="Label4" runat="server" Text='<%# durataEvento(Eval("DurataMinuti")) %>' Font-Bold="false" />
</div>
</div>
<div class="clearDiv" style="font-size: xx-small; border-top: 1px solid #ACACAC; color: #ACACAC">
<div class="divSx">
<asp:Label ID="Label5" runat="server" Text='<%# Eval("InizioStato", "{0:dd/MM/yyyy HH:mm}") %>' Font-Bold="false" />
</div>
<div class="divDx">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("CodArticolo") %>' Font-Bold="false" />
</div>
</div>
</div>
</asp:LinkButton><div class="clearDiv"></div>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
<asp:ObjectDataSource ID="odsFerm" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_UtilityTableAdapters.FermiNonQualTableAdapter">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="idxMacchina" Type="String" />
<asp:ControlParameter ControlID="ddlPrevDays" DefaultValue="3" Name="gg" PropertyName="SelectedValue" Type="Int32" />
<asp:ControlParameter ControlID="ddlDurataMin" DefaultValue="10" Name="durataMin" PropertyName="SelectedValue" Type="Double" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapoDb;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_fermate : System.Web.UI.UserControl
{
/// <summary>
/// registrata richiesta
/// </summary>
public event EventHandler eh_reqEdit;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
try
{
ddlDurataMin.SelectedValue = durMin.ToString();
ddlPrevDays.SelectedValue = prevDays.ToString();
}
catch
{ }
}
}
public void doUpdate()
{
repComm.DataBind();
}
/// <summary>
/// carico x edit commento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
LinkButton lnkBtn = (LinkButton)sender;
DateTime inizioStato = Convert.ToDateTime(lnkBtn.CommandArgument);
memLayer.ML.setSessionVal("inizioStato", inizioStato);
// sollevo evento!
if (eh_reqEdit != null)
{
eh_reqEdit(this, new EventArgs());
}
}
/// <summary>
/// restituisce stringa formattata in HH:mm
/// </summary>
/// <param name="durataMinuti"></param>
/// <returns></returns>
public string durataEvento(object durataMinuti)
{
return utility.formatDurata(durataMinuti);
}
/// <summary>
/// restituisce cod CSS dato cod semaforo
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public string cssDaSemaforo(object semaforo)
{
return resoconti.mngr.cssDaCodColore(semaforo.ToString());
}
protected int prevDays
{
get
{
return memLayer.ML.IntSessionObj("prevDays");
}
set
{
memLayer.ML.setSessionVal("prevDays", value);
}
}
protected int durMin
{
get
{
return memLayer.ML.IntSessionObj("durMin");
}
set
{
memLayer.ML.setSessionVal("durMin", value);
}
}
protected void ddlPrevDays_SelectedIndexChanged(object sender, EventArgs e)
{
prevDays = Convert.ToInt16(ddlPrevDays.SelectedValue);
}
protected void ddlDurataMin_SelectedIndexChanged(object sender, EventArgs e)
{
durMin = Convert.ToInt16(ddlDurataMin.SelectedValue);
}
}
}
+69
View File
@@ -0,0 +1,69 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_fermate {
/// <summary>
/// lblNumGG 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 lblNumGG;
/// <summary>
/// ddlPrevDays 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 ddlPrevDays;
/// <summary>
/// lblDurataMin 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 lblDurataMin;
/// <summary>
/// ddlDurataMin 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 ddlDurataMin;
/// <summary>
/// repComm 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.Repeater repComm;
/// <summary>
/// odsFerm 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 odsFerm;
}
}
+18
View File
@@ -0,0 +1,18 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_footer.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_footer" %>
<asp:Panel runat="server" ID="pnlFooter" data-role="navbar" data-iconpos="top">
<ul>
<asp:Repeater ID="repLI" runat="server" DataSourceID="ods">
<ItemTemplate>
<li>
<asp:HyperLink runat="server" ID="btnTimbra" NavigateUrl='<%# Eval("NavigateUrl") %>' rel="external" Text='<%# Eval("Testo") %>'
data-role="button" data-icon='<%# Eval("icona") %>' />
</li>
</ItemTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByTipo" TypeName="MapoDb.DS_applicazioneTableAdapters.LinkMenuJQMTableAdapter">
<SelectParameters>
<asp:SessionParameter DefaultValue="-" Name="TipoLink" SessionField="TipoLink" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</ul>
</asp:Panel>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonProTablet.WebUserControls
{
public partial class mod_footer : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
+42
View File
@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_footer {
/// <summary>
/// pnlFooter 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 pnlFooter;
/// <summary>
/// repLI 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.Repeater repLI;
/// <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,33 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_insComm.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_insComm" %>
<asp:Panel runat="server" ID="pnlButtons">
<div class="ui-grid-a">
<div class="ui-block-b" data-role="content">
<asp:Button ID="btnAddCom" runat="server" data-icon="plus" Text="Commento" OnClick="btnAddCommento_Click" />
</div>
</div>
</asp:Panel>
<asp:Panel runat="server" ID="pnlDate" Visible="false">
<div class="ui-grid-a" data-role="content">
<div class="ui-block-a">
<asp:Label runat="server" ID="lblDate" AssociatedControlID="txtDate" Text="Data" />
<asp:TextBox runat="server" ID="txtDate" type="date" AutoPostBack="True" OnTextChanged="txtDate_TextChanged" />
</div>
<div class="ui-block-b">
<asp:Label runat="server" ID="lblTime" AssociatedControlID="txtTime" Text="Ora" />
<asp:TextBox runat="server" ID="txtTime" type="time" AutoPostBack="True" OnTextChanged="txtTime_TextChanged" />
</div>
</div>
<div class="ui-grid-solo" data-role="content">
<asp:Label runat="server" ID="lblCommento" AssociatedControlID="txtCommento" Text="Commento" />
<asp:TextBox runat="server" ID="txtCommento" TextMode="MultiLine" placeholder="Inserire commento" />
</div>
<div class="ui-grid-a" data-role="content">
<div class="ui-block-a">
<asp:Button runat="server" ID="btnSalva" Text="Salva" data-icon="plus" OnClick="btnSalva_Click" />
</div>
<div class="ui-block-b">
<asp:Button runat="server" ID="btnAnnulla" Text="Annulla" data-icon="delete" OnClick="btnAnnulla_Click" />
</div>
</div>
</asp:Panel>
@@ -0,0 +1,221 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapoDb;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_insComm : System.Web.UI.UserControl
{
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_inserting;
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_newVal;
/// <summary>
/// registrato nuovo valore
/// </summary>
public event EventHandler eh_reset;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnAddCommento_Click(object sender, EventArgs e)
{
dataOraEv = DateTime.Now;
showInsert();
}
protected void showInsert()
{
fixPanels(false, true, false);
// imposto valori
txtDate.Text = dataOraEv.ToString("yyyy-MM-dd");
txtTime.Text = dataOraEv.ToString("HH:mm");
txtCommento.Text = "";
// sollevo evento!
if (eh_inserting != null)
{
eh_inserting(this, new EventArgs());
}
}
private void fixPanels(bool showBtn, bool showComm, bool showEventi)
{
// mostro dati da compilare e nascondo button...
pnlButtons.Visible = showBtn;
pnlDate.Visible = !showBtn;
}
protected void btnAnnulla_Click(object sender, EventArgs e)
{
// tolgo da sessione dataOra corrente...
memLayer.ML.emptySessionVal("dataOraEv");
fixPanels(true, false, false);
// sollevo evento!
if (eh_reset != null)
{
eh_reset(this, new EventArgs());
}
}
protected void btnSalva_Click(object sender, EventArgs e)
{
salvaCommento();
}
/// <summary>
/// effettua salvataggio del commento indicato (data/ora e testo)
/// </summary>
public void salvaCommento()
{
// salvo!
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
int idxTipo = memLayer.ML.confReadInt("idxTipoCommento");
string Kanban = "KAND";
try
{
// cerco di recuperare kanban da evento
Kanban = "KA" + DataLayer.obj.taODL.getByMacchinaPeriodo(idxMacchina, dataOraEv, dataOraEv)[0].CodArticolo;
}
catch
{
Kanban = "KAND";
}
string commento = txtCommento.Text.Trim();
// elimino eventuale record precedente
try
{
DataLayer.obj.taEventi.DeleteQuery(idxMacchina, dataOraEv);
}
catch
{ }
// inserisco nuovo record
DataLayer.obj.taEventi.Insert(idxMacchina, dataOraEv, idxTipo, Kanban, commento, DataLayer.MatrOpr, "-");
doUpdate();
}
private void doUpdate()
{
// aggiorno vista...
fixPanels(true, false, false);
if (eh_newVal != null)
{
eh_newVal(this, new EventArgs());
}
}
protected void txtDate_TextChanged(object sender, EventArgs e)
{
salvaDataOra();
}
private void salvaDataOra()
{
DateTime inizioStato = DateTime.Now;
try
{
DateTime ora = Convert.ToDateTime(txtTime.Text);
inizioStato = Convert.ToDateTime(txtDate.Text).AddHours(ora.Hour).AddMinutes(ora.Minute);
}
catch
{ }
dataOraEv = inizioStato;
}
protected void txtTime_TextChanged(object sender, EventArgs e)
{
salvaDataOra();
}
public void caricaCommento()
{
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
DS_applicazione.EventListRow riga = null;
DateTime inizioStato = DateTime.Now;
try
{
inizioStato = Convert.ToDateTime(memLayer.ML.objSessionObj("inizioStato"));
riga = DataLayer.obj.taEventi.GetByMacchinaPeriodo(idxMacchina, inizioStato, inizioStato)[0];
txtDate.Text = riga.InizioStato.ToString("yyyy-MM-dd");
txtTime.Text = riga.InizioStato.ToString("HH:mm");
txtCommento.Text = riga.Value;
}
catch
{ }
fixPanels(false, true, false);
}
/// <summary>
/// determian se mostrare pulsante salva (non serve x dichiarazioni fermata)
/// </summary>
public bool showSalva
{
set
{
btnSalva.Visible = value;
}
}
/// <summary>
/// imposta la label x inserimento commento singolo / con dichiarazione fermata
/// </summary>
public string labelAddCommento
{
set
{
btnAddCom.Text = value;
}
}
/// <summary>
/// imposta data/ora del commento
/// </summary>
public DateTime dataEv
{
set
{
// salvo in sessione dataOra corrente...
dataOraEv = value;
// mostro insert!
showInsert();
}
}
/// <summary>
/// commento inserito
/// </summary>
public string commento
{
get
{
return txtCommento.Text.Trim();
}
}
/// <summary>
/// data-ora selezionata
/// </summary>
protected DateTime dataOraEv
{
set
{
memLayer.ML.setSessionVal("dataOraEv", value);
}
get
{
DateTime answ = DateTime.Now;
try
{
answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataOraEv"));
}
catch
{ }
return answ;
}
}
}
}
+114
View File
@@ -0,0 +1,114 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_insComm {
/// <summary>
/// pnlButtons 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 pnlButtons;
/// <summary>
/// btnAddCom 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 btnAddCom;
/// <summary>
/// pnlDate 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 pnlDate;
/// <summary>
/// lblDate 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 lblDate;
/// <summary>
/// txtDate 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 txtDate;
/// <summary>
/// lblTime 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 lblTime;
/// <summary>
/// txtTime 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 txtTime;
/// <summary>
/// lblCommento 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 lblCommento;
/// <summary>
/// txtCommento 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 txtCommento;
/// <summary>
/// btnSalva 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 btnSalva;
/// <summary>
/// btnAnnulla 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 btnAnnulla;
}
}
@@ -0,0 +1,43 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_mappaStato.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_mappaStato" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<div id="dettMacch">
<ul data-role="listview" data-inset="true">
<asp:Repeater ID="repLI" runat="server" DataSourceID="ods">
<ItemTemplate>
<li>
<asp:LinkButton ID="hlMacchina" runat="server" OnClick="hlMacchina_Click" CommandArgument='<%# Eval("IdxMacchina") %>'>
<img src='<%# ImgUrl(Eval("url")) %>' alt='<%# Eval("CodMacchina") %>'>
<h2>
<asp:Label runat="server" ID="lblTitle" Text='<%# Eval("Nome") %>' /></h2>
<p>
<span class='<%# cssDaSemaforo(Eval("Semaforo")) %>' style="width: 100%; display: block; padding-right: 0px;"><span style="float: left;">
<b>
<asp:Label runat="server" ID="lblStato" Text='<%# Eval("DescrizioneStato") %>' /></b></span> <span style="float: right; padding-right: 8px;">
<asp:Label runat="server" ID="lblDurata" Text='<%# formatDurata(Eval("Durata")) %>' /></span>
<br />
<span style="float: left;">
<asp:Label runat="server" ID="Label2" Text='<%# Eval("PezziProd","prod: {0}") %>' ToolTip="pz prodotti" />
/
<asp:Label runat="server" ID="lblPzLanciati" Text='<%# Eval("NumPezzi","tot: {0}") %>' ToolTip="pz lanciati" />
</span><span style="float: right; padding-right: 8px;">
<asp:Label runat="server" ID="Label1" Text='<%# Eval("PezziConf","conf: {0}") %>' ToolTip="pz confermati" />
</span></span>
</p>
<p class="ui-li-aside">
<asp:Label runat="server" ID="lblBadge" Text='<%# Eval("CodArticolo","art: {0}") %>' />
<asp:Label runat="server" ID="lblODC" Text='<%# Eval("idxODL","(ODL {0})") %>' />
</p>
</asp:LinkButton></li></ItemTemplate></asp:Repeater><asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByRefreshData"
TypeName="MapoDb.DS_ProdTempiTableAdapters.MappaStatoExplTableAdapter">
<SelectParameters>
<asp:Parameter DefaultValue="3001" Name="maxAgeSec" Type="Int32" />
<%--<asp:Parameter DefaultValue="10000" Name="maxAgeSec" Type="Int32" />--%>
</SelectParameters>
</asp:ObjectDataSource>
</ul>
<!-- timer refresh dei blocchi in mappa stato: 2 sec, 2'000 ms -->
<asp:Timer ID="Timer1" runat="server" Interval="2000" OnTick="Timer1_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_mappaStato : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// url completo immagine
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public string ImgUrl(object url)
{
return string.Format("./images/macchine/{0}", url);
}
/// <summary>
/// restituisce cod CSS dato cod semaforo
/// </summary>
/// <param name="idx"></param>
/// <returns></returns>
public string cssDaSemaforo(object semaforo)
{
return resoconti.mngr.cssDaCodColore(semaforo.ToString());
}
/// <summary>
/// fomratta durata in minuti/ore/gg a seconda del totale...
/// </summary>
/// <param name="minuti"></param>
/// <returns></returns>
public string formatDurata(object min)
{
return utility.formatDurata(min);
}
/// <summary>
/// rimanda alla pagina di dettaglio della macchina scelta
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void hlMacchina_Click(object sender, EventArgs e)
{
LinkButton lnkbtn = (LinkButton)sender;
memLayer.ML.setSessionVal("IdxMacchina", lnkbtn.CommandArgument);
Response.Redirect("~/DettaglioMacchina.aspx");
}
/// <summary>
/// fa update del controllo
/// </summary>
public void doUpdate()
{
ods.DataBind();
repLI.DataBind();
}
/// <summary>
/// timeout scaduto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Timer1_Tick(object sender, EventArgs e)
{
doUpdate();
//ScriptManager.RegisterStartupScript(Page, GetType(), "temp", "<script type='text/javascript'>$('div').trigger('create');</script>", false);
ScriptManager.RegisterStartupScript(Page, GetType(), "temp", "<script type='text/javascript'>$('#dettMacch').trigger('create');</script>", false);
}
}
}
@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_mappaStato {
/// <summary>
/// UpdatePanel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel UpdatePanel1;
/// <summary>
/// repLI 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.Repeater repLI;
/// <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>
/// Timer1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.Timer Timer1;
}
}
@@ -0,0 +1,11 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_regNewDevice.ascx.cs"
Inherits="MoonProTablet.WebUserControls.mod_regNewDevice" %>
<%@ Register Src="mod_enrollByAuthKey.ascx" TagName="mod_enrollByAuthKey" TagPrefix="uc1" %>
<%@ Register Src="mod_enrollByJumperAuthKey.ascx" TagName="mod_enrollByJumperAuthKey"
TagPrefix="uc2" %>
<div data-role="content">
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-content-theme="a">
<uc1:mod_enrollByAuthKey ID="mod_enrollByAuthKey1" runat="server" />
</div>
</div>
<uc2:mod_enrollByJumperAuthKey ID="mod_enrollByJumperAuthKey1" runat="server" />
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet.WebUserControls
{
public partial class mod_regNewDevice : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
/*************************************************************************
* REGISTRAZIONE nuovi devices
*
* ci sono tre modalità
* - idxDipendente + authKey (manuale)
* - con richiesta reset ed invio authKey (generazione pwd casuale da email dipendente + dataora in MD5, INSERENDO EMAIL e cercando se esista...)
* - con "rimbalzo" su ~/jumper.aspx?UserAuthkey={0}&idxDipendente={1}... poi messe in session x cui autosetup
*
* ***********************************************************************/
}
}
}
@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_regNewDevice {
/// <summary>
/// mod_enrollByAuthKey1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::MoonProTablet.WebUserControls.mod_enrollByAuthKey mod_enrollByAuthKey1;
/// <summary>
/// mod_enrollByJumperAuthKey1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::MoonProTablet.WebUserControls.mod_enrollByJumperAuthKey mod_enrollByJumperAuthKey1;
}
}
@@ -0,0 +1,96 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_storicoTC.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_storicoTC" %>
<div data-theme="c">
<div class="ui-grid-a">
<div class="ui-block-a" style="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 class="ui-block-b" style="text-align: center; margin: auto; vertical-align: middle;">
<h3>Storico Tempi Ciclo</h3>
</div>--%>
<div class="ui-block-b" style="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 class="ui-grid-solo" 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 BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
<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: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>
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonProTablet.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;
}
}
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!
}
}
}
+69
View File
@@ -0,0 +1,69 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.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;
}
}
@@ -0,0 +1,33 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_tempoMSMC.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_tempoMSMC" %>
<div class="ui-grid-a">
<div class="ui-block-a">
<div runat="server" id="divTesto">
<asp:TextBox runat="server" ID="txtTempo" placeholder="Tempo" AutoPostBack="true" OnTextChanged="txtTempo_TextChanged" />
</div>
<div runat="server" id="divSelettori">
<div class="ui-grid-a">
<div class="ui-block-a">
<asp:DropDownList ID="ddlMinuti" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlMinuti_SelectedIndexChanged" DataSourceID="odsMinuti" DataTextField="value" DataValueField="value" />
<asp:ObjectDataSource ID="odsMinuti" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getSubset" TypeName="MapoDb.DS_UtilityTableAdapters.v_selTallyTableAdapter">
<SelectParameters>
<asp:Parameter DefaultValue="0" Name="minVal" Type="Int32" />
<asp:Parameter DefaultValue="59" Name="maxVal" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="ui-block-b">
<asp:DropDownList ID="ddlSecondi" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlSecondi_SelectedIndexChanged" DataSourceID="odsSecondi" DataTextField="value" DataValueField="value" />
<asp:ObjectDataSource ID="odsSecondi" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getSubset" TypeName="MapoDb.DS_UtilityTableAdapters.v_selTallyTableAdapter">
<SelectParameters>
<asp:Parameter DefaultValue="0" Name="minVal" Type="Int32" />
<asp:Parameter DefaultValue="59" Name="maxVal" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
</div>
</div>
<div class="ui-block-b" data-role="content">
<asp:Label runat="server" ID="lblTempo" Text="..." />
</div>
</div>
@@ -0,0 +1,343 @@
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MoonProTablet.WebUserControls
{
public partial class mod_tempoMSMC : System.Web.UI.UserControl
{
/// <summary>
/// stringa UID univoca
/// </summary>
public string uid
{
get
{
return this.UniqueID.Replace("$", "_").Replace("-", "_");
}
}
/// <summary>
/// modalità rendering controllo
/// </summary>
public timeControlMode modoControllo { get; set; }
/// <summary>
/// modalità controllo tempo
/// </summary>
public timeMode modoTempo { get; set; }
/// <summary>
/// tempo min.cent
/// </summary>
protected decimal _tempoMC
{
get
{
decimal answ = 0;
try
{
answ = Convert.ToDecimal(memLayer.ML.objSessionObj(string.Format("tempoMC-{0}", uid)));
}
catch
{ }
return answ;
}
set
{
memLayer.ML.setSessionVal(string.Format("tempoMC-{0}", uid), value);
}
}
/// <summary>
/// tempo min:sec
/// </summary>
protected TimeSpan _tempoMS
{
get
{
TimeSpan answ = new TimeSpan(0, 0, 0);
try
{
answ = (TimeSpan)memLayer.ML.objSessionObj(string.Format("tempoMS-{0}", uid));
}
catch
{ }
return answ;
}
set
{
memLayer.ML.setSessionVal(string.Format("tempoMS-{0}", uid), value);
}
}
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
// a secondo del modo di controllo mostro textbox o selettori...
bool showTesto = true;
if (modoControllo == timeControlMode.testo)
{
showTesto = true;
}
else
{
showTesto = false;
}
// sistemo visualizzazione dei 2 div
divTesto.Visible = showTesto;
divSelettori.Visible = !showTesto;
if (!Page.IsPostBack)
{
// fix numero item secondi
odsSecondi.SelectParameters.Clear();
odsSecondi.SelectParameters.Add("minVal", "0");
odsSecondi.SelectParameters.Add("maxVal", numItemSec.ToString());
// fix visualizzazione
showControls();
}
}
/// <summary>
/// mostra i controlli secondo richiesta
/// </summary>
private void showControls()
{
if (modoControllo == timeControlMode.testo)
{
if (modoTempo == timeMode.MC)
{
txtTempo.Text = string.Format("{0:0.000}", tempoMC);
}
else
{
txtTempo.Text = string.Format("{0:#0}:{1:00}", tempoMS.Minutes, tempoMS.Seconds);
}
}
else
{
ddlMinuti.SelectedValue = tempoMS.Minutes.ToString();
if (modoTempo == timeMode.MC)
{
ddlSecondi.SelectedValue = Convert.ToInt32((tempoMC - Math.Floor(tempoMC)) * 100).ToString();
}
else
{
ddlSecondi.SelectedValue = tempoMS.Seconds.ToString();
}
}
// fix label...
if (modoTempo == timeMode.MC)
{
lblTempo.Text = string.Format("--> {0:#0}' {1:00}s (min,sec)", tempoMS.Minutes, tempoMS.Seconds);
}
else
{
lblTempo.Text = string.Format("--> {0:0.000} (min,cent)", tempoMC);
}
}
/// <summary>
/// num item x controllo secondi/centesimi
/// </summary>
public int numItemSec
{
get
{
int answ = 60;
if (modoTempo == timeMode.MS)
{
answ = 59;
}
else
{
answ = 99;
}
return answ;
}
}
/// <summary>
/// tempo selezionato in formato Minuti Secondi
/// </summary>
public TimeSpan tempoMS
{
get
{
return _tempoMS;
}
set
{
_tempoMS = value;
_tempoMC = minSec2Cent(value);
showControls();
}
}
/// <summary>
/// verifica se TC sia stato caricato dai controlli, se zero va caricato (almento tentato caricamento...)
/// </summary>
public void checkTC()
{
if (tempoMC == 0)
{
if (modoControllo == timeControlMode.testo)
{
updFromTextBox();
}
else
{
updFromDropDown();
}
}
}
/// <summary>
/// tempo selezionato in formato Minuti Centesimi
/// </summary>
public decimal tempoMC
{
get
{
return _tempoMC;
}
set
{
_tempoMC = value;
_tempoMS = minCent2Sec(value);
showControls();
}
}
/// <summary>
/// conversione da tempo minuti/secondi a minuti centesimali
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
protected decimal minSec2Cent(TimeSpan valore)
{
Decimal answ = 0;
try
{
answ = Math.Round((valore.Minutes + (decimal)valore.Seconds / 60), 3);
}
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;
}
/// <summary>
/// cambiato valore tempo...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempo_TextChanged(object sender, EventArgs e)
{
updFromTextBox();
}
/// <summary>
/// update da casella testo
/// </summary>
private void updFromTextBox()
{
if (modoControllo == timeControlMode.testo)
{
if (modoTempo == timeMode.MC)
{
tempoMC = Convert.ToDecimal(txtTempo.Text.Replace(".", ","));
}
else
{
string tempoDP = txtTempo.Text.Replace(".", ":").Replace(",", ":");
int min = 0;
int sec = 0;
try
{
min = Convert.ToInt32(tempoDP.Substring(0, tempoDP.IndexOf(":")));
sec = Convert.ToInt32(tempoDP.Substring(tempoDP.IndexOf(":") + 1, tempoDP.Length - tempoDP.IndexOf(":") - 1));
}
catch
{ }
tempoMS = new TimeSpan(0, min, sec);
}
}
}
/// <summary>
/// update da controlli dropdown
/// </summary>
private void updFromDropDown()
{
if (modoControllo == timeControlMode.selettori)
{
if (modoTempo == timeMode.MS)
{
tempoMS = new TimeSpan(0, Convert.ToInt32(ddlMinuti.SelectedValue), Convert.ToInt32(ddlSecondi.SelectedValue));
}
else
{
tempoMC = Convert.ToDecimal(Convert.ToDecimal(ddlMinuti.SelectedValue) + Convert.ToDecimal(ddlSecondi.SelectedValue) / 100);
}
}
}
/// <summary>
/// selezione minuti
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMinuti_SelectedIndexChanged(object sender, EventArgs e)
{
updFromDropDown();
}
/// <summary>
/// selezione secondi/centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlSecondi_SelectedIndexChanged(object sender, EventArgs e)
{
updFromDropDown();
}
}
}
/// <summary>
/// modalità tempo principale (Minuti Secondi o Minuti Centesimali=
/// </summary>
public enum timeMode
{
/// <summary>
/// Minuti Secondi
/// </summary>
MS = 0,
/// <summary>
/// Minuti Centesimali
/// </summary>
MC = 1
}
/// <summary>
/// modalità di visualizzazione ed interazione controllo tempo
/// </summary>
public enum timeControlMode
{
/// <summary>
/// controllo textbox
/// </summary>
testo = 0,
/// <summary>
/// selettori dropdown list
/// </summary>
selettori = 1
}
+87
View File
@@ -0,0 +1,87 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_tempoMSMC {
/// <summary>
/// divTesto 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 divTesto;
/// <summary>
/// txtTempo 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 txtTempo;
/// <summary>
/// divSelettori 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 divSelettori;
/// <summary>
/// ddlMinuti 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 ddlMinuti;
/// <summary>
/// odsMinuti 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 odsMinuti;
/// <summary>
/// ddlSecondi 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 ddlSecondi;
/// <summary>
/// odsSecondi 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 odsSecondi;
/// <summary>
/// lblTempo 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 lblTempo;
}
}
+24
View File
@@ -0,0 +1,24 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_title.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_title" %>
<div class="ui-grid-solo" style="color: white;">
<div class="divSx">
<div style="margin: 0px 4px; text-align: left; font-size: 2.4em">
<asp:Image ID="logoSW" ImageUrl="~/images/logoSteamware.png" runat="server" Height="40px" />
MoonProTablet
</div>
</div>
<div class="divDx">
<div style="margin: 0px 4px; text-align: right;font-size: 11pt;">
<asp:Label runat="server" ID="lblSwData" />
|
<asp:Label runat="server" ID="lblData" />
</div>
<div style="margin: 0px 4px; text-align: right; font-size: 9pt;">
<asp:Label runat="server" ID="lblIpData" />
|
<asp:Label runat="server" ID="lblVers" />
</div>
</div>
</div>
<!-- timer refresh intera pagina: 1 minuti, 0'000 ms -->
<asp:Timer ID="Timer1" runat="server" Interval="60000" OnTick="Timer1_Tick">
</asp:Timer>
+145
View File
@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
using System.Configuration;
namespace MoonProTablet.WebUserControls
{
public partial class mod_title : System.Web.UI.UserControl
{
/// <summary>
/// user agent corrente
/// </summary>
protected string userAgent = "";
/// <summary>
/// IP corrente
/// </summary>
protected string postazione_IP = "";
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
// se ho user/dominio e matricola in sessione NON controllo coockie
if (user_std.UtSn.utente == "" || user_std.UtSn.dominio == "" || DataLayer.MatrOpr == 0)
{
// altrimenti controllo se c'è utente in sessione..
checkAuthCookieMoonProTablet();
}
// sistemo visualizzazione
postazione_IP = Request.UserHostName;
lblIpData.Text = postazione_IP;
lblData.Text = string.Format("{0:dd/MM/yy - HH:mm:ss}", DateTime.Now);
// cerco in sessione i vari dati disponibili...
string cognomeNome = "";
try
{
cognomeNome = user_std.UtSn.CognomeNome;
}
catch
{ }
string swData = "";
if (cognomeNome != "")
{
swData = cognomeNome;
}
else if (MapoDb.DataLayer.MatrOpr > 0)
{
swData = MapoDb.DataLayer.CognomeNomeOpr;
}
else
{
swData = "MoonProTablet";
}
lblSwData.Text = swData;
//lblVers.Text = string.Format("{0}.{1}", memLayer.ML.confReadString("mainRev"), memLayer.ML.confReadString("minRev"));
lblVers.Text = string.Format("v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
}
/// <summary>
/// verifica al presenza di un cookie VALIDO per autorizzare il device
/// </summary>
private void checkAuthCookieMoonProTablet()
{
Uri MyUrl = Request.Url;
string delimStr = "/";
char[] delimiter = delimStr.ToCharArray();
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
int n = finalUrl.Length;
string _paginaCorrente = finalUrl[n - 1].ToString();
try
{
HttpCookie cookie = Request.Cookies[memLayer.ML.confReadString("cookieName")];
if (cookie == null || cookie.Value == "")
{
// rimando pagina x registrazione devices
logger.lg.scriviLog("Cookie non valido / non trovato", tipoLog.STARTUP);
Response.Redirect("~/regNewDevice.aspx");
}
else
{
// ricavo utente da cookie...
string devSecret = cookie.Value;
DS_devices.AnagDevicesRow device = null;
// cerco il device...ogni dipendente può averne + di 1 registrato a suo nome...
string UsrName = "";
string Dominio = "";
try
{
logger.lg.scriviLog(string.Format("Cookie trovato con devSecret {0}", devSecret), tipoLog.STARTUP);
device = DataWrap.DW.taAnagDev.getByDeviceSecret(devSecret)[0];
UsrName = device.User_Name;
Dominio = device.Dominio;
DataLayer.MatrOpr = device.MatrOpr; // salvo MatrOpr!
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore recupero dati da cookie:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
if (UsrName != "" && Dominio != "")
{
logger.lg.scriviLog(string.Format("Dati utente da cookie: dominio {0}, user:{1}", Dominio, UsrName), tipoLog.STARTUP);
// aggiorno descrizione (user agent) ed IP...
userAgent = Request.UserAgent;
postazione_IP = Request.UserHostName;
// controllo IP e DeviceDescription x eventuale update
if ((device.lastIPv4 != postazione_IP) || (device.Description != userAgent))
{
// salvo ultimo "contatto" del device aggiornando descrizione ed IP
DataWrap.DW.taAnagDev.updateIP(device.IdxDevice, DateTime.Now, postazione_IP, userAgent);
}
// avvio utente...
user_std.UtSn.startUpUtente(Dominio, UsrName);
}
else
{
// svuoto cookie...
memLayer.ML.emptyCookieVal(memLayer.ML.confReadString("cookieName"));
// rimando pagina x registrazione devices
logger.lg.scriviLog(string.Format("Dominio / UsrName non validi / non trovati:{0}devSec:{1}{0}UsrName{2}{0}Dominio{3}", Environment.NewLine, devSecret, UsrName, Dominio), tipoLog.STARTUP);
Response.Redirect("~/regNewDevice.aspx");
}
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Errore in checkAuthCookie:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
}
/// <summary>
/// evento timer
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Timer1_Tick(object sender, EventArgs e)
{
lblData.Text = string.Format("{0:dd/MM/yyyy - HH:mm:ss}", DateTime.Now);
}
}
}
+69
View File
@@ -0,0 +1,69 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_title {
/// <summary>
/// logoSW 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.Image logoSW;
/// <summary>
/// lblSwData 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 lblSwData;
/// <summary>
/// lblData 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 lblData;
/// <summary>
/// lblIpData 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 lblIpData;
/// <summary>
/// lblVers 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 lblVers;
/// <summary>
/// Timer1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.Timer Timer1;
}
}
+42
View File
@@ -0,0 +1,42 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_turni.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_turni" %>
<!-- turni -->
<div data-theme="c">
<div class="ui-grid-a">
<div class="ui-block-a" style="text-align: right; padding-right: 10px; vertical-align: middle;">
<h3>
Turno 1:</h3>
</div>
<div class="ui-block-b">
<asp:DropDownList name="flip-1" runat="server" ID="ddlT1" data-role="slider" AutoPostBack="true" OnSelectedIndexChanged="ddlT1_SelectedIndexChanged">
<asp:ListItem Text="Fermo" Value="False" />
<asp:ListItem Text="Attivo" Value="True" />
</asp:DropDownList>
</div>
</div>
<div class="ui-grid-a">
<div class="ui-block-a" style="text-align: right; padding-right: 10px; vertical-align: middle;">
<h3>
Turno 2:</h3>
</div>
<div class="ui-block-b">
<asp:DropDownList name="flip-2" runat="server" ID="ddlT2" data-role="slider" AutoPostBack="true" OnSelectedIndexChanged="ddlT2_SelectedIndexChanged">
<asp:ListItem Text="Fermo" Value="False" />
<asp:ListItem Text="Attivo" Value="True" />
</asp:DropDownList>
</div>
</div>
<div class="ui-grid-a">
<div class="ui-block-a" style="text-align: right; padding-right: 10px; vertical-align: middle;">
<h3>
Turno 3:</h3>
</div>
<div class="ui-block-b">
<asp:DropDownList name="flip-3" runat="server" ID="ddlT3" data-role="slider" AutoPostBack="true" OnSelectedIndexChanged="ddlT3_SelectedIndexChanged">
<asp:ListItem Text="Fermo" Value="False" />
<asp:ListItem Text="Attivo" Value="True" />
</asp:DropDownList>
</div>
</div>
</div>
<!-- /turni -->
@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet.WebUserControls
{
public partial class mod_turni : System.Web.UI.UserControl
{
/// <summary>
/// idx macchina selezionata
/// </summary>
public int idxMacchina
{
get
{
return memLayer.ML.IntSessionObj("IdxMacchina");
}
set
{
memLayer.ML.setSessionVal("IdxMacchina", value);
}
}
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
setupTurni();
}
/// <summary>
/// setta i valori turni attivi x macchina
/// </summary>
private void setupTurni()
{
// carico dati macchina attiva...
try
{
DS_ProdTempi.TurniMacchinaRow rigaTurni = DataLayer.obj.taTurniMacc.getByIdxMacc(idxMacchina.ToString())[0];
ddlT1.SelectedValue = rigaTurni.T1.ToString();
ddlT2.SelectedValue = rigaTurni.T2.ToString();
ddlT3.SelectedValue = rigaTurni.T3.ToString();
}
catch
{ }
}
/// <summary>
/// fa toggle del valore attivo/disattivo del turno
/// </summary>
/// <param name="turno"></param>
private void toggleTurno(int turno)
{
DataLayer.obj.taTurniMacc.stp_turniMacchineUpdateTurno(idxMacchina.ToString(), turno);
setupTurni();
}
protected void ddlT1_SelectedIndexChanged(object sender, EventArgs e)
{
toggleTurno(1);
}
protected void ddlT2_SelectedIndexChanged(object sender, EventArgs e)
{
toggleTurno(2);
}
protected void ddlT3_SelectedIndexChanged(object sender, EventArgs e)
{
toggleTurno(3);
}
}
}
+42
View File
@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <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 MoonProTablet.WebUserControls {
public partial class mod_turni {
/// <summary>
/// ddlT1 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 ddlT1;
/// <summary>
/// ddlT2 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 ddlT2;
/// <summary>
/// ddlT3 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 ddlT3;
}
}