diff --git a/MP-Tablet/WebUserControls/mod_regScarti.ascx.cs b/MP-Tablet/WebUserControls/mod_regScarti.ascx.cs
index d3767661..d35c9083 100644
--- a/MP-Tablet/WebUserControls/mod_regScarti.ascx.cs
+++ b/MP-Tablet/WebUserControls/mod_regScarti.ascx.cs
@@ -35,15 +35,37 @@ namespace MoonProTablet.WebUserControls
private void checkAll()
{
-#if false
- fixSelMacc();
-#endif
+ fixData();
checkOdl();
lblOut.Text = "";
switchBtnConferma(false);
lbtShowScarti.Visible = odlOk;
lblConfScarti.Visible = !odlOk;
}
+
+ private void fixData()
+ {
+ DateTime adesso = DateTime.Now;
+ txtData.Text = adesso.ToString("yyyy-MM-dd");
+ txtOra.Text = adesso.ToString("HH:mm");
+ numPzScarto = 1;
+ }
+ ///
+ /// Num pezzi scarto
+ ///
+ protected int numPzScarto
+ {
+ set
+ {
+ txtNumPz.Text = value.ToString();
+ }
+ get
+ {
+ int answ = 0;
+ int.TryParse(txtNumPz.Text, out answ);
+ return answ;
+ }
+ }
///
/// Verifica se abbia un ODL ATTIVO
///
@@ -56,22 +78,6 @@ namespace MoonProTablet.WebUserControls
///
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
///
-#if false
- protected bool isMulti
- {
- get
- {
- return DataLayer.isMulti(idxMacchinaSession);
- }
- }
- ///
- /// Se la machcina è MULTI --> mostro selettore
- ///
- private void fixSelMacc()
- {
- divSelMacc.Visible = isMulti;
- }
-#endif
///
/// restituisce css disabled SE odl NON OK...
///
@@ -115,29 +121,7 @@ namespace MoonProTablet.WebUserControls
string answ = memLayer.ML.StringSessionObj("IdxMacchina");
return answ;
}
-#if false
- set
- {
- memLayer.ML.setSessionVal("IdxMacchina", value);
- }
-#endif
}
-#if false
- ///
- /// idx macchina selezionata
- ///
- public string idxMacchinaSession
- {
- get
- {
- return memLayer.ML.StringSessionObj("IdxMacchina");
- }
- set
- {
- memLayer.ML.setSessionVal("IdxMacchina", value);
- }
- }
-#endif
///
/// cambio stato visibilità pannello e testo button
///
@@ -174,10 +158,20 @@ namespace MoonProTablet.WebUserControls
///
protected void lbtSalva_Click(object sender, EventArgs e)
{
-#if false
- // salvo controllo KO
- DataLayer.obj.taRC.insertQuery(idxMacchina, DataLayer.MatrOpr, false, txtNote.Text.Trim(), DateTime.Now);
-#endif
+ // salvo registrazione scarto...
+ DateTime dataRif = DateTime.Now;
+ try
+ {
+ // ricompongo data dai 2 controlli
+ DateTime dateOnly;
+ DateTime timeOnly;
+ DateTime.TryParse(txtData.Text, out dateOnly);
+ DateTime.TryParse(txtOra.Text, out timeOnly);
+ dataRif = dateOnly.Add(timeOnly.TimeOfDay);
+ }
+ catch
+ { }
+ DataLayer.obj.taRS.insertQuery(idxMacchina, dataRif, "ND", numPzScarto, txtNote.Text.Trim(), DataLayer.MatrOpr);
// sollevo evento!
if (eh_newVal != null)
{
@@ -193,34 +187,5 @@ namespace MoonProTablet.WebUserControls
switchBtnConferma(false);
}
- ///
- /// Sotto sistema (macchina) selezionato
- ///
- public string subMaccSel
- {
- get
- {
- return memLayer.ML.StringSessionObj("subMaccSel");
- }
- set
- {
- memLayer.ML.setSessionVal("subMaccSel", value);
- }
- }
-
- protected void lbtOK_Click(object sender, EventArgs e)
- {
-#if false
- // Salvo controllo come OK
- DataLayer.obj.taRC.insertQuery(idxMacchina, DataLayer.MatrOpr, true, "", DateTime.Now);
-#endif
- // sollevo evento!
- if (eh_newVal != null)
- {
- eh_newVal(this, new EventArgs());
- }
- resetControlli();
- }
-
}
}
\ No newline at end of file
diff --git a/MP-Tablet/WebUserControls/mod_regScarti.ascx.designer.cs b/MP-Tablet/WebUserControls/mod_regScarti.ascx.designer.cs
index 90839d8d..9e3a77e6 100644
--- a/MP-Tablet/WebUserControls/mod_regScarti.ascx.designer.cs
+++ b/MP-Tablet/WebUserControls/mod_regScarti.ascx.designer.cs
@@ -57,6 +57,42 @@ namespace MoonProTablet.WebUserControls {
///
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divDetail;
+ ///
+ /// Controllo txtNumPz.
+ ///
+ ///
+ /// 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 txtNumPz;
+
+ ///
+ /// Controllo txtData.
+ ///
+ ///
+ /// 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 txtData;
+
+ ///
+ /// Controllo txtOra.
+ ///
+ ///
+ /// 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 txtOra;
+
+ ///
+ /// Controllo lbtSalva.
+ ///
+ ///
+ /// 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 lbtSalva;
+
///
/// Controllo txtNote.
///
diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs
index 870e67bf..83593c29 100644
--- a/MapoDb/DataLayer.cs
+++ b/MapoDb/DataLayer.cs
@@ -47,6 +47,7 @@ namespace MapoDb
public DS_ProdTempiTableAdapters.MappaStatoExplTableAdapter taMSE;
public DS_ProdTempiTableAdapters.ProduzioneAs400TableAdapter taAs400;
public DS_ProdTempiTableAdapters.RegistroControlliTableAdapter taRC;
+ public DS_ProdTempiTableAdapters.RegistroScartiTableAdapter taRS;
public DS_ProdTempiTableAdapters.StatoProdTableAdapter taStatoProd;
// table adapter x utility
public DS_UtilityTableAdapters.v_selArticoliTableAdapter taSelArt;
@@ -90,6 +91,7 @@ namespace MapoDb
taMSE = new DS_ProdTempiTableAdapters.MappaStatoExplTableAdapter();
taAs400 = new DS_ProdTempiTableAdapters.ProduzioneAs400TableAdapter();
taRC = new DS_ProdTempiTableAdapters.RegistroControlliTableAdapter();
+ taRS = new DS_ProdTempiTableAdapters.RegistroScartiTableAdapter();
taStatoProd = new DS_ProdTempiTableAdapters.StatoProdTableAdapter();
taSelArt = new DS_UtilityTableAdapters.v_selArticoliTableAdapter();
taSelOdlFree = new DS_UtilityTableAdapters.v_selODLTableAdapter();
@@ -132,6 +134,7 @@ namespace MapoDb
taMSE.Connection.ConnectionString = connectionString;
taAs400.Connection.ConnectionString = connectionString;
taRC.Connection.ConnectionString = connectionString;
+ taRS.Connection.ConnectionString = connectionString;
taStatoProd.Connection.ConnectionString = connectionString;
taSelArt.Connection.ConnectionString = connectionString;
taSelOdlFree.Connection.ConnectionString = connectionString;