-
-
-
-
+
+
+
+
diff --git a/MP-Tablet/ODL.aspx.cs b/MP-Tablet/ODL.aspx.cs
index 0baacf0a..af3fb8be 100644
--- a/MP-Tablet/ODL.aspx.cs
+++ b/MP-Tablet/ODL.aspx.cs
@@ -5,66 +5,94 @@ using System.Web.UI;
namespace MoonProTablet
{
- public partial class ODL : System.Web.UI.Page
+ public partial class ODL : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
{
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- Session["TipoLink"] = "EditMacch";
- checkConfProd();
- }
- }///
- /// idx macchina selezionata
- ///
- public int idxMacchina
- {
- get
- {
- return memLayer.ML.IntSessionObj("IdxMacchina");
- }
- set
- {
- memLayer.ML.setSessionVal("IdxMacchina", value);
- }
- }
- ///
- /// verifica se sia necessario confermare la produzione PRIMA di operare sull'ODL
- ///
- private void checkConfProd()
- {
- bool needConfProd = true;
- int pz2conf = 0;
- //int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
- DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
- try
- {
- rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
- pz2conf = rigaProd.pezziNonConfermati;
- needConfProd = (pz2conf > 0);
- }
- catch
- {
- logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchina), tipoLog.ERROR);
- }
- // se necessario mostro warning...
- if (needConfProd)
- {
- lblWarningHead.Text = traduci("ConfProdBeforeContinueHead");
- lblWarningBody.Text = traduci("ConfProdBeforeContinueBody");
- lblNumPz2Conf.Text = string.Format("{0} pz NC", pz2conf);
- }
- divPz2Conf.Visible = needConfProd;
- mod_ODL1.isEnabled = !needConfProd;
- }
- ///
- /// effettua traduzione del lemma
- ///
- ///
- ///
- public string traduci(string lemma)
- {
- return user_std.UtSn.Traduci(lemma);
- }
+ if (!Page.IsPostBack)
+ {
+ Session["TipoLink"] = "EditMacch";
+ checkConfProd();
+ }
}
+ ///
+ /// idx macchina selezionata
+ ///
+ public int idxMacchina
+ {
+ get
+ {
+ return memLayer.ML.IntSessionObj("IdxMacchina");
+ }
+ set
+ {
+ memLayer.ML.setSessionVal("IdxMacchina", value);
+ }
+ }
+ ///
+ /// verifica se sia necessario confermare la produzione PRIMA di operare sull'ODL
+ ///
+ private void checkConfProd()
+ {
+ // controllo ODL mancante, x cui SE ci fossero pezzi --> va fatto attrezzaggio ODL retrodatato
+ bool odlOk = false;
+ try
+ {
+ int idxODL = DataLayer.obj.taMSE.getByIdxMacchina(idxMacchina.ToString())[0].idxODL;
+ odlOk = (idxODL > 0);
+ }
+ catch(Exception exc)
+ {
+ logger.lg.scriviLog(string.Format("Errore recupero ODL corrente da confermare per la macchina {0}{1}{2}", idxMacchina, Environment.NewLine, exc), tipoLog.ERROR);
+ }
+ // verifica se sia necessario confermare produzione
+ bool needConfProd = true;
+ int pz2conf = 0;
+ DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
+ try
+ {
+ rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
+ pz2conf = rigaProd.pezziNonConfermati;
+ needConfProd = (pz2conf > 0);
+ }
+ catch (Exception exc)
+ {
+ logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}{1}{2}", idxMacchina, Environment.NewLine, exc), tipoLog.ERROR);
+ }
+ // se necessario mostro warning...
+ if (needConfProd)
+ {
+ // SE mancasse ODL mostro info x poter caricare ODL retrodatato
+ if (odlOk)
+ {
+ lblWarningHead.Text = traduci("ConfProdBeforeContinueHead");
+ lblWarningBody.Text = traduci("ConfProdBeforeContinueBody");
+ lblNumPz2Conf.Text = string.Format("{0} pz NC", pz2conf);
+ }
+ else
+ {
+ lblWarningHead.Text = traduci("setOdlBeforeContinueHead");
+ lblWarningBody.Text = traduci("setOdlBeforeContinueBody");
+ lblNumPz2Conf.Text = string.Format("{0} pz NC", pz2conf);
+ }
+ }
+ divPz2Conf.Visible = needConfProd;
+ lbtFixOdl.Visible = !odlOk;
+ mod_ODL1.isEnabled = !needConfProd;
+ }
+ ///
+ /// effettua traduzione del lemma
+ ///
+ ///
+ ///
+ public string traduci(string lemma)
+ {
+ return user_std.UtSn.Traduci(lemma);
+ }
+
+ protected void lbtFixOdl_Click(object sender, EventArgs e)
+ {
+ Response.Redirect("~/fixODL");
+ }
+ }
}
\ No newline at end of file
diff --git a/MP-Tablet/ODL.aspx.designer.cs b/MP-Tablet/ODL.aspx.designer.cs
index 56249e01..5b0f22dc 100644
--- a/MP-Tablet/ODL.aspx.designer.cs
+++ b/MP-Tablet/ODL.aspx.designer.cs
@@ -1,69 +1,77 @@
//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
+//
+// Codice generato da uno strumento.
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
+// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
+// il codice viene rigenerato.
+//
//------------------------------------------------------------------------------
-namespace MoonProTablet
-{
-
-
+namespace MoonProTablet {
+
+
public partial class ODL {
///
- /// mod_dettMacchina1 control.
+ /// Controllo mod_dettMacchina1.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::MoonProTablet.WebUserControls.mod_dettMacchina mod_dettMacchina1;
///
- /// divPz2Conf control.
+ /// Controllo divPz2Conf.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divPz2Conf;
///
- /// lblWarningHead control.
+ /// Controllo lblWarningHead.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.Label lblWarningHead;
///
- /// lblWarningBody control.
+ /// Controllo lblWarningBody.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.Label lblWarningBody;
///
- /// lblNumPz2Conf control.
+ /// Controllo lblNumPz2Conf.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.Label lblNumPz2Conf;
///
- /// mod_ODL1 control.
+ /// Controllo lbtFixOdl.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton lbtFixOdl;
+
+ ///
+ /// Controllo mod_ODL1.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::MoonProTablet.WebUserControls.mod_ODL mod_ODL1;
}
diff --git a/MP-Tablet/WebUserControls/mod_ODL.ascx b/MP-Tablet/WebUserControls/mod_ODL.ascx
index 5a0c681b..1aa5e71f 100644
--- a/MP-Tablet/WebUserControls/mod_ODL.ascx
+++ b/MP-Tablet/WebUserControls/mod_ODL.ascx
@@ -6,7 +6,7 @@
<% } %>
-
Attrezzaggio
+
Dichiarazione Attrezzaggio
ATTENZIONE: articolo in revisione
diff --git a/MP-Tablet/fixODL.aspx b/MP-Tablet/fixODL.aspx
new file mode 100644
index 00000000..49763e21
--- /dev/null
+++ b/MP-Tablet/fixODL.aspx
@@ -0,0 +1,44 @@
+<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/jQueryMobile.Master" AutoEventWireup="true" CodeBehind="fixODL.aspx.cs" Inherits="MoonProTablet.fixODL" %>
+
+<%@ Register Src="WebUserControls/mod_dettMacchina.ascx" TagName="mod_dettMacchina" TagPrefix="uc1" %>
+
+
+
+
+
+ Riassegnazione ODL
+
+
+ Inizio ODL | stp_ODL_getByMacchina 2002
+
+
+
+
+
+
+
+
+
+
+ --ricerca text--
+ Elenco ODL "liberi" cliccabili (se selezionato ENABLED button x impostare...)
+ stp_vsODL_getUnused
+
+
+ Ultimi ODL della macchina (desc)
+ stp_ODL_getByMacchinaPeriodo 2002, '2017-07-01', '2017-07-28'
+
+
+
+
diff --git a/MP-Tablet/fixODL.aspx.cs b/MP-Tablet/fixODL.aspx.cs
new file mode 100644
index 00000000..25b84c1f
--- /dev/null
+++ b/MP-Tablet/fixODL.aspx.cs
@@ -0,0 +1,132 @@
+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
+{
+ public partial class fixODL : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if(!Page.IsPostBack)
+ {
+ // calcolare ora FROM da ULTIMO ODL
+ dataOraOdlFrom = DateTime.Today;
+ dataOraOdlTo = DateTime.Now;
+ lblInizioODL.Text = dataOraOdlFrom.ToString();
+ txtDateTo.Text = dataOraOdlTo.ToString("yyyy-MM-dd");
+ txtTimeTo.Text = dataOraOdlTo.ToString("HH:mm");
+ fixChiudiOdl();
+ fixBtnImpostaODL();
+ }
+ }
+
+ private void fixBtnImpostaODL()
+ {
+ // verifico se selezionato un ODL sorgente...
+ lbtSetODL.Visible = false;
+ }
+
+ ///
+ /// idx macchina selezionata
+ ///
+ public int idxMacchina
+ {
+ get
+ {
+ return memLayer.ML.IntSessionObj("IdxMacchina");
+ }
+ set
+ {
+ memLayer.ML.setSessionVal("IdxMacchina", value);
+ }
+ }
+
+ protected void txtDateTo_TextChanged(object sender, EventArgs e)
+ {
+ salvaDataOraTo();
+ }
+ protected void txtTimeTo_TextChanged(object sender, EventArgs e)
+ {
+ salvaDataOraTo();
+ }
+
+ private void salvaDataOraTo()
+ {
+ DateTime inizioStato = DateTime.Now;
+ try
+ {
+ DateTime ora = Convert.ToDateTime(txtTimeTo.Text);
+ inizioStato = Convert.ToDateTime(txtDateTo.Text).AddHours(ora.Hour).AddMinutes(ora.Minute);
+ }
+ catch
+ { }
+ dataOraOdlTo = inizioStato;
+ }
+ ///
+ /// data-ora selezionata INIZIO
+ ///
+ protected DateTime dataOraOdlFrom
+ {
+ set
+ {
+ memLayer.ML.setSessionVal("dataOraOdlFrom", value);
+ }
+ get
+ {
+ DateTime answ = DateTime.Now;
+ try
+ {
+ answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataOraOdlFrom"));
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+ ///
+ /// data-ora selezionata FINE
+ ///
+ protected DateTime dataOraOdlTo
+ {
+ set
+ {
+ memLayer.ML.setSessionVal("dataOraOdlTo", value);
+ }
+ get
+ {
+ DateTime answ = DateTime.Now;
+ try
+ {
+ answ = Convert.ToDateTime(memLayer.ML.objSessionObj("dataOraOdlTo"));
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+
+ protected void chkLeaveOpen_CheckedChanged(object sender, EventArgs e)
+ {
+ fixChiudiOdl();
+ }
+
+ private void fixChiudiOdl()
+ {
+ //determino visibilità fine ODL in base se sia aperto o meno...
+ if (chkLeaveOpen.Checked)
+ {
+ chkLeaveOpen.Text = "Lascia ODL Aperto";
+ }
+ else
+ {
+ chkLeaveOpen.Text = "Chiudi ODL alla data-ora seguente";
+ }
+ divFineODL.Visible = !chkLeaveOpen.Checked;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MP-Tablet/fixODL.aspx.designer.cs b/MP-Tablet/fixODL.aspx.designer.cs
new file mode 100644
index 00000000..ba862720
--- /dev/null
+++ b/MP-Tablet/fixODL.aspx.designer.cs
@@ -0,0 +1,96 @@
+//------------------------------------------------------------------------------
+//
+// Codice generato da uno strumento.
+//
+// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
+// il codice viene rigenerato.
+//
+//------------------------------------------------------------------------------
+
+namespace MoonProTablet {
+
+
+ public partial class fixODL {
+
+ ///
+ /// Controllo mod_dettMacchina1.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::MoonProTablet.WebUserControls.mod_dettMacchina mod_dettMacchina1;
+
+ ///
+ /// Controllo lblInizioODL.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblInizioODL;
+
+ ///
+ /// Controllo chkLeaveOpen.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox chkLeaveOpen;
+
+ ///
+ /// Controllo divFineODL.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divFineODL;
+
+ ///
+ /// Controllo lblDateTo.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblDateTo;
+
+ ///
+ /// Controllo txtDateTo.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtDateTo;
+
+ ///
+ /// Controllo lblTimeTo.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblTimeTo;
+
+ ///
+ /// Controllo txtTimeTo.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtTimeTo;
+
+ ///
+ /// Controllo lbtSetODL.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton lbtSetODL;
+ }
+}