Update x caricamento contemporaneo richiesta + preventivo

This commit is contained in:
Samuele E. Locatelli
2019-10-04 16:29:08 +02:00
parent 6a8a36f005
commit 407adc9332
9 changed files with 146 additions and 62 deletions
+56 -17
View File
@@ -156,11 +156,18 @@ namespace Data
/// <param name="notifyPAZ">Notifica PAZ</param>
/// <param name="notifyAmm">Notifica PAM</param>
/// <param name="notifyB2BC">Notifica PBO</param>
public void eseguiAzione(string oggetto, string bodyTpl, string codAzione, int idxStato, bool doRedirect, bool notifyPAZ, bool notifyPAM
, bool notifyPBO)
public void eseguiAzione(string oggetto, string bodyTpl, string codAzione, int idxStato, bool doRedirect, DS_app.ElencolRichRow riga, bool notifyPAZ, bool notifyPAM, bool notifyPBO)
{
// recupero dati della richiesta corrente
var riga = ER_curr;
if (riga == null)
{
try
{
riga = ER_curr;
}
catch
{ }
}
// accodo msg non presidiato...
bodyTpl += "<br/><br/><i><b>ATTENZIONE</b>: ti preghiamo di non rispondere alla presente e-mail, in quanto l'indirizzo non è presidiato. Per comunicazioni scrivi a <a href=\"mailto:info@b2bcondomini.it\">info@b2bcondomini.it</a>.</i>";
saveDataSendEMail(oggetto, bodyTpl, codAzione, idxStato, doRedirect, notifyPAZ, notifyPAM, notifyPBO, riga);
@@ -262,10 +269,41 @@ namespace Data
/// <summary>
/// Gestione azione RICHIESTA PREVENTIVO
/// </summary>
public void doQuoteReq()
public void doQuoteReq(bool doRedirect)
{
// recupero dati della richiesta corrente
var riga = ER_curr;
creaRichPreventivoDaRiga(riga, doRedirect);
}
/// <summary>
/// Gestione azione APPROVAZIONE PREVENTIVO specificando direttamente l'idxRichiesta
/// </summary>
public void doQuoteReq(int idxRichiesta, bool doRedirect)
{
if (idxRichiesta > 0)
{
// recupero dati della richiesta corrente
DS_app.ElencolRichRow answ = null;
try
{
answ = DtProxy.man.taElRich.getByKey(idxRichiesta)[0];
creaRichPreventivoDaRiga(answ, doRedirect);
}
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezuibe in creazione richeista preventivo doQuoteReq:{Environment.NewLine}{exc}");
}
}
}
/// <summary>
/// Effettiva generazione richiesta preventivo
/// </summary>
/// <param name="riga"></param>
/// <param name="doRedirect"></param>
private void creaRichPreventivoDaRiga(DS_app.ElencolRichRow riga, bool doRedirect)
{
if (riga != null)
{
// recupero fornitore...
@@ -280,17 +318,18 @@ namespace Data
"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=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
string codAzione = "QuoteReq";
eseguiAzione(oggetto, bodyTpl, codAzione, 23, true, true, false, false);
eseguiAzione(oggetto, bodyTpl, codAzione, 23, doRedirect, riga, true, false, false);
}
}
}
/// <summary>
/// Gestione azione APPROVAZIONE PREVENTIVO
/// </summary>
public void doQuoteApp()
{
// recupero dati della richiesta corrente
var riga = ER_curr;
DS_app.ElencolRichRow riga = ER_curr;
if (riga != null)
{
// recupero fornitore...
@@ -305,7 +344,7 @@ namespace Data
"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=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
string codAzione = "QuoteApp";
eseguiAzione(oggetto, bodyTpl, codAzione, 27, true, true, false, false);
eseguiAzione(oggetto, bodyTpl, codAzione, 27, true, riga, true, false, false);
}
}
}
@@ -330,7 +369,7 @@ namespace Data
"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=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
string codAzione = "SendRem";
eseguiAzione(oggetto, bodyTpl, codAzione, 20, true, true, false, false);
eseguiAzione(oggetto, bodyTpl, codAzione, 20, true, riga, true, false, false);
}
}
}
@@ -376,7 +415,7 @@ namespace Data
"La richiesta indicata è la seguente:<br/>{3}<br/><br/>" +
"Seguire il <a href=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
string codAzione = "PrioMod";
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, true, false, false);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, riga, true, false, false);
}
}
}
@@ -405,7 +444,7 @@ namespace Data
"La richiesta indicata era la seguente:<br/>{3}<br/><br/>" +
"Seguire il <a href=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
string codAzione = "RemSupp";
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, false, true, false, true);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, false, riga, true, false, true);
rigaForn = rigaFornitore(idxForn);
// STEP 2: scrivo al NUOVO fornitore... salvo nuova data scadenza...
@@ -419,7 +458,7 @@ namespace Data
"La richiesta indicata è la seguente:<br/>{3}<br/><br/>" +
"Seguire il <a href=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
codAzione = "SetSupp";
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, true, false, true);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, riga, true, false, true);
}
}
}
@@ -446,7 +485,7 @@ namespace Data
"Seguire il <a href=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
string codAzione = "MessMod";
DtProxy.man.taElRich.UpdateText(idxRichiesta, messaggio, riga.note);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, true, false, false);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, riga, true, false, false);
}
}
}
@@ -474,7 +513,7 @@ namespace Data
"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=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
DtProxy.man.taElRich.UpdateFreezed(idxRichiesta, freezed);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, true, false, true);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, riga, true, false, true);
}
}
}
@@ -505,7 +544,7 @@ namespace Data
"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=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
DtProxy.man.taElRich.UpdateText(idxRichiesta, riga.messaggio, riga.note + "<hr/>" + note);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, notifyPAZ, notifyPAM, notifyPBO);
eseguiAzione(oggetto, bodyTpl, codAzione, -9999, true, riga, notifyPAZ, notifyPAM, notifyPBO);
}
}
}
@@ -515,7 +554,7 @@ namespace Data
/// <param name="codAzione"></param>
/// <param name="idxStato">stato di destinazione richiesto</param>
/// <param name="idxRich">idxRichiesta</param>
public void doCreateNewRich(string codAzione, int idxStato, int idxRich)
public void doCreateNewRich(string codAzione, int idxStato, int idxRich, bool doRedirect)
{
// recupero dati della richiesta SPECIFICATA
var riga = ER_spec(idxRich);
@@ -536,7 +575,7 @@ namespace Data
"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=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRich + "\"> link seguente</a> per maggiori informazioni.";
eseguiAzioneIdxRich(idxRich, oggetto, bodyTpl, codAzione, idxStato, true, true, false, true);
eseguiAzioneIdxRich(idxRich, oggetto, bodyTpl, codAzione, idxStato, doRedirect, true, false, true);
}
}
}
@@ -597,7 +636,7 @@ namespace Data
"Lo stato attuale dell'intervento ora è quindi <b>" + stato + "</b>.<br/>" +
"Il condominio interessato è <b>{0}</b>, referente <b>{1}</b> al numero <b>{2}</b>.<br/>La richiesta indicata è la seguente:<br/>{3}<br/><br/>" +
"Seguire il <a href=\"" + urlType + "://www.b2bcondomini.it/PAZ/DettaglioIntervento?idxRichiesta=" + idxRichiesta + "\"> link seguente</a> per maggiori informazioni.";
eseguiAzione(oggetto, bodyTpl, codAzione, idxStato, true, notifyPAZ, notifyPAM, notifyPBO);
eseguiAzione(oggetto, bodyTpl, codAzione, idxStato, true, riga, notifyPAZ, notifyPAM, notifyPBO);
}
}
}
Vendored
+3 -3
View File
@@ -20,9 +20,9 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=376']) {
// env.versionNumber = VersionNumber(versionNumberString : '1.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '1.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
withEnv(['NEXT_BUILD_NUMBER=377']) {
// env.versionNumber = VersionNumber(versionNumberString : '1.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '1.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'B2BCONDOMINI'
}
}
+1 -1
View File
@@ -168,7 +168,7 @@ namespace PUB.WebUserContols
/// <param name="e"></param>
protected void lbtPreventivo_Click(object sender, EventArgs e)
{
doQuoteReq();
doQuoteReq(true);
}
/// <summary>
/// salva azione sollecito
+8 -3
View File
@@ -2,7 +2,7 @@
<h5 class="card-title">Inserimento nuova richiesta</h5>
<div class="row">
<div class="row">
<div class="col-3">Urgenza</div>
<div class="col-9">
<asp:DropDownList runat="server" ID="ddlPrior" DataSourceID="odsPrior" DataTextField="descrPriorita" DataValueField="idxPriorita" AppendDataBoundItems="true" CssClass="form-control" AutoPostBack="True">
@@ -28,7 +28,7 @@
</SelectParameters>
</asp:ObjectDataSource>
</div>
<div class="col-3">
<div class="col-3">
<asp:HiddenField runat="server" ID="hfCond" />
<asp:HiddenField runat="server" ID="hfCondReq" />
<asp:CheckBox runat="server" ID="chkShowAll" Text="Tutti" Checked="false" AutoPostBack="True" OnCheckedChanged="chkShowAll_CheckedChanged" />
@@ -45,10 +45,15 @@
<div class="col-9">
<asp:TextBox runat="server" ID="txtTelefono" placeholder="telefono" CssClass="form-control" />
</div>
<div class="col-12 my-2">
<div class="col-6 my-2">
<asp:LinkButton runat="server" ID="lblAddNew" CssClass="btn btn-success btn-block" OnClick="lblAddNew_Click">
<i class="fas fa-plus-square"></i> Registra richiesta
</asp:LinkButton>
</div>
<div class="col-6 my-2">
<asp:LinkButton runat="server" ID="lblAddNewPrev" CssClass="btn btn-primary btn-block" Visible="true" OnClick="lblAddNewPrev_Click">Nuova Richiesta + Preventivo &raquo;</asp:LinkButton>
</div>
<div class="col-12 my-2">
<asp:Label runat="server" ID="lblout" CssClass="text-danger"></asp:Label>
</div>
</div>
+30 -1
View File
@@ -14,6 +14,7 @@ namespace PUB.WebUserContols
private void checkAddNew()
{
lblAddNew.Visible = (hfCond.Value != "0");
lblAddNewPrev.Visible = lblAddNew.Visible;
if (lblAddNew.Visible)
{
lblout.Text = "";
@@ -26,6 +27,7 @@ namespace PUB.WebUserContols
public void doUpdate()
{
chkShowAll.Checked = false;
checkAddNew();
fixSelCond();
refreshFornitori();
}
@@ -89,6 +91,15 @@ namespace PUB.WebUserContols
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lblAddNew_Click(object sender, EventArgs e)
{
doInsertNew(true);
}
/// <summary>
/// Effettua inserimento intervento, restituendo num intervento creato...
/// </summary>
/// <param name="doRedirect"></param>
/// <returns></returns>
private int doInsertNew(bool doRedirect)
{
int idxArea = 0;
int idxCondominio = 0;
@@ -129,7 +140,7 @@ namespace PUB.WebUserContols
catch
{ }
// registro evento...
doCreateNewRich("Create", 10, idxRichiesta);
doCreateNewRich("Create", 10, idxRichiesta, doRedirect);
lblout.Text = "";
}
else
@@ -137,6 +148,24 @@ namespace PUB.WebUserContols
logger.lg.scriviLog("Manca idxCond!", tipoLog.ERROR);
lblout.Text = "Errore, prego riselezionare condominio";
}
return idxRichiesta;
}
/// <summary>
/// Aggiunta di una richiesta con ANCHE richiesta preventivo....
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lblAddNewPrev_Click(object sender, EventArgs e)
{
int idxRichiesta = doInsertNew(false);
// se ha fatto (>0) --> procedo con richiesta preventivo...
if (idxRichiesta > 0)
{
doQuoteReq(idxRichiesta, false);
// rimando a dettaglio!
Response.Redirect(string.Format($"DettaglioIntervento?idxRichiesta={idxRichiesta}"));
}
}
}
}
+9
View File
@@ -129,6 +129,15 @@ namespace PUB.WebUserContols {
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lblAddNew;
/// <summary>
/// Controllo lblAddNewPrev.
/// </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 lblAddNewPrev;
/// <summary>
/// Controllo lblout.
/// </summary>
+11 -9
View File
@@ -10,17 +10,19 @@
<div class="col">
<uc1:mod_ER_selCondominio runat="server" ID="mod_ER_selCondominio" />
</div>
<div class="col-12 text-right" runat="server" id="divAddNew">
<asp:LinkButton runat="server" ID="lbtAddNew" CssClass="btn btn-danger btn-sm btn-block" Visible="true" OnClick="lbtAddNew_Click">Apri nuova &raquo;</asp:LinkButton>
</div>
<div class="row" runat="server" id="divAddNew">
<div class="col-12 text-right">
<asp:LinkButton runat="server" ID="lbtAddNew" CssClass="btn btn-danger btn-sm btn-block" Visible="true" OnClick="lbtAddNew_Click">Apri Nuova Richiesta &raquo;</asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-0 m-0">
<div runat="server" id="divInsNew" visible="false">
<uc1:mod_ER_insNew runat="server" ID="mod_ER_insNew" />
</div>
<div class="card-body p-0 m-0">
<div runat="server" id="divInsNew" visible="false">
<uc1:mod_ER_insNew runat="server" ID="mod_ER_insNew" />
</div>
<div id="divElenco" runat="server">
<uc1:mod_ER_grid runat="server" ID="mod_ER_grid" StatoMin="1" StatoMax="29" onlyFreezed="-1" onlyScaduti="-1" />
</div>
<div id="divElenco" runat="server">
<uc1:mod_ER_grid runat="server" ID="mod_ER_grid" StatoMin="1" StatoMax="29" onlyFreezed="-1" onlyScaduti="-1" />
</div>
</div>
</div>
+26 -26
View File
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// <generato automaticamente>
// Codice generato da uno strumento.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
// il codice viene rigenerato.
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace PUB.WebUserContols {
@@ -13,65 +13,65 @@ namespace PUB.WebUserContols {
public partial class mod_ER_richieste {
/// <summary>
/// mod_ER_selCondominio control.
/// Controllo mod_ER_selCondominio.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::PUB.WebUserContols.mod_ER_selCondominio mod_ER_selCondominio;
/// <summary>
/// divAddNew control.
/// Controllo divAddNew.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 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 divAddNew;
/// <summary>
/// lbtAddNew control.
/// Controllo lbtAddNew.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 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 lbtAddNew;
/// <summary>
/// divInsNew control.
/// Controllo divInsNew.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 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 divInsNew;
/// <summary>
/// mod_ER_insNew control.
/// Controllo mod_ER_insNew.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::PUB.WebUserContols.mod_ER_insNew mod_ER_insNew;
/// <summary>
/// divElenco control.
/// Controllo divElenco.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// 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 divElenco;
/// <summary>
/// mod_ER_grid control.
/// Controllo mod_ER_grid.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::PUB.WebUserContols.mod_ER_grid mod_ER_grid;
}
+2 -2
View File
@@ -19,7 +19,7 @@
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="idxFornitore" SessionField="idxFornitore" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</asp:ObjectDataSource>
<asp:ObjectDataSource runat="server" ID="odsCondominiByPBO" SelectMethod="getByPBO" TypeName="Data.DS_appTableAdapters.AnagCondominiTableAdapter">
<SelectParameters>
<asp:SessionParameter DefaultValue="" Name="gruppo" SessionField="currGroup" Type="String" />
@@ -32,5 +32,5 @@
</asp:ObjectDataSource>
</div>
<div>
<asp:Label runat="server" ID="lblMessage" CssClass="text-danger" />
<asp:Label runat="server" ID="lblMessage" CssClass="text-danger bg-warning w-100" />
</div>