From 4ea316d8dc7854f13fe929b7b09bc2f445ae361d Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 27 Jul 2017 21:08:00 +0200 Subject: [PATCH] Continuo setup preliminare procedura impostazione ODL a posteriori... --- MP-Tablet/About.aspx | 2 + MP-Tablet/About.aspx.cs | 60 +++++++++- MP-Tablet/About.aspx.designer.cs | 9 ++ MP-Tablet/MP-Tablet.csproj | 8 ++ MP-Tablet/ODL.aspx | 30 +++-- MP-Tablet/ODL.aspx.cs | 148 +++++++++++++++---------- MP-Tablet/ODL.aspx.designer.cs | 62 ++++++----- MP-Tablet/WebUserControls/mod_ODL.ascx | 2 +- MP-Tablet/fixODL.aspx | 44 ++++++++ MP-Tablet/fixODL.aspx.cs | 132 ++++++++++++++++++++++ MP-Tablet/fixODL.aspx.designer.cs | 96 ++++++++++++++++ 11 files changed, 493 insertions(+), 100 deletions(-) create mode 100644 MP-Tablet/fixODL.aspx create mode 100644 MP-Tablet/fixODL.aspx.cs create mode 100644 MP-Tablet/fixODL.aspx.designer.cs diff --git a/MP-Tablet/About.aspx b/MP-Tablet/About.aspx index 8755af2d..e7d808ee 100644 --- a/MP-Tablet/About.aspx +++ b/MP-Tablet/About.aspx @@ -10,5 +10,7 @@

Other Libraries


+
+ diff --git a/MP-Tablet/About.aspx.cs b/MP-Tablet/About.aspx.cs index 10731749..0c070626 100644 --- a/MP-Tablet/About.aspx.cs +++ b/MP-Tablet/About.aspx.cs @@ -1,4 +1,5 @@ -using System; +using SteamWare; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -15,6 +16,63 @@ namespace MoonProTablet protected void Page_Load(object sender, EventArgs e) { lblDllVersion.Text = librariesVers; + if(!Page.IsPostBack) + { + // faccio reset... sessioni e vocabolario.. + doReset(); + } + } + + private void doReset() + { + string action = memLayer.ML.QSS("Action"); + string testo = "

Reset Actions

"; + long recPrev = 0; + long recPost = 0; + if (action != "") + { + if (action.Contains("C")) + { + recPrev = Cache.Count; + // reset dati in cache... + memLayer.ML.flushRegisteredCache(); + recPost = Cache.Count; + testo += string.Format("Reset Cache: {0} --> {1}
", recPrev, recPost); + } + if (action.Contains("D")) + { + recPrev = memLayer.ML.numRecAppConf; + // reset dati in cache x DbConfig... + memLayer.ML.resetAppConf(); + recPost = memLayer.ML.numRecAppConf; + testo += string.Format("Reset DB AppConf: {0} --> {1}
", recPrev, recPost); + } + if (action.Contains("R")) + { + recPrev = memLayer.ML.numRecRedis; + // reset dati in cache x DbConfig... + memLayer.ML.redFlushKey("**"); + recPost = memLayer.ML.numRecRedis; + testo += string.Format("Reset Redis: {0} --> {1}
", recPrev, recPost); + } + if (action.Contains("S")) + { + recPrev = Session.Count; + // reset dati in sessione... + Session.Clear(); + recPost = Session.Count; + testo += string.Format("Reset Sessione: {0} --> {1}
", recPrev, recPost); + } + if (action.Contains("V")) + { + recPrev = DataWrap.DW.numRecVoc; + // aggiorno vocabolario + DataWrap.DW.resetVocabolario(); + recPost = DataWrap.DW.numRecVoc; + testo += string.Format("Reset Vocabolario: {0} --> {1}
", recPrev, recPost); + } + } + lblOut.Text = testo; } public string mainAssembly diff --git a/MP-Tablet/About.aspx.designer.cs b/MP-Tablet/About.aspx.designer.cs index 744244a7..8276efdb 100644 --- a/MP-Tablet/About.aspx.designer.cs +++ b/MP-Tablet/About.aspx.designer.cs @@ -20,5 +20,14 @@ namespace MoonProTablet { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblDllVersion; + + /// + /// Controllo lblOut. + /// + /// + /// 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 lblOut; } } diff --git a/MP-Tablet/MP-Tablet.csproj b/MP-Tablet/MP-Tablet.csproj index 8549ace4..d6037b41 100644 --- a/MP-Tablet/MP-Tablet.csproj +++ b/MP-Tablet/MP-Tablet.csproj @@ -276,6 +276,7 @@ + @@ -514,6 +515,13 @@ Dichiarazione.aspx + + fixODL.aspx + ASPXCodeBehind + + + fixODL.aspx + Global.asax diff --git a/MP-Tablet/ODL.aspx b/MP-Tablet/ODL.aspx index c26a5f4b..99afd93e 100644 --- a/MP-Tablet/ODL.aspx +++ b/MP-Tablet/ODL.aspx @@ -1,21 +1,29 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/jQueryMobile.Master" AutoEventWireup="true" CodeBehind="ODL.aspx.cs" - Inherits="MoonProTablet.ODL" %> + Inherits="MoonProTablet.ODL" %> <%@ Register Src="WebUserControls/mod_dettMacchina.ascx" TagName="mod_dettMacchina" TagPrefix="uc1" %> <%@ Register Src="WebUserControls/mod_ODL.ascx" TagName="mod_ODL" TagPrefix="uc2" %> -
- -
- - -
- +
+ +
+
+
+ + +
+ +
+
+ Fix ODL +
+
-
- -
+
+
+ +
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 + +
+ +
+
+ + +
+
+ + +
+
+
+
+ Imposta ODL +
+
+
+
+
+ --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; + } +}