diff --git a/Data/DS_app.Designer.cs b/Data/DS_app.Designer.cs index a258161..d1b3a4a 100644 --- a/Data/DS_app.Designer.cs +++ b/Data/DS_app.Designer.cs @@ -11392,7 +11392,7 @@ SELECT idxFornitore, idxArea, Attivazione FROM AssF2A WHERE (idxArea = @idxArea) [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[7]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = @"SELECT idxRichiesta, idxStato, idxCond, idxPriorita, idxArea, idxFornitore, cod_fornitore, cod_cond, nom_cond, dataIns, dataRich, dataScad, codCollabRich, genContatto, telContatto, messaggio, note, iscritta, ricevuto, data_ricevuto, risolto, data_risolto, fattura, data_fattura, preventivo, data_inizio_preventivo, data_fine_preventivo, primo_controllo, secondo_controllo, controllo_temporale, stato, cssStato, collaboratore FROM v_ElencolRich"; @@ -11428,19 +11428,27 @@ SELECT idxFornitore, idxArea, Attivazione FROM AssF2A WHERE (idxArea = @idxArea) this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@messaggio", global::System.Data.SqlDbType.NVarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[4].Connection = this.Connection; - this._commandCollection[4].CommandText = "dbo.stp_ER_UpdateScad"; + this._commandCollection[4].CommandText = "dbo.stp_ER_UpdatePrior"; this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[4].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[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxRichiesta", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxPriorita", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataScad", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; - this._commandCollection[5].CommandText = "dbo.stp_ER_UpdateText"; + this._commandCollection[5].CommandText = "dbo.stp_ER_UpdateScad"; this._commandCollection[5].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[5].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[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxRichiesta", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@messaggio", global::System.Data.SqlDbType.NVarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@note", global::System.Data.SqlDbType.NVarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataScad", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[6].Connection = this.Connection; + this._commandCollection[6].CommandText = "dbo.stp_ER_UpdateText"; + this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[6].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[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxRichiesta", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@messaggio", global::System.Data.SqlDbType.NVarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@note", global::System.Data.SqlDbType.NVarChar, 2147483647, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -11598,7 +11606,7 @@ SELECT idxFornitore, idxArea, Attivazione FROM AssF2A WHERE (idxArea = @idxArea) [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int UpdateScad(global::System.Nullable Original_idxRichiesta, global::System.Nullable dataScad) { + public virtual int UpdatePrior(global::System.Nullable Original_idxRichiesta, global::System.Nullable idxPriorita, global::System.Nullable dataScad) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((Original_idxRichiesta.HasValue == true)) { command.Parameters[1].Value = ((int)(Original_idxRichiesta.Value)); @@ -11606,6 +11614,46 @@ SELECT idxFornitore, idxArea, Attivazione FROM AssF2A WHERE (idxArea = @idxArea) else { command.Parameters[1].Value = global::System.DBNull.Value; } + if ((idxPriorita.HasValue == true)) { + command.Parameters[2].Value = ((int)(idxPriorita.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((dataScad.HasValue == true)) { + command.Parameters[3].Value = ((System.DateTime)(dataScad.Value)); + } + else { + command.Parameters[3].Value = global::System.DBNull.Value; + } + 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; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int UpdateScad(global::System.Nullable Original_idxRichiesta, global::System.Nullable dataScad) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; + if ((Original_idxRichiesta.HasValue == true)) { + command.Parameters[1].Value = ((int)(Original_idxRichiesta.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } if ((dataScad.HasValue == true)) { command.Parameters[2].Value = ((System.DateTime)(dataScad.Value)); } @@ -11633,7 +11681,7 @@ SELECT idxFornitore, idxArea, Attivazione FROM AssF2A WHERE (idxArea = @idxArea) [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int UpdateText(global::System.Nullable Original_idxRichiesta, string messaggio, string note) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; if ((Original_idxRichiesta.HasValue == true)) { command.Parameters[1].Value = ((int)(Original_idxRichiesta.Value)); } diff --git a/Data/DS_app.xsd b/Data/DS_app.xsd index 9b6de03..6a05572 100644 --- a/Data/DS_app.xsd +++ b/Data/DS_app.xsd @@ -547,6 +547,19 @@ FROM v_AssF2C + + + + dbo.stp_ER_UpdatePrior + + + + + + + + + diff --git a/Data/DS_app.xss b/Data/DS_app.xss index 87b185f..6dba540 100644 --- a/Data/DS_app.xss +++ b/Data/DS_app.xss @@ -13,7 +13,7 @@ - + diff --git a/PUB/WebUserContols/mod_ER_doAct.ascx b/PUB/WebUserContols/mod_ER_doAct.ascx index c3339dd..0905df4 100644 --- a/PUB/WebUserContols/mod_ER_doAct.ascx +++ b/PUB/WebUserContols/mod_ER_doAct.ascx @@ -12,7 +12,7 @@ Sollecito Fornitore
- Cambia Urgenza + Cambia Urgenza
Cambia Fornitore @@ -52,5 +52,23 @@
+
+
+
+ Nuova priorità +
+
+ + + +
+
+ Update +
+
+ Cancel +
+
+
diff --git a/PUB/WebUserContols/mod_ER_doAct.ascx.cs b/PUB/WebUserContols/mod_ER_doAct.ascx.cs index 4b3982b..1a1a20f 100644 --- a/PUB/WebUserContols/mod_ER_doAct.ascx.cs +++ b/PUB/WebUserContols/mod_ER_doAct.ascx.cs @@ -16,6 +16,7 @@ namespace PUB.WebUserContols if (!Page.IsPostBack) { divScad.Visible = false; + divUrgenza.Visible = false; } } /// @@ -139,7 +140,7 @@ namespace PUB.WebUserContols { // mostra pulsante x impostare scadenza divScad.Visible = !divScad.Visible; - // recupero dati della richiesta corrente + // recupero dati della richiesta corrente ed imposto var riga = ER_curr; txtDataScad.Text = riga.dataScad.ToString("yyyy-MM-dd"); txtOraScad.Text = riga.dataScad.ToShortTimeString(); @@ -174,5 +175,45 @@ namespace PUB.WebUserContols string codAzione = "SetDDate"; eseguiAzione(oggetto, bodyTpl, codAzione); } + + protected void lbtUrgenza_Click(object sender, EventArgs e) + { + divUrgenza.Visible = !divUrgenza.Visible; + // recupero dati della richiesta corrente ed imposto + var riga = ER_curr; + ddlPrior.SelectedValue = riga.idxPriorita.ToString(); + } + + protected void lbtSalvaPrior_Click(object sender, EventArgs e) + { + int idxPrior = 0; + DateTime dataScadNew = DateTime.Now; + string descrPriorita = ""; + try + { + int.TryParse(ddlPrior.SelectedValue, out idxPrior); + var rigaPrio = DtProxy.man.taAP.getByKey(idxPrior)[0]; + // sommo priorità ad adesso... + dataScadNew = dataScadNew.AddHours(rigaPrio.scadenzaGg * 24); + descrPriorita = rigaPrio.descrPriorita; + // salvo nuova data scadenza... + DtProxy.man.taElRich.UpdatePrior(IdxRichiesta, idxPrior, dataScadNew); + } + catch + { } + string oggetto = "Cambio scadenza intervento da b2bcondomini.it"; + string bodyTpl = + "CAMBIO PRIORITA' e SCADENZA

" + + "Buongiorno
" + + "Ti è stata assegnata una richiesta di intervento da b2bcondomini.it di cui è stata variata la priorità che ora è " + descrPriorita + " e la scadenza, ora impostata a " + dataScadNew.ToString("ddd dd.MM.yyyy HH:mm") + ".
" + + "Il condominio interessato è {0}, pregasi contattare {1} al numero {2}.
La richiesta indicata è la seguente:
{3}

Seguire il link seguente per maggiori informazioni."; + string codAzione = "PrioMod"; + eseguiAzione(oggetto, bodyTpl, codAzione); + } + + protected void lbtCancPrior_Click(object sender, EventArgs e) + { + divUrgenza.Visible = false; + } } } \ No newline at end of file diff --git a/PUB/WebUserContols/mod_ER_doAct.ascx.designer.cs b/PUB/WebUserContols/mod_ER_doAct.ascx.designer.cs index d260a51..447f652 100644 --- a/PUB/WebUserContols/mod_ER_doAct.ascx.designer.cs +++ b/PUB/WebUserContols/mod_ER_doAct.ascx.designer.cs @@ -128,5 +128,50 @@ namespace PUB.WebUserContols { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.LinkButton lbtCancScad; + + /// + /// Controllo divUrgenza. + /// + /// + /// 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 divUrgenza; + + /// + /// Controllo ddlPrior. + /// + /// + /// 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.DropDownList ddlPrior; + + /// + /// Controllo odsPrior. + /// + /// + /// 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.ObjectDataSource odsPrior; + + /// + /// Controllo lbtSalvaPrior. + /// + /// + /// 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 lbtSalvaPrior; + + /// + /// Controllo lbtCancPrior. + /// + /// + /// 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 lbtCancPrior; } }