-
SPLIT PODL
- ...con split deve chiedere NUM PEZZI...
+
+
SPLIT RICHIESTA
+ ...con split deve chiedere NUM PEZZI e va a creare promessa splittata approvata (lasciando il rimanente "a monte" da approvare e/o splittare...
ricordarsi che deve salvare dati come data/ora creazione + utente creazione
diff --git a/MP-ADM/WebUserControls/mod_planCreate.ascx.cs b/MP-ADM/WebUserControls/mod_planCreate.ascx.cs
index 0c752403..c71aa2db 100644
--- a/MP-ADM/WebUserControls/mod_planCreate.ascx.cs
+++ b/MP-ADM/WebUserControls/mod_planCreate.ascx.cs
@@ -1,4 +1,5 @@
-using System;
+using MapoDb;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
@@ -12,7 +13,10 @@ namespace MP_ADM.WebUserControls
{
protected void Page_Load(object sender, EventArgs e)
{
-
+ if (!Page.IsPostBack)
+ {
+ calcTotali();
+ }
}
public string CodGruppo
{
@@ -137,7 +141,37 @@ namespace MP_ADM.WebUserControls
lblOreTot.Text = $"{tempoMinTot / 60:N2}";
// controllo SE abilitare il crea gruppo o split...
divSplitOdl.Visible = numOrd == 1;
- divCreaGrp.Visible = numOrd > 0;
+ divConfirm.Visible = numOrd > 0;
+ divCreaGrp.Visible = numOrd > 1;
+ }
+ ///
+ /// Approva e pianifica richeiste...
+ ///
+ ///
+ ///
+ protected void lbtDoPlan_Click(object sender, EventArgs e)
+ {
+ int IdxPromessa = 0;
+ foreach (GridViewRow riga in grView.Rows)
+ {
+ DateTime DataRif = DateTime.Now.Date;
+ if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
+ {
+ try
+ {
+ int.TryParse(((Label)riga.FindControl("lblIdxPromessa")).Text, out IdxPromessa);
+ // approvo la promessa COPIANDOLA
+ DataLayer.obj.taPlanRichieste.approvaRich(IdxPromessa, SteamWare.user_std.UtSn.utente);
+ }
+ catch
+ { }
+ }
+ }
+ // aggiorno grView...
+ grView.SelectedIndex = -1;
+ grView.DataBind();
+ // segnalo update
+ raiseEvent(SteamWare.ucEvType.ReqUpdateParent);
}
}
}
\ No newline at end of file
diff --git a/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs b/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs
index 54e97d04..add3e354 100644
--- a/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs
+++ b/MP-ADM/WebUserControls/mod_planCreate.ascx.designer.cs
@@ -111,6 +111,24 @@ namespace MP_ADM.WebUserControls {
///
protected global::System.Web.UI.WebControls.Label lblOreTot;
+ ///
+ /// Controllo divConfirm.
+ ///
+ ///
+ /// 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 divConfirm;
+
+ ///
+ /// Controllo lbtDoPlan.
+ ///
+ ///
+ /// 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 lbtDoPlan;
+
///
/// Controllo divCreaGrp.
///
diff --git a/MP-ADM/WebUserControls/mod_planStats.ascx.cs b/MP-ADM/WebUserControls/mod_planStats.ascx.cs
index 947548b2..001e8852 100644
--- a/MP-ADM/WebUserControls/mod_planStats.ascx.cs
+++ b/MP-ADM/WebUserControls/mod_planStats.ascx.cs
@@ -42,6 +42,15 @@ namespace MP_ADM.WebUserControls
// salvo in sessione selezione...
memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue);
#endif
+ }
+ ///
+ /// Reset controllo
+ ///
+ public void doReset()
+ {
+ doResetGrp();
+ doResetMac();
+ doResetArt();
}
///
/// comando reset
diff --git a/MapoDb/DS_Plan.Designer.cs b/MapoDb/DS_Plan.Designer.cs
index 25e6ba9b..e61c3a69 100644
--- a/MapoDb/DS_Plan.Designer.cs
+++ b/MapoDb/DS_Plan.Designer.cs
@@ -4335,19 +4335,26 @@ namespace MapoDb.DS_PlanTableAdapters {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
+ this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT * FROM dbo.v_Richieste";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
- this._commandCollection[1].CommandText = "dbo.stp_Richieste_filt";
+ this._commandCollection[1].CommandText = "dbo.stp_RICH_approva";
this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodGruppo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxPromessa", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserMod", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
+ this._commandCollection[2].Connection = this.Connection;
+ this._commandCollection[2].CommandText = "dbo.stp_Richieste_filt";
+ this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure;
+ this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodGruppo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -4379,7 +4386,7 @@ namespace MapoDb.DS_PlanTableAdapters {
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_Plan.RichiesteDataTable getFilt(string CodGruppo, string CodArticolo, string IdxMacchina) {
- this.Adapter.SelectCommand = this.CommandCollection[1];
+ this.Adapter.SelectCommand = this.CommandCollection[2];
if ((CodGruppo == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
@@ -4402,6 +4409,40 @@ namespace MapoDb.DS_PlanTableAdapters {
this.Adapter.Fill(dataTable);
return dataTable;
}
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
+ [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+ public virtual int approvaRich(global::System.Nullable idxPromessa, string UserMod) {
+ global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1];
+ if ((idxPromessa.HasValue == true)) {
+ command.Parameters[1].Value = ((int)(idxPromessa.Value));
+ }
+ else {
+ command.Parameters[1].Value = global::System.DBNull.Value;
+ }
+ if ((UserMod == null)) {
+ command.Parameters[2].Value = global::System.DBNull.Value;
+ }
+ else {
+ command.Parameters[2].Value = ((string)(UserMod));
+ }
+ global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
+ if (((command.Connection.State & global::System.Data.ConnectionState.Open)
+ != global::System.Data.ConnectionState.Open)) {
+ command.Connection.Open();
+ }
+ int returnValue;
+ try {
+ returnValue = command.ExecuteNonQuery();
+ }
+ finally {
+ if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
+ command.Connection.Close();
+ }
+ }
+ return returnValue;
+ }
}
///
diff --git a/MapoDb/DS_Plan.xsd b/MapoDb/DS_Plan.xsd
index 2c347fd1..960e2784 100644
--- a/MapoDb/DS_Plan.xsd
+++ b/MapoDb/DS_Plan.xsd
@@ -170,6 +170,18 @@ ORDER BY TotOreRich DESC
+
+
+
+ dbo.stp_RICH_approva
+
+
+
+
+
+
+
+
diff --git a/MapoDb/DS_Plan.xss b/MapoDb/DS_Plan.xss
index 4ca481d5..28c3ec64 100644
--- a/MapoDb/DS_Plan.xss
+++ b/MapoDb/DS_Plan.xss
@@ -6,11 +6,11 @@
-->
-
-
+
+
-
-
+
+
\ No newline at end of file
diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs
index a7cb69b6..ceb89a62 100644
--- a/MapoDb/DataLayer.cs
+++ b/MapoDb/DataLayer.cs
@@ -57,6 +57,9 @@ namespace MapoDb
public DS_UtilityTableAdapters.v_selODLTableAdapter taSelOdlFree;
public DS_UtilityTableAdapters.CommentiTableAdapter taComm;
+ // table adapter x planner
+ public DS_PlanTableAdapters.RichiesteTableAdapter taPlanRichieste;
+
// tablet adapter x IS
public DS_IntServTableAdapters.IstanzeKITTableAdapter taIstK;
public DS_IntServTableAdapters.ProduzioneAs400TableAdapter taAs400;
@@ -110,6 +113,7 @@ namespace MapoDb
taSelMacc = new DS_UtilityTableAdapters.v_selMacchineTableAdapter();
taSelOdlFree = new DS_UtilityTableAdapters.v_selODLTableAdapter();
taComm = new DS_UtilityTableAdapters.CommentiTableAdapter();
+ taPlanRichieste = new DS_PlanTableAdapters.RichiesteTableAdapter();
taIstK = new DS_IntServTableAdapters.IstanzeKITTableAdapter();
taAs400 = new DS_IntServTableAdapters.ProduzioneAs400TableAdapter();
taTKS = new DS_IntServTableAdapters.TKS_SearchTableAdapter();
@@ -123,6 +127,7 @@ namespace MapoDb
{
string connectionString = memLayer.ML.confReadString("MoonProConnectionString");
string connectionStringIS = memLayer.ML.confReadString("MoonProConnectionStringIS");
+ string connectionStringES3 = memLayer.ML.confReadString("MoonProConnectionStringES3");
// connections del db
taAG.Connection.ConnectionString = connectionString;
taMacchine.Connection.ConnectionString = connectionString;
@@ -163,6 +168,8 @@ namespace MapoDb
taSelMacc.Connection.ConnectionString = connectionString;
taSelOdlFree.Connection.ConnectionString = connectionString;
taComm.Connection.ConnectionString = connectionString;
+ // area planner
+ taPlanRichieste.Connection.ConnectionString = connectionStringES3;
// area IS
taIS_TrDati.Connection.ConnectionString = connectionStringIS;
taIstK.Connection.ConnectionString = connectionStringIS;