fix cambio livello priorità (e scadenza)

This commit is contained in:
Samuele E. Locatelli
2018-07-29 17:56:33 +02:00
parent 8cc0437836
commit b8d9edcedc
6 changed files with 175 additions and 10 deletions
+55 -7
View File
@@ -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<int> Original_idxRichiesta, global::System.Nullable<global::System.DateTime> dataScad) {
public virtual int UpdatePrior(global::System.Nullable<int> Original_idxRichiesta, global::System.Nullable<int> idxPriorita, global::System.Nullable<global::System.DateTime> 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<int> Original_idxRichiesta, global::System.Nullable<global::System.DateTime> 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<int> 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));
}
+13
View File
@@ -547,6 +547,19 @@ FROM v_AssF2C</CommandText>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="B2BCondConnectionString (Settings)" DbObjectName="B2BCond.dbo.stp_ER_UpdatePrior" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="UpdatePrior" Modifier="Public" Name="UpdatePrior" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy3" UserSourceName="UpdatePrior">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_ER_UpdatePrior</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Original_idxRichiesta" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@idxPriorita" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@dataScad" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="B2BCondConnectionString (Settings)" DbObjectName="B2BCond.dbo.stp_ER_UpdateScad" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="UpdateScad" Modifier="Public" Name="UpdateScad" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy2" UserSourceName="UpdateScad">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
+1 -1
View File
@@ -13,7 +13,7 @@
<Shape ID="DesignTable:AssF2A" ZOrder="10" X="807" Y="913" Height="181" Width="298" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="99" />
<Shape ID="DesignTable:AssF2C" ZOrder="9" X="815" Y="36" Height="388" Width="268" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:PBO_DashStats" ZOrder="8" X="90" Y="465" Height="273" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="214" />
<Shape ID="DesignTable:ElencolRich" ZOrder="1" X="58" Y="1104" Height="478" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:ElencolRich" ZOrder="1" X="58" Y="1104" Height="503" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:AnagStati" ZOrder="7" X="130" Y="795" Height="230" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
<Shape ID="DesignTable:StatoRich" ZOrder="6" X="520" Y="784" Height="184" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="94" />
<Shape ID="DesignTable:PAM_DashStats" ZOrder="5" X="519" Y="594" Height="184" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="94" />
+19 -1
View File
@@ -12,7 +12,7 @@
<asp:LinkButton runat="server" ID="lbtSollecitoFornitore" CssClass="btn btn-sm btn-info btn-block" OnClick="lbtSollecitoFornitore_Click"><i class="far fa-envelope"></i> Sollecito Fornitore</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbtUrgenza" CssClass="btn btn-sm btn-danger btn-block disabled"><i class="fas fa-sync"></i> Cambia Urgenza</asp:LinkButton>
<asp:LinkButton runat="server" ID="lbtUrgenza" CssClass="btn btn-sm btn-danger btn-block" OnClick="lbtUrgenza_Click"><i class="fas fa-sync"></i> Cambia Urgenza</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbtCambiaForn" CssClass="btn btn-sm btn-danger btn-block disabled" OnClick="lbtCambiaForn_Click"><i class="fas fa-sync"></i> Cambia Fornitore</asp:LinkButton>
@@ -52,5 +52,23 @@
</div>
</div>
</div>
<div runat="server" id="divUrgenza">
<div class="row table-warning py-2">
<div class="col-2">
Nuova priorità
</div>
<div class="col-6">
<asp:DropDownList runat="server" ID="ddlPrior" DataSourceID="odsPrior" DataTextField="descrPriorita" DataValueField="idxPriorita" AppendDataBoundItems="true" CssClass="form-control">
</asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsPrior" SelectMethod="GetData" TypeName="Data.DS_appTableAdapters.AnagPriorTableAdapter" OldValuesParameterFormatString="original_{0}"></asp:ObjectDataSource>
</div>
<div class="col-2 pr-0">
<asp:LinkButton runat="server" ID="lbtSalvaPrior" CssClass="btn btn-sm btn-success btn-block" OnClick="lbtSalvaPrior_Click"><i class="fas fa-check"></i> Update</asp:LinkButton>
</div>
<div class="col-2 pl-0">
<asp:LinkButton runat="server" ID="lbtCancPrior" CssClass="btn btn-sm btn-danger btn-block" OnClick="lbtCancPrior_Click"><i class="fas fa-ban"></i> Cancel</asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
+42 -1
View File
@@ -16,6 +16,7 @@ namespace PUB.WebUserContols
if (!Page.IsPostBack)
{
divScad.Visible = false;
divUrgenza.Visible = false;
}
}
/// <summary>
@@ -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 =
"<b>CAMBIO PRIORITA' e SCADENZA</b><br><br>" +
"Buongiorno<br>" +
"Ti è stata assegnata una richiesta di intervento da b2bcondomini.it di cui è stata variata la priorità che ora è <b>" + descrPriorita + "</b> e la scadenza, ora impostata a <b>" + dataScadNew.ToString("ddd dd.MM.yyyy HH:mm") + "</b>.<br/>" +
"Il condominio interessato è <b>{0}</b>, pregasi contattare <b>{1}</b> al numero <b>{2}</b>.<br/>La richiesta indicata è la seguente:<br/>{3}<br/><br/>Seguire il <a href=\"http://www.b2bcondomini.it\">link seguente</a> per maggiori informazioni.";
string codAzione = "PrioMod";
eseguiAzione(oggetto, bodyTpl, codAzione);
}
protected void lbtCancPrior_Click(object sender, EventArgs e)
{
divUrgenza.Visible = false;
}
}
}
+45
View File
@@ -128,5 +128,50 @@ namespace PUB.WebUserContols {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtCancScad;
/// <summary>
/// Controllo divUrgenza.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divUrgenza;
/// <summary>
/// Controllo ddlPrior.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlPrior;
/// <summary>
/// Controllo odsPrior.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsPrior;
/// <summary>
/// Controllo lbtSalvaPrior.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtSalvaPrior;
/// <summary>
/// Controllo lbtCancPrior.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtCancPrior;
}
}