-
-
-
Cod.ARTICOLO
-
<%: CodArticolo %>
+
+
+
+
Cod.ARTICOLO
+
<%: CodArticolo %>
+
+
+
COMMESSA
+
<%: NumTask %>
+
+
+
QUANTITA
+
<%: Quantita %>
+
+
+
TEMPO prev
+
<%: TimeEst %>
+
+
-
-
COMMESSA
-
<%: NumTask %>
-
-
-
QUANTITA
-
<%: Quantita %>
-
-
-
-
+
\ No newline at end of file
diff --git a/C-TRACK/WebUserControls/mod_addTask.ascx.cs b/C-TRACK/WebUserControls/mod_addTask.ascx.cs
index 7531c5b..6410b93 100644
--- a/C-TRACK/WebUserControls/mod_addTask.ascx.cs
+++ b/C-TRACK/WebUserControls/mod_addTask.ascx.cs
@@ -1,182 +1,255 @@
using AppData;
using SteamWare;
using System;
+using System.Linq;
using System.Text.RegularExpressions;
namespace C_TRACK.WebUserControls
{
- public partial class mod_addTask : System.Web.UI.UserControl
- {
- ///
- /// evento aggiunta record
- ///
- public event EventHandler eh_created;
- protected void Page_Load(object sender, EventArgs e)
+ public partial class mod_addTask : System.Web.UI.UserControl
{
- if (!Page.IsPostBack)
- {
- CodArticolo = "";
- NumTask = "";
- Quantita = 0;
- }
- checkValori();
- }
+ #region Public Events
- private void checkValori()
- {
- // verifica quali valori siano disponibili e di conseguenza visualizza COLORE...
- divArticolo.Attributes.Remove("class");
- divCommessa.Attributes.Remove("class");
- divQta.Attributes.Remove("class");
- divArticolo.Attributes.Add("class", CodArticolo != "" ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
- divCommessa.Attributes.Add("class", NumTask != "" ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
- divQta.Attributes.Add("class", Quantita > 0 ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
- }
- ///
- /// Input da processare...
- ///
- public string newInput
- {
- set
- {
- processInput(value);
- }
- }
- ///
- /// Effettua riconoscimento input e determina valori commessa / articolo / qta
- ///
- ///
- private void processInput(string value)
- {
- // verifico se sia un articolo...
- Match testReset = Regex.Match(value, mUtils.reReset);
- Match testDelete = Regex.Match(value, mUtils.reDelete);
- Match testAddNew = Regex.Match(value, mUtils.reAddNew);
- Match testCodArt = Regex.Match(value, mUtils.reCodArt);
- Match testNumTask = Regex.Match(value, mUtils.reNumTask);
- Match testQta = Regex.Match(value, mUtils.reQta);
+ ///
+ /// evento aggiunta record
+ ///
+ public event EventHandler eh_created;
+ #endregion Public Events
- if (testReset.Success)
- {
- CodArticolo = "";
- NumTask = "";
- Quantita = 0;
- }
- else if (testDelete.Success)
- {
- // creo...
- dataLayer.man.taTL.deleteQuery(NumTask);
- // resetto!
- CodArticolo = "";
- NumTask = "";
- Quantita = 0;
- // invoco update...
- if (eh_created != null)
+ #region Public Properties
+
+ ///
+ /// Cod ARTICOLO corrente
+ ///
+ public string CodArticolo
{
- eh_created(this, new EventArgs());
+ get
+ {
+ return memLayer.ML.StringSessionObj("currCodArt");
+ }
+ set
+ {
+ memLayer.ML.setSessionVal("currCodArt", value);
+ }
}
- }
- else if (testAddNew.Success)
- {
- // se qta > 0 ed ho articolo e commessa...
- if (Quantita > 0 && CodArticolo != "" && NumTask != "")
+
+ ///
+ /// Input da processare...
+ ///
+ public string newInput
{
- // creo...
- dataLayer.man.taTL.insertQuery(NumTask, CodArticolo, Quantita);
- // resetto!
- CodArticolo = "";
- NumTask = "";
- Quantita = 0;
- // invoco update...
- if (eh_created != null)
- {
- eh_created(this, new EventArgs());
- }
+ set
+ {
+ processInput(value);
+ }
}
- }
- else if (testCodArt.Success)
- {
- CodArticolo = value;
- }
- else if (testNumTask.Success)
- {
- NumTask = value;
- }
- else if (testQta.Success)
- {
- int qta = 0;
- int.TryParse(value, out qta);
- Quantita = qta;
- }
- // non match con RegExp --> ricerca ESPLICITA, se abilitato ricerca estesa
- if (memLayer.ML.CRB("OptEnableMapoIn") && !(testCodArt.Success || testNumTask.Success))
- {
- var tabArt = dataLayer.man.taAnArt.getByKey(value);
- if (tabArt.Rows.Count > 0)
+ ///
+ /// Cod COMMESSA corrente
+ ///
+ public string NumTask
{
- CodArticolo = value;
+ get
+ {
+ return memLayer.ML.StringSessionObj("currNumTask");
+ }
+ set
+ {
+ memLayer.ML.setSessionVal("currNumTask", value);
+ }
}
- else
+
+ ///
+ /// QTA da produrre
+ ///
+ public int Quantita
{
- var tabTask = dataLayer.man.taTL.getByKey(value);
- if (tabTask.Rows.Count > 0)
- {
- NumTask = value;
- }
+ get
+ {
+ return memLayer.ML.IntSessionObj("currQta");
+ }
+ set
+ {
+ memLayer.ML.setSessionVal("currQta", value);
+ }
}
- }
- checkValori();
- }
+ ///
+ /// Tempo stimato x produzione
+ ///
+ public float TimeEst
+ {
+ get
+ {
+ float answ = -1;
+ string rawVal = memLayer.ML.StringSessionObj("currTimeEst");
+ float.TryParse(rawVal, out answ);
+ return answ;
+ }
+ set
+ {
+ memLayer.ML.setSessionVal("currTimeEst", value);
+ }
+ }
- ///
- /// Cod ARTICOLO corrente
- ///
- public string CodArticolo
- {
- get
- {
- return memLayer.ML.StringSessionObj("currCodArt");
- }
- set
- {
- memLayer.ML.setSessionVal("currCodArt", value);
- }
- }
- ///
- /// Cod COMMESSA corrente
- ///
- public string NumTask
- {
- get
- {
- return memLayer.ML.StringSessionObj("currNumTask");
- }
- set
- {
- memLayer.ML.setSessionVal("currNumTask", value);
- }
- }
- ///
- /// QTA da produrre
- ///
- public int Quantita
- {
- get
- {
- return memLayer.ML.IntSessionObj("currQta");
- }
- set
- {
- memLayer.ML.setSessionVal("currQta", value);
- }
- }
+ #endregion Public Properties
- protected void lbtReset_Click(object sender, EventArgs e)
- {
- processInput(memLayer.ML.CRS("regExp_KO"));
+ #region Private Methods
+
+ private void checkValori()
+ {
+ // verifica quali valori siano disponibili e di conseguenza visualizza COLORE...
+ divArticolo.Attributes.Remove("class");
+ divCommessa.Attributes.Remove("class");
+ divQta.Attributes.Remove("class");
+ divTime.Attributes.Remove("class");
+ divArticolo.Attributes.Add("class", CodArticolo != "" ? "col text-center table-success text-success" : "col text-center text-secondary");
+ divCommessa.Attributes.Add("class", NumTask != "" ? "col text-center table-success text-success" : "col text-center text-secondary");
+ divQta.Attributes.Add("class", Quantita > 0 ? "col text-center table-success text-success" : "col text-center text-secondary");
+ divTime.Attributes.Add("class", TimeEst > 0 ? "col text-center table-success text-success" : "col text-center text-secondary");
+ }
+
+ ///
+ /// Effettua riconoscimento input e determina valori commessa / articolo / qta
+ ///
+ ///
+ private void processInput(string value)
+ {
+ // verifico se sia un articolo...
+ Match testReset = Regex.Match(value, mUtils.reReset);
+ Match testDelete = Regex.Match(value, mUtils.reDelete);
+ Match testAddNew = Regex.Match(value, mUtils.reAddNew);
+ Match testCodArt = Regex.Match(value, mUtils.reCodArt);
+ Match testNumTask = Regex.Match(value, mUtils.reNumTask);
+ Match testQta = Regex.Match(value, mUtils.reQta);
+ Match testTempo = Regex.Match(value, mUtils.reTempoPrev);
+
+ if (testReset.Success)
+ {
+ CodArticolo = "";
+ NumTask = "";
+ Quantita = 0;
+ TimeEst = 0;
+ }
+ else if (testDelete.Success)
+ {
+ // creo...
+ dataLayer.man.taTL.deleteQuery(NumTask);
+ // resetto!
+ CodArticolo = "";
+ NumTask = "";
+ Quantita = 0;
+ // invoco update...
+ if (eh_created != null)
+ {
+ eh_created(this, new EventArgs());
+ }
+ }
+ else if (testAddNew.Success)
+ {
+ // controllo condizione richiesta tempo x setup Task
+ bool confAddTaskReqTime = memLayer.ML.CRB("confAddTaskReqTime");
+ // se NON richiesto --> Time=0
+ if (!confAddTaskReqTime)
+ {
+ TimeEst = 0;
+ }
+
+ // se qta > 0 ed ho articolo e commessa...
+ if (Quantita > 0 && !string.IsNullOrEmpty(CodArticolo) && !string.IsNullOrEmpty(NumTask) && (!confAddTaskReqTime || TimeEst > 0))
+ {
+ // creo...
+ dataLayer.man.taTL.insertQuery(NumTask, CodArticolo, Quantita, TimeEst);
+ // resetto!
+ CodArticolo = "";
+ NumTask = "";
+ Quantita = 0;
+ // invoco update...
+ if (eh_created != null)
+ {
+ eh_created(this, new EventArgs());
+ }
+ }
+ }
+ else if (testTempo.Success)
+ {
+ string newVal = value;
+ // effettuo pulizia variabile da conf...
+ foreach (var item in mUtils.lRepCleanTime)
+ {
+ string[] repVal = item.Split('|');
+ if (repVal.Length > 1)
+ {
+ newVal = newVal.Replace(repVal[0], repVal[1]);
+ }
+ }
+ float tPrev = 0;
+ float.TryParse(newVal, out tPrev);
+ // se configurata conversione procedo
+ if (mUtils.TimeEstFactor != 1)
+ {
+ tPrev = tPrev / mUtils.TimeEstFactor;
+ }
+ // assegno!
+ TimeEst = tPrev;
+ }
+ else if (testCodArt.Success)
+ {
+ CodArticolo = value;
+ }
+ else if (testNumTask.Success)
+ {
+ NumTask = value;
+ }
+ else if (testQta.Success)
+ {
+ int qta = 0;
+ int.TryParse(value, out qta);
+ Quantita = qta;
+ }
+
+ // non match con RegExp --> ricerca ESPLICITA, se abilitato ricerca estesa
+ if (memLayer.ML.CRB("OptEnableMapoIn") && !(testCodArt.Success || testNumTask.Success))
+ {
+ var tabArt = dataLayer.man.taAnArt.getByKey(value);
+ if (tabArt.Rows.Count > 0)
+ {
+ CodArticolo = value;
+ }
+ else
+ {
+ var tabTask = dataLayer.man.taTL.getByKey(value);
+ if (tabTask.Rows.Count > 0)
+ {
+ NumTask = value;
+ }
+ }
+ }
+
+ checkValori();
+ }
+
+ #endregion Private Methods
+
+ #region Protected Methods
+
+ protected void lbtReset_Click(object sender, EventArgs e)
+ {
+ processInput(memLayer.ML.CRS("regExp_KO"));
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ CodArticolo = "";
+ NumTask = "";
+ Quantita = 0;
+ }
+ checkValori();
+ }
+
+ #endregion Protected Methods
}
- }
}
\ No newline at end of file
diff --git a/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs b/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs
index 57452d8..7254386 100644
--- a/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs
+++ b/C-TRACK/WebUserControls/mod_addTask.ascx.designer.cs
@@ -7,11 +7,13 @@
//
//------------------------------------------------------------------------------
-namespace C_TRACK.WebUserControls {
-
-
- public partial class mod_addTask {
-
+namespace C_TRACK.WebUserControls
+{
+
+
+ public partial class mod_addTask
+ {
+
///
/// Controllo divAddNew.
///
@@ -20,7 +22,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divAddNew;
-
+
///
/// Controllo divArticolo.
///
@@ -29,7 +31,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divArticolo;
-
+
///
/// Controllo lblCodArt.
///
@@ -38,7 +40,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.Label lblCodArt;
-
+
///
/// Controllo divCommessa.
///
@@ -47,7 +49,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divCommessa;
-
+
///
/// Controllo lblNumTask.
///
@@ -56,7 +58,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.Label lblNumTask;
-
+
///
/// Controllo divQta.
///
@@ -65,7 +67,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divQta;
-
+
///
/// Controllo lblQta.
///
@@ -74,7 +76,25 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.WebControls.Label lblQta;
-
+
+ ///
+ /// Controllo divTime.
+ ///
+ ///
+ /// 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 divTime;
+
+ ///
+ /// Controllo Label1.
+ ///
+ ///
+ /// 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 Label1;
+
///
/// Controllo divReset.
///
@@ -83,7 +103,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divReset;
-
+
///
/// Controllo lbtReset.
///
diff --git a/C-TRACK/WebUserControls/mod_taskList.ascx b/C-TRACK/WebUserControls/mod_taskList.ascx
index 350a5c1..bcfaa72 100644
--- a/C-TRACK/WebUserControls/mod_taskList.ascx
+++ b/C-TRACK/WebUserControls/mod_taskList.ascx
@@ -3,90 +3,91 @@
<%@ Register Src="~/WebUserControls/mod_fasiAttive.ascx" TagPrefix="uc1" TagName="mod_fasiAttive" %>
-
-
-
-
NB: tempi espressi in minuti.centesimi
-
-
-
-
-
-
- Nessun Risultato
-
-
-
-
-
-
-
-
-
+
+
+
+
NB: tempi espressi in minuti.centesimi
+
+
+
+
+
+
+ Nessun Risultato
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file