Eliminato pag UI (NON usate)
This commit is contained in:
@@ -358,13 +358,6 @@
|
||||
<Compile Include="test.aspx.designer.cs">
|
||||
<DependentUpon>test.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI.aspx.cs">
|
||||
<DependentUpon>UI.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI.aspx.designer.cs">
|
||||
<DependentUpon>UI.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewSwitcher.ascx.cs">
|
||||
<DependentUpon>ViewSwitcher.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -583,13 +576,6 @@
|
||||
<DependentUpon>mod_statoMacchine.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WebUserControls\mod_UI.ascx.cs">
|
||||
<DependentUpon>mod_UI.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\mod_UI.ascx.designer.cs">
|
||||
<DependentUpon>mod_UI.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WS\AutoCompletamento.asmx.cs">
|
||||
<DependentUpon>AutoCompletamento.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
@@ -862,7 +848,6 @@
|
||||
<Content Include="excelExportDatiConfermati.aspx" />
|
||||
<Content Include="unauthorized.aspx" />
|
||||
<Content Include="WebMasterPages\MAPO_empty_refresh30_full.master" />
|
||||
<Content Include="UI.aspx" />
|
||||
<Content Include="WebMasterPages\MAPO_empty_refresh30.master" />
|
||||
<Content Include="Semaforo.aspx" />
|
||||
<Content Include="DettaglioMacchina.aspx" />
|
||||
@@ -891,7 +876,6 @@
|
||||
<Content Include="WebUserControls\mod_realtimeClock.ascx" />
|
||||
<Content Include="WebUserControls\mod_schermataMacchina.ascx" />
|
||||
<Content Include="WebUserControls\mod_semaforo.ascx" />
|
||||
<Content Include="WebUserControls\mod_UI.ascx" />
|
||||
<Content Include="packages.config" />
|
||||
<Content Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/MAPO_empty.master" AutoEventWireup="true" CodeBehind="UI.aspx.cs" Inherits="MoonPro.UI" %>
|
||||
<%@ Register src="WebUserControls/mod_UI.ascx" tagname="mod_UI" tagprefix="uc1" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
|
||||
<uc1:mod_UI ID="mod_UI1" runat="server" />
|
||||
</asp:Content>
|
||||
@@ -1,54 +0,0 @@
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
|
||||
namespace MoonPro
|
||||
{
|
||||
public partial class UI : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// ricavo i parametri in GET x quale postazione e macchina mostrare
|
||||
string idxPostazione = Request.QueryString["idxPostazione"];
|
||||
string idxMacchina = Request.QueryString["idxMacchina"];
|
||||
string barcode = Request.QueryString["barcode"];
|
||||
bool fullUrl = ((idxPostazione != "") && (idxPostazione != null) && (idxMacchina != "") && (idxMacchina != null));
|
||||
if ((idxPostazione == "") || (idxPostazione == null))
|
||||
{
|
||||
// leggo da default valori postazione e macchina SE non ne avessi a disposizione da pagina...
|
||||
idxPostazione = memLayer.ML.confReadString("idxPostazioneStd");
|
||||
}
|
||||
if ((idxMacchina == "") || (idxMacchina == null))
|
||||
{
|
||||
// leggo da default valori postazione e macchina SE non ne avessi a disposizione da pagina...
|
||||
try
|
||||
{
|
||||
idxMacchina = DataLayer.obj.taPostazioni.getByIdxPostaz(idxPostazione)[0].IdxMacchina;
|
||||
}
|
||||
catch
|
||||
{
|
||||
idxMacchina = memLayer.ML.confReadString("idxMacchinaStd");
|
||||
}
|
||||
}
|
||||
if (!fullUrl)
|
||||
{
|
||||
//ricarico la pagina...
|
||||
string urlCompleto = string.Format("~/UI.aspx?idxPostazione={0}&idxMacchina={1}", idxPostazione, idxMacchina);
|
||||
if ((barcode != "") && (barcode != null))
|
||||
{
|
||||
urlCompleto += string.Format("&barcode={0}", barcode);
|
||||
}
|
||||
Response.Redirect(urlCompleto);
|
||||
}
|
||||
// controllo se ci siano barcode
|
||||
if ((barcode != "") && (barcode != null))
|
||||
{
|
||||
mod_UI1.BarCode = barcode;
|
||||
}
|
||||
// inizializzo correttamente il controllo
|
||||
mod_UI1.idxPostazione = idxPostazione;
|
||||
mod_UI1.idxMacchina = idxMacchina;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-25
@@ -1,25 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MoonPro
|
||||
{
|
||||
|
||||
|
||||
public partial class UI {
|
||||
|
||||
/// <summary>
|
||||
/// mod_UI1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::MoonPro.WebUserControls.mod_UI mod_UI1;
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_UI.ascx.cs" Inherits="MoonPro.WebUserControls.mod_UI" %>
|
||||
<div style="text-align: center; margin: auto; width: 800px;">
|
||||
<asp:Panel runat="server" ID="pnlMessaggi" Visible="false">
|
||||
<div style="text-align: center;">
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblTitolo" CssClass="lblTitoloUI" />
|
||||
</div>
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblMess" CssClass="lblMessUI" />
|
||||
</div>
|
||||
<div>
|
||||
<asp:Label runat="server" ID="lblODLCorrente" CssClass="lblTitoloUImini" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="pnlInterazione">
|
||||
<div style="text-align: center; background-color: #FAFAFA;">
|
||||
<%--qui va l'interazione con l'utente--%>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Panel ID="pnlProduzione" runat="server">
|
||||
<div style="float: right;">
|
||||
<b>Turni Attivi</b>
|
||||
<asp:DetailsView ID="dtView" runat="server" DataSourceID="odsTurni" AutoGenerateRows="False"
|
||||
DataKeyNames="IdxMacchina">
|
||||
<Fields>
|
||||
<asp:TemplateField HeaderText="T1">
|
||||
<ItemTemplate>
|
||||
<asp:Panel runat="server" ID="pnlT1" CssClass='<%# coloreDaTurno(Eval("T1")) %>'>
|
||||
<asp:Label in="lblT1" runat="server" Text='<%# traduci("labelT1") %>' />
|
||||
</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='<%# traduci("labelT2") %>' />
|
||||
</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='<%# traduci("labelT3") %>' />
|
||||
</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="idxMacchinaUI" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<br />
|
||||
<div class="semaforoVerde" style="width: 100px; text-align: center;">
|
||||
Turno Aperto
|
||||
</div>
|
||||
<div class="semaforoSpento" style="width: 100px; text-align: center;">
|
||||
Turno Chiuso
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: center; margin: auto; width: 600px;">
|
||||
<%--<table class="UI">--%>
|
||||
<table cellpadding="3" cellspacing="0" style="font-size: x-small; border: solid 1px #666666;">
|
||||
<tr>
|
||||
<td colspan="4" style="width: 500px; color: White; background-color: #333333;">
|
||||
<asp:Label runat="server" ID="lblOdl" Font-Bold="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="background-color: #CDCDEF; color: Black; 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 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 style="background-color: #CDCDEF; color: Black; 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>
|
||||
<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 style="background-color: #CDCDEF; color: Black; text-align: center;">
|
||||
<td>
|
||||
Tc Medio
|
||||
</td>
|
||||
<td>
|
||||
Tc Lavoro
|
||||
</td>
|
||||
<td>
|
||||
Tc Tecnico
|
||||
</td>
|
||||
<td>
|
||||
Tc impostato
|
||||
</td>
|
||||
</tr>
|
||||
<tr 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>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
@@ -1,850 +0,0 @@
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
|
||||
namespace MoonPro.WebUserControls
|
||||
{
|
||||
public partial class mod_UI : System.Web.UI.UserControl
|
||||
{
|
||||
protected string _bCode = "";
|
||||
protected MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
|
||||
/// <summary>
|
||||
/// definisce se edit abilitato x utenti "admin"
|
||||
/// </summary>
|
||||
protected bool adminInput
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.BoolSessionObj("adminInput");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("adminInput", value);
|
||||
}
|
||||
}
|
||||
/// <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();
|
||||
checkScadenze();
|
||||
updateUI();
|
||||
updateTurni();
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna classi grafiche turni
|
||||
/// </summary>
|
||||
protected void updateTurni()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica che non siano scaduti i termini dell'input utente admine nel caso resetta titoli...
|
||||
/// </summary>
|
||||
private void checkScadenze()
|
||||
{
|
||||
DS_ProdTempi.PostazioniMapoRow rigaPost = DataLayer.obj.taPostazioni.getByIdxPostaz(idxPostazione)[0];
|
||||
if (rigaPost == null)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore: manca record postazione per {0}", idxPostazione), tipoLog.ERROR);
|
||||
}
|
||||
DateTime scadenza = rigaPost.InputUntil;
|
||||
if (scadenza < DateTime.Now)
|
||||
{
|
||||
if (adminInput)
|
||||
{
|
||||
adminInput = false;
|
||||
memLayer.ML.emptySessionVal("lblTitoloUI");
|
||||
memLayer.ML.emptySessionVal("lblMessUI");
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// controllo se ci sia qualcosa da mostrare...
|
||||
/// </summary>
|
||||
private void updateUI()
|
||||
{
|
||||
bool hasTitolo = memLayer.ML.isInSessionObject("lblTitoloUI");
|
||||
bool hasMess = memLayer.ML.isInSessionObject("lblMessUI");
|
||||
if (hasTitolo && hasMess)
|
||||
{
|
||||
showMess(memLayer.ML.StringSessionObj("lblTitoloUI"), memLayer.ML.StringSessionObj("lblMessUI"));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce una riga operatore data al matricola
|
||||
/// </summary>
|
||||
/// <param name="MatrOper"></param>
|
||||
/// <returns></returns>
|
||||
protected DS_applicazione.AnagraficaOperatoriRow getRigaOperatore(int MatrOper)
|
||||
{
|
||||
try
|
||||
{
|
||||
return DataLayer.obj.taOp.getByMatrOpr(MatrOper)[0];
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Codice matricola operatore non trovato! {0}", BarCode));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// popola le labels
|
||||
/// </summary>
|
||||
private void popolaLabels()
|
||||
{
|
||||
int odl = 0;
|
||||
DateTime dataFrom = DateTime.Now;
|
||||
DateTime dataTo = DateTime.Now;
|
||||
// label ODL
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0];
|
||||
odl = rigaOdl.IdxODL;
|
||||
dataFrom = rigaOdl.DataInizio;
|
||||
lblOdl.Text = string.Format("ODL num: {0}, iniziato il {1:dd/MM/yy} alle {1:HH:mm}", odl, dataFrom);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblOdl.Text = "n/a";
|
||||
}
|
||||
/************************************
|
||||
* data la postazione corrente decide cosa mostrare e come
|
||||
************************************/
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getDatiProdMacchinaRow rigaProd = DataLayer.obj.taDatiProdMacch.GetData(idxMacchina)[0];
|
||||
lblCodArticolo.Text = rigaProd.CodArticolo;
|
||||
lblNumPzLanciati.Text = string.Format("{0} pz.", rigaProd.PezziLanciati);
|
||||
lblNumPzConf.Text = string.Format("{0} pz.", rigaProd.PezziConf);
|
||||
lblNumPzFatti.Text = string.Format("({0} pz.)", rigaProd.PezziProd);
|
||||
|
||||
|
||||
/************************************
|
||||
* calcolo efficienza totale
|
||||
* se il calcolo non è possibile mette n/a
|
||||
************************************/
|
||||
decimal tempoProd = rigaProd.TCAssegnato * rigaProd.PezziConf;
|
||||
try
|
||||
{
|
||||
lblEfficienzaTot.Text = Convert.ToString(String.Format("{0:p2}", tempoProd / rigaProd.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 / rigaProd.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 / rigaProd.TempoRun / 100));
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblEfficienzaEff.Text = "n/a";
|
||||
}
|
||||
|
||||
/************************************
|
||||
* imposto i TEMPI CICLO
|
||||
************************************/
|
||||
// riporto Tempo ciclo impostato
|
||||
lblTcImpostato.Text = Convert.ToString(String.Format("{0:0.###}", rigaProd.TCAssegnato));
|
||||
// riporto Tempo ciclo medio
|
||||
lblTcMedio.Text = Convert.ToString(String.Format("{0:0.###}", rigaProd.TCMedio));
|
||||
lblTcMedioRT.Text = Convert.ToString(String.Format("({0:0.###})", rigaProd.TCMedioRT));
|
||||
// riporto Tempo ciclo lavoro
|
||||
lblTcLavoro.Text = Convert.ToString(String.Format("{0:0.###}", rigaProd.TCLav));
|
||||
lblTcLavoroRT.Text = Convert.ToString(String.Format("({0:0.###})", rigaProd.TCLavRT));
|
||||
// riporto Tempo ciclo effettivo/tecnico, come media dei 10 migliori delle ultime 8 ore
|
||||
lblTcEffettivo.Text = Convert.ToString(String.Format("{0:0.###}", rigaProd.TCEff));
|
||||
lblTcEffettivoRT.Text = Convert.ToString(String.Format("({0:0.###})", rigaProd.TCEffRT));
|
||||
|
||||
/************************************
|
||||
* Sistemo efficienze RT da tempi ciclo
|
||||
************************************/
|
||||
try
|
||||
{
|
||||
lblEfficienzaTotRT.Text = Convert.ToString(String.Format("({0:p2})", rigaProd.TCAssegnato / rigaProd.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})", rigaProd.TCAssegnato / rigaProd.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})", rigaProd.TCAssegnato / rigaProd.TCEffRT));
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblEfficienzaEffRT.Text = "n/a";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// codice barcode
|
||||
/// </summary>
|
||||
public string BarCode
|
||||
{
|
||||
set
|
||||
{
|
||||
_bCode = value;
|
||||
// eseguo codice...
|
||||
decodeBCode();
|
||||
}
|
||||
get
|
||||
{
|
||||
return _bCode;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// mostra il messaggio indicato
|
||||
/// </summary>
|
||||
/// <param name="titolo"></param>
|
||||
/// <param name="messaggio"></param>
|
||||
protected void showMess(string titolo, string messaggio)
|
||||
{
|
||||
pnlMessaggi.Visible = true;
|
||||
lblTitolo.Text = titolo;
|
||||
lblMess.Text = messaggio;
|
||||
}
|
||||
/// <summary>
|
||||
/// idxMacchina
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("idxMacchinaUI");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxMacchinaUI", value);
|
||||
setMacchinaPostazione();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idxPostazione
|
||||
/// </summary>
|
||||
public string idxPostazione
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("idxPostazioneUI");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxPostazioneUI", value);
|
||||
// calcolo la macchina...
|
||||
setMacchinaPostazione();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna associazione codice macchina e postazione su DB
|
||||
/// </summary>
|
||||
private void setMacchinaPostazione()
|
||||
{
|
||||
// salvo associazione macchina / postazione se entrambe != ""
|
||||
if (idxMacchina != "" && idxPostazione != "")
|
||||
{
|
||||
DataLayer.obj.taPostazioni.updateMacchina(idxPostazione, idxMacchina);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// assegna il tipo di barcode dalal stringa passata
|
||||
/// </summary>
|
||||
/// <param name="_tipoBCode"></param>
|
||||
private void assegnaTipoBarcode(out tipoBarcode _tipoBCode)
|
||||
{
|
||||
// leggo le conf di gestione del barcode
|
||||
string prefDichProd = memLayer.ML.confReadString("prefDichProd");
|
||||
string prefDichFerm = memLayer.ML.confReadString("prefDichFerm");
|
||||
string prefDichOp = memLayer.ML.confReadString("prefDichOp");
|
||||
string prefDichCodArt = memLayer.ML.confReadString("prefDichCodArt");
|
||||
string prefDichAttrezzaggio = memLayer.ML.confReadString("prefDichAttrezzaggio");
|
||||
string prefModTurno = memLayer.ML.confReadString("prefModTurno");
|
||||
_tipoBCode = tipoBarcode.nd;
|
||||
// prendo le prime 2 cifre del barcode x capirne la natura
|
||||
string prefBarcode = BarCode.Substring(0, 2);
|
||||
if (prefBarcode == prefDichProd)
|
||||
{
|
||||
_tipoBCode = tipoBarcode.confermaProduzione;
|
||||
}
|
||||
else if (prefBarcode == prefDichFerm)
|
||||
{
|
||||
_tipoBCode = tipoBarcode.dichiaraFermata;
|
||||
}
|
||||
else if (prefBarcode == prefDichOp)
|
||||
{
|
||||
_tipoBCode = tipoBarcode.matrOperatore;
|
||||
}
|
||||
else if (prefBarcode == prefDichCodArt)
|
||||
{
|
||||
_tipoBCode = tipoBarcode.codArticolo;
|
||||
}
|
||||
else if (prefBarcode == prefDichAttrezzaggio)
|
||||
{
|
||||
_tipoBCode = tipoBarcode.attrezzaggio;
|
||||
}
|
||||
else if (prefBarcode == prefModTurno)
|
||||
{
|
||||
_tipoBCode = tipoBarcode.modificaTurno;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// esegue decodifica barcode
|
||||
/// </summary>
|
||||
private void decodeBCode()
|
||||
{
|
||||
// calcolo il tipo di barcode ricevuto
|
||||
tipoBarcode _tipoBCode;
|
||||
assegnaTipoBarcode(out _tipoBCode);
|
||||
// in primis verifico se sia abilitato input alla postazione
|
||||
if (adminInput)
|
||||
{
|
||||
// in base al tipo di barcode definisco il da farsi...
|
||||
switch (_tipoBCode)
|
||||
{
|
||||
case tipoBarcode.nd:
|
||||
// non faccio nulla
|
||||
break;
|
||||
case tipoBarcode.matrOperatore:
|
||||
processaCartellinoOperatore();
|
||||
break;
|
||||
case tipoBarcode.codArticolo:
|
||||
// x ora non serve
|
||||
break;
|
||||
case tipoBarcode.attrezzaggio:
|
||||
processaAttrezzaggio();
|
||||
break;
|
||||
case tipoBarcode.confermaProduzione:
|
||||
processaProduzione();
|
||||
break;
|
||||
case tipoBarcode.dichiaraFermata:
|
||||
processaDichiaraFermata();
|
||||
break;
|
||||
case tipoBarcode.modificaTurno:
|
||||
processaModificaTurno();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else // edit avanzato non permesso, possibile solo sparare barcode utente...
|
||||
{
|
||||
// controllo se sia un barcode utente...
|
||||
if (_tipoBCode == tipoBarcode.matrOperatore)
|
||||
{
|
||||
processaCartellinoOperatore();
|
||||
}
|
||||
else
|
||||
{
|
||||
// mostra warning xché interazione non permessa
|
||||
salvaRicarica("Abilitazione richiesta!", "Codice non accettato: prima registrare barcode utente abilitato");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// chiama modifica stato turno
|
||||
/// </summary>
|
||||
private void processaModificaTurno()
|
||||
{
|
||||
string prefModTurno = memLayer.ML.confReadString("prefModTurno");
|
||||
// recupero dati evento...
|
||||
int numTurno = 0;
|
||||
try
|
||||
{
|
||||
numTurno = Convert.ToInt32(BarCode.Replace(prefModTurno, ""));
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Barcode modifica turno non valido! {0}", BarCode));
|
||||
}
|
||||
if (numTurno > 0)
|
||||
{
|
||||
DataLayer.obj.taTurniMacc.stp_turniMacchineUpdateTurno(idxMacchina, numTurno);
|
||||
// ricarico!
|
||||
salvaRicarica("Dichiarazione fermata", "Registrata modifica turno");
|
||||
}
|
||||
else
|
||||
{
|
||||
salvaRicarica("Errore", string.Format("Codice modifica turno non valido! {0}", BarCode));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// contiene in sessione i pezzi da confermare
|
||||
/// </summary>
|
||||
protected int prod2confirm
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.IntSessionObj("prod2confirm");
|
||||
}
|
||||
catch
|
||||
{
|
||||
answ = -1;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("prod2confirm", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// processa barcode di dichiarazione e conferma produzione
|
||||
/// </summary>
|
||||
private void processaProduzione()
|
||||
{
|
||||
string prefDichProd = memLayer.ML.confReadString("prefDichProd");
|
||||
string MostraProd = memLayer.ML.confReadString("MostraProd");
|
||||
string ConfermaProd = memLayer.ML.confReadString("ConfermaProd");
|
||||
string AnnullaProd = memLayer.ML.confReadString("AnnullaProd");
|
||||
string AumentaProd = memLayer.ML.confReadString("AumentaProd");
|
||||
string DiminuisciProd = memLayer.ML.confReadString("DiminuisciProd");
|
||||
/* ***********************************************
|
||||
* Processing Produzione
|
||||
* ***********************************************
|
||||
*
|
||||
* regole:
|
||||
* - serve x iniziare un mostra prod, che salva in sessione la produzione rilevata
|
||||
* - è accettato, se in sessione c'è un dato di prod, la conferma
|
||||
* - è accettato la cancellazione (svuota da sessione..)
|
||||
* - è accettato, se in sessione c'è un dato di prod, aumentare o diminuire la produzione
|
||||
*/
|
||||
bool produzioneCaricata = memLayer.ML.isInSessionObject("prod2confirm");
|
||||
int variazione = 0;
|
||||
if (!produzioneCaricata) // se non ho caricato produzione è ammesso solo il comando di caricamento produzione da sistema...
|
||||
{
|
||||
if (BarCode == MostraProd)
|
||||
{
|
||||
caricaProduzioneMacchina();
|
||||
}
|
||||
else
|
||||
{
|
||||
// mostro warning
|
||||
salvaRicarica("Errore codice produzione", "Deve prima essere richiesta la conferma di produzione per mostrare i dati di produzione e solo successivmaente si può confermare/annullare/modificare");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BarCode == MostraProd)
|
||||
{
|
||||
caricaProduzioneMacchina();
|
||||
}
|
||||
else if (BarCode == AnnullaProd)
|
||||
{
|
||||
memLayer.ML.emptySessionVal("prod2confirm");
|
||||
salvaRicarica("Annullata conferma produzione", "annullata operazione conferma di produzioone, prego ricominciare");
|
||||
}
|
||||
else if (BarCode.Substring(0, 3) == AumentaProd)
|
||||
{
|
||||
variazione = Convert.ToInt32(BarCode.Replace(AumentaProd, ""));
|
||||
prod2confirm += variazione;
|
||||
salvaRicarica("Conferma produzione", string.Format("Pezzi prodotti da confermare: {0}, per il periodo {1:dd/MM/yy HH:mm:ss} --> {2:dd/MM/yy HH:mm:ss}", prod2confirm, DateTime.Now.AddDays(-1), DateTime.Now));
|
||||
}
|
||||
else if (BarCode.Substring(0, 3) == DiminuisciProd)
|
||||
{
|
||||
variazione = Convert.ToInt32(BarCode.Replace(DiminuisciProd, ""));
|
||||
prod2confirm -= variazione;
|
||||
salvaRicarica("Conferma produzione", string.Format("Pezzi prodotti da confermare: {0}, per il periodo {1:dd/MM/yy HH:mm:ss} --> {2:dd/MM/yy HH:mm:ss}", prod2confirm, DateTime.Now.AddDays(-1), DateTime.Now));
|
||||
}
|
||||
else if (BarCode == ConfermaProd)
|
||||
{
|
||||
confermaProduzioneSuDb();
|
||||
}
|
||||
else
|
||||
{
|
||||
salvaRicarica("Errore!", string.Format("Codice produzione non riconosciuto: {0}", BarCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// conferma al produzione sul db
|
||||
/// </summary>
|
||||
private void confermaProduzioneSuDb()
|
||||
{
|
||||
// carico i dati da confermare...
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
|
||||
rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina)[0];
|
||||
// carico i dati necessari x approvatgore ed ODL
|
||||
int idxOdl = 0; // userò ODL del turno
|
||||
DS_ProdTempi.ODLDataTable elencoOdlTurno;
|
||||
int MatrAppr = 0; // leggo da postazioniMapo
|
||||
try
|
||||
{
|
||||
idxOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore a recuperare ODL per la macchina {0}", idxMacchina), tipoLog.ERROR);
|
||||
}
|
||||
try
|
||||
{
|
||||
MatrAppr = DataLayer.obj.taPostazioni.getByIdxPostaz(idxPostazione)[0].MatrOperatore;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore a recuperare MatrApp per la postazione {0}", idxPostazione), tipoLog.ERROR);
|
||||
}
|
||||
// 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.Floor(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.getByMacchinaPeriodo(idxMacchina, 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, 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, MatrAppr, turnoCurr.inizio, turnoCurr.fine, turnoCurr.TNum, idxStatoProd, pzProd);
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in INSERT dati x tab DatiConfermati: odl: {0}, idxMacchina: {1}, turno da {2} a {3}", idxOdl, idxMacchina, turnoCurr.inizio, turnoCurr.fine), 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, turnoCurr.inizio, turnoCurr.fine, turnoCurr.inizio.Date, turnoCurr.TNum, MatrAppr);
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in insert x tab DatiProduzione per il turno: odl: {0}, idxMacchina: {1}, turno da {2} a {3}", idxOdl, idxMacchina, turnoCurr.inizio, turnoCurr.fine), 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, rigaProd.DataFrom, rigaProd.DataTo)[0].pezziNonConfermati;
|
||||
}
|
||||
catch
|
||||
{
|
||||
pzProd = 0;
|
||||
}
|
||||
// confermo DELTA tab DatiConfermati
|
||||
DataLayer.obj.taPzProd2conf.stp_DatiConf_conferma(idxOdl, idxMacchina, MatrAppr, DateTime.Now, DateTime.Now, 1, idxStatoProd, prod2confirm - pzProd);
|
||||
// confermo DELTA tab DatiProduzione - ATTENZIONE NON METTO TEMPO NEGATIVO!!!
|
||||
DataLayer.obj.taDatiProd.stp_DatiProd_insert(idxOdl, idxMacchina, MatrAppr, DateTime.Now, DateTime.Now, 1, prod2confirm - pzProd, 0, "T_CorrProd");
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog("Errore nella chiamata a stored di conferma dati!", tipoLog.ERROR);
|
||||
}
|
||||
string messConferma = string.Format("Confermata la produzione per {0} pezzi!", prod2confirm);
|
||||
memLayer.ML.emptySessionVal("prod2confirm");
|
||||
salvaRicarica("Confermata produzione", messConferma);
|
||||
}
|
||||
/// <summary>
|
||||
/// carica da db la produzione x la macchina in oggetto
|
||||
/// </summary>
|
||||
private void caricaProduzioneMacchina()
|
||||
{
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
|
||||
rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina)[0];
|
||||
try
|
||||
{
|
||||
prod2confirm = rigaProd.pezziNonConfermati;
|
||||
}
|
||||
catch
|
||||
{
|
||||
prod2confirm = 0;
|
||||
logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchina), tipoLog.ERROR);
|
||||
}
|
||||
salvaRicarica("Conferma produzione", string.Format("Pezzi prodotti da confermare: {0}, per il periodo {1:dd/MM/yy HH:mm:ss} --> {2:dd/MM/yy HH:mm:ss}", rigaProd.pezziNonConfermati, rigaProd.DataFrom, rigaProd.DataTo));
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua processing delel chiamate di attrezzaggio macchina
|
||||
/// </summary>
|
||||
private void processaAttrezzaggio()
|
||||
{
|
||||
string prefDichAttrezzaggio = memLayer.ML.confReadString("prefDichAttrezzaggio");
|
||||
string StartSetup = memLayer.ML.confReadString("StartSetup");
|
||||
string EndSetup = memLayer.ML.confReadString("EndSetup");
|
||||
string EndProd = memLayer.ML.confReadString("EndProd");
|
||||
// recupero dati evento attrezzaggio...
|
||||
int idxEvento = 0;
|
||||
try
|
||||
{
|
||||
// leggo 3-4 char che rappresenta evento (ignoro il resto che è codice ODL...)
|
||||
idxEvento = Convert.ToInt32(BarCode.Substring(2, 2));
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Barcode attrezzaggio non valido! {0}", BarCode));
|
||||
}
|
||||
// verifico che l'ODL sia attrezzabile
|
||||
int idxODL = 0;
|
||||
DS_ProdTempi.ODLRow rigaOdl;
|
||||
try
|
||||
{
|
||||
idxODL = Convert.ToInt32(BarCode.Substring(4, BarCode.Length - 4));
|
||||
rigaOdl = DataLayer.obj.taODL.getByIdx(idxODL, false)[0];
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("impossibile ricavare codice ODL per attrezzaggio! {0}", BarCode));
|
||||
}
|
||||
// processo l'evento
|
||||
if (idxEvento > 0)
|
||||
{
|
||||
DS_applicazione.AnagraficaEventiRow rigaEvento = DataLayer.obj.taAnagEventi.GetByIdx(idxEvento)[0];
|
||||
if (rigaEvento != null)
|
||||
{
|
||||
/* ***********************************************
|
||||
* Processing ODL
|
||||
* ***********************************************
|
||||
*
|
||||
* regole evento inizio setup:
|
||||
* - se idxODL già usato --> errore esco
|
||||
* - se idxODL ok chiudo eventuali ODL precedenti su stessa macchina e segno macchina+ dataora inizio
|
||||
*
|
||||
* regole evento fine prod:
|
||||
* - se idxODL ok lo chiudo (dataora fine)
|
||||
*/
|
||||
|
||||
// controllo evento inizio attrezzaggio
|
||||
if (BarCode.StartsWith(StartSetup))
|
||||
{
|
||||
// cerco di nuovo ODL tra i NON impiegati
|
||||
int odlNonImpiegati = DataLayer.obj.taODL.getByIdx(idxODL, true).Rows.Count;
|
||||
if (odlNonImpiegati > 0) // effettuo "consumo" ODL
|
||||
{
|
||||
DataLayer.obj.taODL.inizioSetup(idxODL, DataLayer.MatrOpr, idxMacchina, DataLayer.obj.taODL.getByIdx(idxODL, true)[0].TCAssegnato, "");
|
||||
}
|
||||
else // ODL già impiegato
|
||||
{
|
||||
salvaRicarica("Errore ODL", "l'ODL indicato è stato già lanciato, utilizzare un ODL nuovo");
|
||||
}
|
||||
}
|
||||
else if (BarCode.StartsWith(EndProd)) // evento fine prod
|
||||
{
|
||||
// controllo se verificare codice odl da barcode... o se c'è idxOdl zero = manca...
|
||||
if (!memLayer.ML.confReadBool("chkIdxOdlEndProd") || idxODL == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
// leggo idxOdl da ultimo odl attivo x macchina
|
||||
idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore recupero odl per la macchina {0}", idxMacchina), tipoLog.ERROR);
|
||||
}
|
||||
}
|
||||
// chiudo ODL corrente
|
||||
DataLayer.obj.taODL.fineProd(idxODL, idxMacchina);
|
||||
}
|
||||
DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0];
|
||||
// ricavo codice articolo...
|
||||
string CodArticolo = DataLayer.obj.taODL.getByIdx(idxODL, false)[0].CodArticolo;
|
||||
// processo evento...
|
||||
controllerMapo.scriviRigaEventoBarcode(idxMacchina, idxEvento, CodArticolo, "", rigaStato.MatrOpr, rigaStato.pallet);
|
||||
// ricarico a seconda del tipo di codice
|
||||
if (BarCode.StartsWith(StartSetup))
|
||||
{
|
||||
salvaRicarica("Dichiarazione fermata", String.Format("Registrata dichiarazione inizio attrezzaggio per ODL {0}", idxODL));
|
||||
}
|
||||
else if (BarCode.StartsWith(EndSetup))
|
||||
{
|
||||
salvaRicarica("Fine attrezzaggio", String.Format("Registrata fine attrezzaggio per ODL {0}", idxODL));
|
||||
}
|
||||
else if (BarCode.StartsWith(EndProd))
|
||||
{
|
||||
salvaRicarica("Fine produzione", String.Format("Registrata fine produzione per ODL {0}", idxODL));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
salvaRicarica("Errore", string.Format("Codice attrezzaggio non valido! {0}", BarCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua processing cartellino fermate
|
||||
/// </summary>
|
||||
private void processaDichiaraFermata()
|
||||
{
|
||||
string prefDichFerm = memLayer.ML.confReadString("prefDichFerm");
|
||||
// recupero dati evento...
|
||||
int idxEvento = 0;
|
||||
try
|
||||
{
|
||||
idxEvento = Convert.ToInt32(BarCode.Replace(prefDichFerm, ""));
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Barcode fermata non valido! {0}", BarCode));
|
||||
}
|
||||
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)[0];
|
||||
// processo evento...
|
||||
controllerMapo.scriviRigaEventoBarcode(idxMacchina, idxEvento, rigaStato.CodArticolo, "", rigaStato.MatrOpr, rigaStato.pallet);
|
||||
// ricarico!
|
||||
salvaRicarica("Dichiarazione fermata", "Registrata dichiarazione fermata");
|
||||
}
|
||||
else
|
||||
{
|
||||
salvaRicarica("Errore", string.Format("Codice evento non valido! {0}", BarCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua processing cartellino operatore
|
||||
/// </summary>
|
||||
/// <param name="prefDichOp"></param>
|
||||
private void processaCartellinoOperatore()
|
||||
{
|
||||
string prefDichOp = memLayer.ML.confReadString("prefDichOp");
|
||||
// recupero dati operatore...
|
||||
int matrOpr = 0;
|
||||
try
|
||||
{
|
||||
matrOpr = Convert.ToInt32(BarCode.Replace(prefDichOp, ""));
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Barcode operatore non valido! {0}", BarCode));
|
||||
}
|
||||
if (matrOpr > 0)
|
||||
{
|
||||
DS_applicazione.AnagraficaOperatoriRow rigaOperatore = getRigaOperatore(matrOpr);
|
||||
if (rigaOperatore != null)
|
||||
{
|
||||
if (rigaOperatore.isAdmin)
|
||||
// se è admin apro finestra modifica
|
||||
{
|
||||
int minutiUpdateAdmin = memLayer.ML.confReadInt("minutiUpdateAdmin");
|
||||
DataLayer.obj.taPostazioni.updateOperatoreAdmin(idxPostazione, matrOpr, minutiUpdateAdmin);
|
||||
// salvo che sono in stato edit admin
|
||||
adminInput = true;
|
||||
// aggiorno pagina
|
||||
salvaRicarica(string.Format("Benvenuto {0} {1}!", rigaOperatore.Nome, rigaOperatore.Cognome), string.Format("potrai effettuare operazioni amministrative fino alle {0:HH:mm:ss}", DateTime.Now.AddMinutes(minutiUpdateAdmin)));
|
||||
}
|
||||
else
|
||||
// se è user std sostituisco utente corrente su macchina...
|
||||
{
|
||||
DataLayer.obj.taStatoMacchine.updateOper(idxMacchina, matrOpr);
|
||||
salvaRicarica("Cambio Operatore", "effettuato cambio operatore");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
salvaRicarica("Errore", string.Format("Matricola operatore non valida! {0}", BarCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// salva in sessione cosa mostrare x messaggio operatore e ricarica
|
||||
/// </summary>
|
||||
/// <param name="titolo"></param>
|
||||
/// <param name="mess"></param>
|
||||
protected void salvaRicarica(string titolo, string mess)
|
||||
{
|
||||
memLayer.ML.setSessionVal("lblTitoloUI", titolo);
|
||||
memLayer.ML.setSessionVal("lblMessUI", mess);
|
||||
// rimando a pagina attuale x evitare che "resti aperta " per troppo la finestra...
|
||||
Response.Redirect(string.Format("~/UI.aspx?idxPostazione={0}&idxMacchina={1}", idxPostazione, idxMacchina));
|
||||
}
|
||||
/// <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 = "sGr";
|
||||
bool aperto = false;
|
||||
try
|
||||
{
|
||||
aperto = Convert.ToBoolean(turno);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (aperto)
|
||||
{
|
||||
answ = "sVe";
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
-250
@@ -1,250 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MoonPro.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class mod_UI {
|
||||
|
||||
/// <summary>
|
||||
/// pnlMessaggi 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 pnlMessaggi;
|
||||
|
||||
/// <summary>
|
||||
/// lblTitolo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblTitolo;
|
||||
|
||||
/// <summary>
|
||||
/// lblMess control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblMess;
|
||||
|
||||
/// <summary>
|
||||
/// lblODLCorrente 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 lblODLCorrente;
|
||||
|
||||
/// <summary>
|
||||
/// pnlInterazione 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 pnlInterazione;
|
||||
|
||||
/// <summary>
|
||||
/// pnlProduzione 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 pnlProduzione;
|
||||
|
||||
/// <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;
|
||||
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user