From 9eec20c93632b2944fe5d144375d42fd3c4bb5c3 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 20 May 2019 15:42:30 +0200 Subject: [PATCH] Completata approvazione ordini --- Jenkinsfile | 2 +- MP-ADM/Planner.aspx.cs | 35 ++++++++++++ MP-ADM/Web.config | 1 + MP-ADM/WebUserControls/mod_planCreate.ascx | 20 ++++--- MP-ADM/WebUserControls/mod_planCreate.ascx.cs | 40 ++++++++++++-- .../mod_planCreate.ascx.designer.cs | 18 +++++++ MP-ADM/WebUserControls/mod_planStats.ascx.cs | 9 ++++ MapoDb/DS_Plan.Designer.cs | 53 ++++++++++++++++--- MapoDb/DS_Plan.xsd | 12 +++++ MapoDb/DS_Plan.xss | 8 +-- MapoDb/DataLayer.cs | 7 +++ 11 files changed, 185 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4a0890ac..d16646b5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=1195']) { + withEnv(['NEXT_BUILD_NUMBER=1199']) { // env.versionNumber = VersionNumber(versionNumberString : '6.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '6.6.${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-ADM/Planner.aspx.cs b/MP-ADM/Planner.aspx.cs index f17de81c..b086ba49 100644 --- a/MP-ADM/Planner.aspx.cs +++ b/MP-ADM/Planner.aspx.cs @@ -20,6 +20,41 @@ namespace MP_ADM #endif mod_planStats.eh_reset += Mod_planStats_eh_reset; mod_planStats.eh_selVal += Mod_planStats_eh_selVal; + mod_planCreate.eh_ucev += Mod_planCreate_eh_ucev; + } + + private void Mod_planCreate_eh_ucev(object sender, EventArgs e) + { + // se trovo evento select/reset mostro/nascondo dettagli... + ucEvent evento = (ucEvent)e; + switch (evento.tipoEvento) + { + case ucEvType.ReqUpdateParent: + mod_planStats.doReset(); + break; + default: + break; + } + +#if false + switch (evento.tipoEvento) + { + case ucEvType.Delete: + break; + case ucEvType.Edit: + break; + case ucEvType.New: + break; + case ucEvType.Reset: + break; + case ucEvType.ReqUpdateParent: + break; + case ucEvType.Selected: + break; + default: + break; + } +#endif } private void Mod_planStats_eh_selVal(object sender, EventArgs e) diff --git a/MP-ADM/Web.config b/MP-ADM/Web.config index e6f33dff..91f7544b 100644 --- a/MP-ADM/Web.config +++ b/MP-ADM/Web.config @@ -28,6 +28,7 @@ + diff --git a/MP-ADM/WebUserControls/mod_planCreate.ascx b/MP-ADM/WebUserControls/mod_planCreate.ascx index 0f5367df..9aa46c43 100644 --- a/MP-ADM/WebUserControls/mod_planCreate.ascx +++ b/MP-ADM/WebUserControls/mod_planCreate.ascx @@ -44,7 +44,7 @@
- +
@@ -114,13 +114,21 @@ -
- CREA PODL Gruppo +
+ + APPROVA e PIANIFICA +
+ Approvazione e pianificazione senza modifica delle richieste selezionate +
+
+
+
+ RAGGRUPPA RICHIESTE Selezionare LA MACCHINA ESATTA su cui creare...
-
- 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;