From 960f69d5e05fe1dd43eeb033192c24fe579f48d4 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 28 Feb 2018 12:38:17 +0100 Subject: [PATCH] Ancora conf dichiarazioni --- Jenkinsfile | 2 +- MP-Tablet/Content/dichMan.css | 36 +- MP-Tablet/Content/dichMan.less | 70 ++- MP-Tablet/Content/dichMan.min.css | 2 +- MP-Tablet/Dichiarazione.aspx | 11 +- MP-Tablet/Dichiarazione.aspx.cs | 108 ++--- MP-Tablet/Dichiarazione.aspx.designer.cs | 4 +- MP-Tablet/WebUserControls/mod_insComm.ascx | 49 ++- MP-Tablet/WebUserControls/mod_insComm.ascx.cs | 412 +++++++++--------- .../mod_insComm.ascx.designer.cs | 98 +++-- 10 files changed, 392 insertions(+), 400 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ac26a83b..21c0fb09 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=652']) { + withEnv(['NEXT_BUILD_NUMBER=654']) { // env.versionNumber = VersionNumber(versionNumberString : '4.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '4.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO' diff --git a/MP-Tablet/Content/dichMan.css b/MP-Tablet/Content/dichMan.css index c446f2f7..6784bc98 100644 --- a/MP-Tablet/Content/dichMan.css +++ b/MP-Tablet/Content/dichMan.css @@ -13,47 +13,37 @@ border-bottom-right-radius: inherit; line-height: 1em; } +.dichBlock { + font-family: 'Open Sans Condensed', sans-serif; + color: #FFF; + background-image: linear-gradient(#111, #000); + box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); + width: 6em; +} /* First breakpoint is 460px. 3 column layout. Tiles 150x150 pixels at the breakpoint. */ @media all and (max-width: 600px) { .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 7em; font-size: 1em; } } /* Second breakpoint. 4 column layout. Tiles will be 150x150 pixels again at the breakpoint. */ @media all and (min-width: 600px) { .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 8em; - font-size: 1.25em; + font-size: 1em; + width: 7em; } } /* Second breakpoint. 5 column layout. Tiles will be 156x156 pixels again at the breakpoint. */ @media all and (min-width: 800px) { .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 8em; - font-size: 1.5em; + font-size: 1.4em; + width: 7em; } } /* Second breakpoint. 6 column layout. Tiles will be 156x156 pixels again at the breakpoint. */ @media all and (min-width: 1100px) { .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 9em; - font-size: 1.6em; + font-size: 1.5em; + width: 7em; } } \ No newline at end of file diff --git a/MP-Tablet/Content/dichMan.less b/MP-Tablet/Content/dichMan.less index 2b0f18c2..455cd76a 100644 --- a/MP-Tablet/Content/dichMan.less +++ b/MP-Tablet/Content/dichMan.less @@ -14,48 +14,38 @@ border-bottom-right-radius: inherit; line-height: 1em; } +.dichBlock { + font-family: 'Open Sans Condensed', sans-serif; + color: #FFF; + background-image: linear-gradient(#111, #000); + box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); + width: 6em; +} -/* First breakpoint is 460px. 3 column layout. Tiles 150x150 pixels at the breakpoint. */ -@media all and (max-width: 600px) { - .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 7em; - font-size: 1em; + /* First breakpoint is 460px. 3 column layout. Tiles 150x150 pixels at the breakpoint. */ + @media all and (max-width: 600px) { + .dichBlock { + font-size: 1em; + } } -} -/* Second breakpoint. 4 column layout. Tiles will be 150x150 pixels again at the breakpoint. */ -@media all and (min-width: 600px) { - .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 8em; - font-size: 1.25em; + /* Second breakpoint. 4 column layout. Tiles will be 150x150 pixels again at the breakpoint. */ + @media all and (min-width: 600px) { + .dichBlock { + font-size: 1em; + width: 7em; + } } -} -/* Second breakpoint. 5 column layout. Tiles will be 156x156 pixels again at the breakpoint. */ -@media all and (min-width: 800px) { - .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 8em; - font-size: 1.5em; + /* Second breakpoint. 5 column layout. Tiles will be 156x156 pixels again at the breakpoint. */ + @media all and (min-width: 800px) { + .dichBlock { + font-size: 1.4em; + width: 7em; + } } -} -/* Second breakpoint. 6 column layout. Tiles will be 156x156 pixels again at the breakpoint. */ -@media all and (min-width: 1100px) { - .dichBlock { - font-family: 'Open Sans Condensed', sans-serif; - color: #FFF; - background-image: linear-gradient(#111, #000); - box-shadow: 5px 5px 10px 0 rgba(150, 150, 150, 0.2), 10px 10px 10px 0 rgba(200, 200, 200, 0.39); - width: 9em; - font-size: 1.6em; + /* Second breakpoint. 6 column layout. Tiles will be 156x156 pixels again at the breakpoint. */ + @media all and (min-width: 1100px) { + .dichBlock { + font-size: 1.5em; + width: 7em; + } } -} diff --git a/MP-Tablet/Content/dichMan.min.css b/MP-Tablet/Content/dichMan.min.css index 407794e0..8e83b887 100644 --- a/MP-Tablet/Content/dichMan.min.css +++ b/MP-Tablet/Content/dichMan.min.css @@ -1 +1 @@ -.labelBottom{background:#111;background:rgba(0,0,0,.8);-webkit-background-clip:padding-box;background-clip:padding-box;padding:0 .4em;min-height:30%;width:100%;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit;line-height:1em;}@media all and (max-width:600px){.dichBlock{font-family:'Open Sans Condensed',sans-serif;color:#fff;background-image:linear-gradient(#111,#000);box-shadow:5px 5px 10px 0 rgba(150,150,150,.2),10px 10px 10px 0 rgba(200,200,200,.39);width:7em;font-size:1em;}}@media all and (min-width:600px){.dichBlock{font-family:'Open Sans Condensed',sans-serif;color:#fff;background-image:linear-gradient(#111,#000);box-shadow:5px 5px 10px 0 rgba(150,150,150,.2),10px 10px 10px 0 rgba(200,200,200,.39);width:8em;font-size:1.25em;}}@media all and (min-width:800px){.dichBlock{font-family:'Open Sans Condensed',sans-serif;color:#fff;background-image:linear-gradient(#111,#000);box-shadow:5px 5px 10px 0 rgba(150,150,150,.2),10px 10px 10px 0 rgba(200,200,200,.39);width:8em;font-size:1.5em;}}@media all and (min-width:1100px){.dichBlock{font-family:'Open Sans Condensed',sans-serif;color:#fff;background-image:linear-gradient(#111,#000);box-shadow:5px 5px 10px 0 rgba(150,150,150,.2),10px 10px 10px 0 rgba(200,200,200,.39);width:9em;font-size:1.6em;}} \ No newline at end of file +.labelBottom{background:#111;background:rgba(0,0,0,.8);-webkit-background-clip:padding-box;background-clip:padding-box;padding:0 .4em;min-height:30%;width:100%;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit;line-height:1em;}.dichBlock{font-family:'Open Sans Condensed',sans-serif;color:#fff;background-image:linear-gradient(#111,#000);box-shadow:5px 5px 10px 0 rgba(150,150,150,.2),10px 10px 10px 0 rgba(200,200,200,.39);width:6em;}@media all and (max-width:600px){.dichBlock{font-size:1em;}}@media all and (min-width:600px){.dichBlock{font-size:1em;width:7em;}}@media all and (min-width:800px){.dichBlock{font-size:1.4em;width:7em;}}@media all and (min-width:1100px){.dichBlock{font-size:1.5em;width:7em;}} \ No newline at end of file diff --git a/MP-Tablet/Dichiarazione.aspx b/MP-Tablet/Dichiarazione.aspx index e2439b8f..427b6f33 100644 --- a/MP-Tablet/Dichiarazione.aspx +++ b/MP-Tablet/Dichiarazione.aspx @@ -1,18 +1,19 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/Bootstrap.Master" AutoEventWireup="true" CodeBehind="Dichiarazione.aspx.cs" Inherits="MoonProTablet.Dichiarazione" %> -<%@ Register Src="WebUserControls/mod_dettMacchina.ascx" TagName="mod_dettMacchina" TagPrefix="uc1" %> -<%@ Register Src="WebUserControls/mod_dichiarazione.ascx" TagName="mod_dichiarazione" TagPrefix="uc2" %> -<%@ Register Src="WebUserControls/mod_insComm.ascx" TagName="mod_insComm" TagPrefix="uc3" %> +<%@ Register Src="~/WebUserControls/mod_dettMacchina.ascx" TagName="mod_dettMacchina" TagPrefix="uc1" %> +<%@ Register Src="~/WebUserControls/mod_dichiarazione.ascx" TagName="mod_dichiarazione" TagPrefix="uc2" %> +<%@ Register Src="~/WebUserControls/mod_insComm.ascx" TagPrefix="uc1" TagName="mod_insComm" %> + -
+
- +
diff --git a/MP-Tablet/Dichiarazione.aspx.cs b/MP-Tablet/Dichiarazione.aspx.cs index 24c25ffc..7c1bf96b 100644 --- a/MP-Tablet/Dichiarazione.aspx.cs +++ b/MP-Tablet/Dichiarazione.aspx.cs @@ -4,63 +4,63 @@ using System.Web.UI; namespace MoonProTablet { - public partial class Dichiarazione : System.Web.UI.Page + public partial class Dichiarazione : 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"; - mod_dettMacchina1.detailLevel(true); - // se c'è una data/ora in sessione la imposto... - if (memLayer.ML.isInSessionObject("inizioStato")) - { - try - { - DateTime dataOraEv = Convert.ToDateTime(memLayer.ML.objSessionObj("inizioStato")); - mod_insComm1.dataEv = dataOraEv; - mod_dettMacchina1.detailLevel(false); - memLayer.ML.emptySessionVal("inizioStato"); - } - catch - { } - } - } - mod_dichiarazione1.eh_newVal += new EventHandler(mod_dichiarazione1_eh_newVal); - mod_insComm1.eh_inserting += mod_insComm1_eh_inserting; - mod_insComm1.eh_reset += mod_insComm1_eh_reset; - } - - void mod_insComm1_eh_reset(object sender, EventArgs e) - { - mod_dettMacchina1.detailLevel(true); - } - - void mod_insComm1_eh_inserting(object sender, EventArgs e) + if (!Page.IsPostBack) + { + Session["TipoLink"] = "EditMacch"; + mod_dettMacchina1.detailLevel(true); + // se c'è una data/ora in sessione la imposto... + if (memLayer.ML.isInSessionObject("inizioStato")) { + try + { + DateTime dataOraEv = Convert.ToDateTime(memLayer.ML.objSessionObj("inizioStato")); + mod_insComm.dataEv = dataOraEv; mod_dettMacchina1.detailLevel(false); + memLayer.ML.emptySessionVal("inizioStato"); + } + catch + { } } - /// - /// chiama udpate x evento in controller dichiarazioni - /// - /// - /// - void mod_dichiarazione1_eh_newVal(object sender, EventArgs e) - { - mod_dettMacchina1.doUpdate(); - // controllo: se è "aperto" ins dichiarazione metto pure quella... - if (!mod_dichiarazione1.insRealtime) - { - if (mod_insComm1.commento != "") - { - // chiamo insert SE C'E' commento - mod_insComm1.salvaCommento(); - } - // elimino data ev! e quindi realtime! - memLayer.ML.emptySessionVal("dataOraEv"); - // ricarico pagina! - Response.Redirect("Commenti.aspx"); - } - } + } + mod_dichiarazione1.eh_newVal += new EventHandler(mod_dichiarazione1_eh_newVal); + mod_insComm.eh_inserting += mod_insComm1_eh_inserting; + mod_insComm.eh_reset += mod_insComm1_eh_reset; } + + void mod_insComm1_eh_reset(object sender, EventArgs e) + { + mod_dettMacchina1.detailLevel(true); + } + + void mod_insComm1_eh_inserting(object sender, EventArgs e) + { + mod_dettMacchina1.detailLevel(false); + } + /// + /// chiama udpate x evento in controller dichiarazioni + /// + /// + /// + void mod_dichiarazione1_eh_newVal(object sender, EventArgs e) + { + mod_dettMacchina1.doUpdate(); + // controllo: se è "aperto" ins dichiarazione metto pure quella... + if (!mod_dichiarazione1.insRealtime) + { + if (mod_insComm.commento != "") + { + // chiamo insert SE C'E' commento + mod_insComm.salvaCommento(); + } + // elimino data ev! e quindi realtime! + memLayer.ML.emptySessionVal("dataOraEv"); + // ricarico pagina! + Response.Redirect("Commenti.aspx"); + } + } + } } \ No newline at end of file diff --git a/MP-Tablet/Dichiarazione.aspx.designer.cs b/MP-Tablet/Dichiarazione.aspx.designer.cs index ddd481e4..d5fbb437 100644 --- a/MP-Tablet/Dichiarazione.aspx.designer.cs +++ b/MP-Tablet/Dichiarazione.aspx.designer.cs @@ -22,13 +22,13 @@ namespace MoonProTablet { protected global::MoonProTablet.WebUserControls.mod_dettMacchina mod_dettMacchina1; /// - /// Controllo mod_insComm1. + /// Controllo mod_insComm. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::MoonProTablet.WebUserControls.mod_insComm mod_insComm1; + protected global::MoonProTablet.WebUserControls.mod_insComm mod_insComm; /// /// Controllo mod_dichiarazione1. diff --git a/MP-Tablet/WebUserControls/mod_insComm.ascx b/MP-Tablet/WebUserControls/mod_insComm.ascx index 3431b9ee..56848e8e 100644 --- a/MP-Tablet/WebUserControls/mod_insComm.ascx +++ b/MP-Tablet/WebUserControls/mod_insComm.ascx @@ -1,33 +1,36 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_insComm.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_insComm" %> + + -
-
- -
+
+
+ + + Commento +
+
-
-
- - -
-
- - -
+
+
+ +
-
- - +
+ +
-
-
- -
-
- -
+
+ +
+
+ Salva +
+
+ Annulla +
+
diff --git a/MP-Tablet/WebUserControls/mod_insComm.ascx.cs b/MP-Tablet/WebUserControls/mod_insComm.ascx.cs index 71e35c3e..13016250 100644 --- a/MP-Tablet/WebUserControls/mod_insComm.ascx.cs +++ b/MP-Tablet/WebUserControls/mod_insComm.ascx.cs @@ -4,213 +4,213 @@ using System; namespace MoonProTablet.WebUserControls { - public partial class mod_insComm : System.Web.UI.UserControl + public partial class mod_insComm : System.Web.UI.UserControl + { + /// + /// registrato nuovo valore + /// + public event EventHandler eh_inserting; + /// + /// registrato nuovo valore + /// + public event EventHandler eh_newVal; + /// + /// registrato nuovo valore + /// + public event EventHandler eh_reset; + + protected void Page_Load(object sender, EventArgs e) { - /// - /// registrato nuovo valore - /// - public event EventHandler eh_inserting; - /// - /// registrato nuovo valore - /// - public event EventHandler eh_newVal; - /// - /// registrato nuovo valore - /// - 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(); - } - /// - /// effettua salvataggio del commento indicato (data/ora e testo) - /// - public void salvaCommento() - { - // salvo! - string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina"); - int idxTipo = memLayer.ML.confReadInt("idxTipoCommento"); - string CodArticolo = "ND"; - try - { - // cerco di recuperare CodArticolo da evento - CodArticolo = DataLayer.obj.taODL.getByMacchinaPeriodo(idxMacchina, dataOraEv, dataOraEv)[0].CodArticolo; - } - catch - { - CodArticolo = "ND"; - } - 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, CodArticolo, 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); - } - /// - /// determian se mostrare pulsante salva (non serve x dichiarazioni fermata) - /// - public bool showSalva - { - set - { - btnSalva.Visible = value; - } - } - /// - /// imposta la label x inserimento commento singolo / con dichiarazione fermata - /// - public string labelAddCommento - { - set - { - btnAddCom.Text = value; - } - } - /// - /// imposta data/ora del commento - /// - public DateTime dataEv - { - set - { - // salvo in sessione dataOra corrente... - dataOraEv = value; - // mostro insert! - showInsert(); - } - } - /// - /// commento inserito - /// - public string commento - { - get - { - return txtCommento.Text.Trim(); - } - } - /// - /// data-ora selezionata - /// - 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; - } - } } + + protected void lbtAddCommento_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 lbtAnnulla_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 lbtSalva_Click(object sender, EventArgs e) + { + salvaCommento(); + } + /// + /// effettua salvataggio del commento indicato (data/ora e testo) + /// + public void salvaCommento() + { + // salvo! + string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina"); + int idxTipo = memLayer.ML.confReadInt("idxTipoCommento"); + string CodArticolo = "ND"; + try + { + // cerco di recuperare CodArticolo da evento + CodArticolo = DataLayer.obj.taODL.getByMacchinaPeriodo(idxMacchina, dataOraEv, dataOraEv)[0].CodArticolo; + } + catch + { + CodArticolo = "ND"; + } + 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, CodArticolo, 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); + } + /// + /// determian se mostrare pulsante salva (non serve x dichiarazioni fermata) + /// + public bool showSalva + { + set + { + lbtSalva.Visible = value; + } + } + /// + /// imposta la label x inserimento commento singolo / con dichiarazione fermata + /// + public string labelAddCommento + { + set + { + lblAddComm.Text = value; + } + } + /// + /// imposta data/ora del commento + /// + public DateTime dataEv + { + set + { + // salvo in sessione dataOra corrente... + dataOraEv = value; + // mostro insert! + showInsert(); + } + } + /// + /// commento inserito + /// + public string commento + { + get + { + return txtCommento.Text.Trim(); + } + } + /// + /// data-ora selezionata + /// + 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; + } + } + } } \ No newline at end of file diff --git a/MP-Tablet/WebUserControls/mod_insComm.ascx.designer.cs b/MP-Tablet/WebUserControls/mod_insComm.ascx.designer.cs index 7b723cc6..52b917d6 100644 --- a/MP-Tablet/WebUserControls/mod_insComm.ascx.designer.cs +++ b/MP-Tablet/WebUserControls/mod_insComm.ascx.designer.cs @@ -1,115 +1,123 @@ //------------------------------------------------------------------------------ -// -// 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.WebUserControls -{ - - +namespace MoonProTablet.WebUserControls { + + public partial class mod_insComm { /// - /// pnlButtons control. + /// Controllo pnlButtons. /// /// - /// 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.Panel pnlButtons; /// - /// btnAddCom control. + /// Controllo lbtAddCom. /// /// - /// 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.Button btnAddCom; + protected global::System.Web.UI.WebControls.LinkButton lbtAddCom; /// - /// pnlDate control. + /// Controllo lblAddComm. /// /// - /// 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 lblAddComm; + + /// + /// Controllo pnlDate. + /// + /// + /// 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.Panel pnlDate; /// - /// lblDate control. + /// Controllo lblDate. /// /// - /// 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 lblDate; /// - /// txtDate control. + /// Controllo txtDate. /// /// - /// 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.TextBox txtDate; /// - /// lblTime control. + /// Controllo lblTime. /// /// - /// 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 lblTime; /// - /// txtTime control. + /// Controllo txtTime. /// /// - /// 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.TextBox txtTime; /// - /// lblCommento control. + /// Controllo lblCommento. /// /// - /// 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 lblCommento; /// - /// txtCommento control. + /// Controllo txtCommento. /// /// - /// 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.TextBox txtCommento; /// - /// btnSalva control. + /// Controllo lbtSalva. /// /// - /// 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.Button btnSalva; + protected global::System.Web.UI.WebControls.LinkButton lbtSalva; /// - /// btnAnnulla control. + /// Controllo lbtAnnulla. /// /// - /// 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.Button btnAnnulla; + protected global::System.Web.UI.WebControls.LinkButton lbtAnnulla; } }