From 3e3ab207b47348e8af420dd9607ca54f5869644b Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Mon, 24 Mar 2025 09:55:47 +0100 Subject: [PATCH 1/2] dsdsds --- .vs/ApiPolo/v17/.futdcache.v2 | Bin 597 -> 597 bytes .vs/ApiPolo/v17/.suo | Bin 518144 -> 522752 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/.vs/ApiPolo/v17/.futdcache.v2 b/.vs/ApiPolo/v17/.futdcache.v2 index b97d1bf3b775ff5320731fa9995d9cb67cc6336f..09f9b7cf2196f163ff3f8f4e59a4a16202f1994c 100644 GIT binary patch delta 23 fcmcc0a+PI+BO_N|@>dV4%+zqn)Z8K~D!0nqGOwDrbXDH(JO_+x-Im+`fA9N#KKJsAs*x2J;YA7YCxkpKE-nTUcu60iIiLdD5ilO0j1c?g5lr#Qzq)te@)ciEq9A&- zW1=#VYK|hsW_aH~$a3nK$R?H>gSez6vMfRxIVkswc!2Ute`gR;12I#9N&B(sAUeKpYk|(f=Tvb_B`Kh=f}vaipsE zy>eFmZc8haZKG?nktpHQm^ypR?1R-rTdLV! zF%yylyb7!YRsk|nVh!A{0k4;YxxnjzwZL1zIzXm-yM#A_Hvzf8=8~|j;BCM=Kwe3h z%v18)JiiK!m*3F@eRvrdhW<*`i1e^uVp@4JXZ-DE-xA30?%T#^97lBK_)4&U; z#GSji_)ba1rT!lgU+S(6_dQ@tnXnMJ?@NCrq?(V+58&}HQ((5G?f-spn~z5Snz+d! zl;SoL@&BT@VS)OExV1o7skq6`{Vj2m@ulJ>-BR2@Ht8-dD{guK{`{V}sVLz8zPK6j zrBd9)^~*G7Yl!D5>Rijhwubq)FGm+|&8%5WCDod5TGLip6B*!~L&NC=5iy6>pu0qe zIrNzd710lkQGx=l2FS7Y5N{zxIWy!p0Z}UvY!aW&p^f-vS(o=*TFvtV1WtkPHLz$r zm&VmK!u2vj&H!)0eGx2IhAnV6fjbQRJ@|llbuO(Mc?-@eB}v`}KLidT$vy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=Rs!C8A9 ztKgQA!OhWqGWTZM@+FnOWh)?uG+J2i+iZ#cE@cxWrrK&+HEY^}TJz(ye7~AT`PXd& zt>b-ck@41^xwcdXCDpg5TB%<4J^nad#lKIyGVDvaOW75P8%82!2J&e7agu$u)qAo% z)Ss^0u(hXoLyZ(lI-(kx<@=+pi^2AY0aSWgrO<&JRgwNP7(6}{1Zx*?U88|ivi5MUmsU`t%L YKL{`j>xchLobV%2r2j5+(O%~LpIi^jHvj+t From 1d52b8f945105e6016e539962fd5f502b29d6de6 Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Mon, 24 Mar 2025 14:00:32 +0100 Subject: [PATCH 2/2] refactor --- ApiPolo/Controllers/TestController.cs | 654 +++++++++++++++++++ ApiPolo/Data/Maras_DbContext.cs | 9 +- ApiPolo/Data/Marro_DbContext.cs | 176 +++++ ApiPolo/Interfaces/TenantDbContextFactory.cs | 30 +- ApiPolo/Startup.cs | 9 +- 5 files changed, 859 insertions(+), 19 deletions(-) create mode 100644 ApiPolo/Data/Marro_DbContext.cs diff --git a/ApiPolo/Controllers/TestController.cs b/ApiPolo/Controllers/TestController.cs index c314ba1..906b954 100644 --- a/ApiPolo/Controllers/TestController.cs +++ b/ApiPolo/Controllers/TestController.cs @@ -2,14 +2,20 @@ using ApiPolo.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using System.IdentityModel.Tokens.Jwt; +using System.Text; +using static ApiPolo.Controllers.PoloController; namespace ApiPolo.Controllers { + /// public class TestController : Controller { //interfaccia con tutti i possibili dbset private readonly ITenantDbContextFactory _dbContextFactory; //DI con ITenantDbContextFactory + /// + private DbSet? _chiamate; public TestController(ITenantDbContextFactory dbContextFactory) { _dbContextFactory = dbContextFactory; @@ -131,6 +137,654 @@ namespace ApiPolo.Controllers } #endregion + #region utility + private string getClaimValueByToken(string token, string claimName) + { + string t = string.Empty; + + var handler = new JwtSecurityTokenHandler(); + var jwtSecurityToken = handler.ReadJwtToken(token); + if (jwtSecurityToken != null) + { + var id = jwtSecurityToken.Claims.First(claim => claim.Type == claimName).Value; + t = id; + } + return t; + } + private Chiamate_out fillChiamateOut(Chiamate i, string tenant) + { + Chiamate_out o = new Chiamate_out(); + o.chcodazi = i.chcodazi; + o.chserial = i.chserial; + o.chstato = i.chstato; + o.chtchiam = i.chtchiam; + + o.chdtapp = i.chdtapp; + o.choraaPI = i.choraaPI; + o.chminapi = i.chminapi; + o.chnote = i.chnote; + + o.chcodimp = i.chcodimp; + o.csdescr = i.csdescr; + o.antelefo = i.antelefo; + o.andescri = i.andescri; + o.imindiri1 = i.imindiri1; + + o.imindiri2 = i.imindiri2; + o.imindiri3 = i.imindiri3; + o.imindiri4 = i.imindiri4; + o.imindiri5 = i.imindiri5; + o.imlocali = i.imlocali; + o.imrefref = i.imrefref; + //costruisco il campo indirizzo + StringBuilder sb = new StringBuilder(); + + string chiamataIndStampa = string.Empty; + switch (tenant) + { + case Clienti.Marrocco: + #region marrocco + chiamataIndStampa = formattaIndirizzoStampaMarrocco(i); + #endregion + break; + case Clienti.Gitoga: + #region gitoga + chiamataIndStampa = formattaIndirizzoStampaMarrocco(i); + #endregion + break; + case Clienti.Lifta: + #region lifta + chiamataIndStampa = formattaIndirizzoStampaMarrocco(i); + #endregion + break; + case Clienti.Discovery: + #region Discovery + chiamataIndStampa = formattaIndirizzoStampaDiscovery(i); + #endregion + break; + case Clienti.Siet: + //ragione sociale cliente + sb.Append("SPETT.LE :"); + sb.Append(!string.IsNullOrEmpty(i.andescri) ? i.andescri + " " : string.Empty); + sb.Append("
"); + //indirizzo + sb.Append(!string.IsNullOrEmpty(i.imindiri1) ? i.imindiri1.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri2) ? i.imindiri2.Trim() + " " : string.Empty); + sb.Append(i.imindiri3 != null ? i.imindiri3.ToString() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri4) ? i.imindiri4.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri5) ? i.imindiri5.Trim() : string.Empty); + chiamataIndStampa = sb.ToString(); + + break; + default: + sb.Append("SPETT.LE :"); + if (!string.IsNullOrEmpty(i.andescri)) + { + sb.Append(!string.IsNullOrEmpty(i.andescri) ? i.andescri + " " : string.Empty); + sb.Append("
"); + } + + sb.Append(!string.IsNullOrEmpty(i.imindiri1) ? i.imindiri1.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri2) ? i.imindiri2.Trim() + " " : string.Empty); + sb.Append(i.imindiri3 != null ? i.imindiri3.ToString() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri4) ? i.imindiri4.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri5) ? i.imindiri5.Trim() : string.Empty); + chiamataIndStampa = sb.ToString(); + break; + } + o.indirizzo_stampa = chiamataIndStampa; + sb.Clear(); + + string chiamataItemList = string.Empty; + switch (tenant) + { + case Clienti.Marrocco: + #region marrocco + chiamataItemList = formattaItemChiamateMarrocco(i); + #endregion + break; + case Clienti.Gitoga: + #region gitoga + chiamataItemList = formattaItemChiamateMarrocco(i); + #endregion + break; + case Clienti.Lifta: + #region lifta + chiamataItemList = formattaItemChiamateMarrocco(i); + #endregion + break; + case Clienti.Tedesco: + #region Tedesco + chiamataItemList = formattaItemChiamateTedesco(i); + #endregion + break; + case Clienti.VT: + chiamataItemList = formattaItemChiamateVT(i); + break; + default: + #region default + sb.Append(!string.IsNullOrEmpty(i.imindiri1) ? i.imindiri1.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri2) ? i.imindiri2.Trim() + " " : string.Empty); + sb.Append(i.imindiri3 != null ? i.imindiri3.ToString() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri4) ? i.imindiri4.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imindiri5) ? i.imindiri5.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imcodcap) ? " " + i.imcodcap.Trim() + " " : string.Empty); + sb.Append(!string.IsNullOrEmpty(i.imlocali) ? " " + i.imlocali.Trim() + " " : string.Empty); + + if (!string.IsNullOrEmpty(i.chcodimp)) + { + sb.Append("
"); + sb.Append("Impianto : " + i.chcodimp.Trim()); + } + chiamataItemList = sb.ToString(); + break; + #endregion + } + o.impianto_list = chiamataItemList; + sb.Clear(); + + string rif_impianto = string.Empty; + switch (tenant) + { + case Clienti.Marrocco: + #region marrocco + rif_impianto = formattaRiferimentoImpiantoMarrocco(i); + #endregion + break; + case Clienti.Gitoga: + #region gitoga + rif_impianto = formattaRiferimentoImpiantoMarrocco(i); + #endregion + break; + case Clienti.Lifta: + #region lifta + rif_impianto = formattaRiferimentoImpiantoMarrocco(i); + #endregion + break; + case Clienti.Discovery: + #region discovery + rif_impianto = formattaRiferimentoImpiantoDiscovery(i); + #endregion + break; + case Clienti.Ferrari: + #region ferrari + rif_impianto = formattaRiferimentoImpiantoFerrari(i); + #endregion + break; + case Clienti.Siet: + #region SIET + sb.AppendLine("N. Impianto: " + i.chcodimp); + if (!string.IsNullOrEmpty(i.imubicaz)) + { + sb.AppendLine("Ubicazione: " + i.imubicaz); + } + if (!string.IsNullOrEmpty(i.chrifer)) + { + string comm = getCommessaSietBySerial(i.chrifer); + if (!string.IsNullOrEmpty(comm)) + { + sb.AppendLine("Commessa: " + comm); + } + + } + + rif_impianto = sb.ToString(); + #endregion + break; + default: + sb.AppendLine("N. Impianto: " + i.chcodimp); + if (!string.IsNullOrEmpty(i.imubicaz)) + sb.AppendLine("Ubicazione: " + i.imubicaz); + + rif_impianto = sb.ToString(); + break; + } + o.riferimento_impianto = rif_impianto; + sb.Clear(); + + o.imcodcap = i.imcodcap; + o.imcomune = i.imcomune; + o.improvin = i.improvin; + o.imcodnaz = i.imcodnaz; + + o.immatric = i.immatric; + o.imnumimp = i.imnumimp; + o.imubicaz = i.imubicaz; + + o.tcdescri = i.tcdescri; + + o.tccodice = i.tccodice; + o.ser_rapp_ic = i.ser_rapp_ic; + o.tipo_rapp_ic = i.tipo_rapp_ic; + o.ic = i.ic; + o.ser_rapp_rif = i.ser_rapp_rif; + + o.tipo_rapp_rif = i.tipo_rapp_rif; + o.rif = i.rif; + o.ser_rapp_chiu = i.ser_rapp_chiu; + o.tipo_rapp_chiu = i.tipo_rapp_chiu; + o.ser_buono_chiu = i.ser_buono_chiu; + + o.err_title = i.err_title; + o.err_detail = i.err_detail; + o.err_status_code = i.err_status_code; + o.ancodice = i.ancodice; + o.chiamata = i.chiamata; + o.spe_viaggio = i.spe_viaggio; + o.chnumero = i.chnumero; + + Dictionary dic = new Dictionary(); + switch (tenant) + { + case Clienti.Marrocco: + #region marrocco + dic.Add("Esercizio ", !string.IsNullOrEmpty(i.chcodese) ? i.chcodese : String.Empty); + dic.Add("REF ", !string.IsNullOrEmpty(i.imrefref) ? i.imrefref : String.Empty); + dic.Add("Riferimento:", !string.IsNullOrEmpty(i.chrifer) ? i.chrifer : String.Empty); + dic.Add("Telefono rif.:", !string.IsNullOrEmpty(i.chtelef) ? i.chtelef : String.Empty); + + #endregion + break; + + case Clienti.Gitoga: + #region gitoga + dic.Add("Esercizio ", !string.IsNullOrEmpty(i.chcodese) ? i.chcodese : String.Empty); + dic.Add("REF ", !string.IsNullOrEmpty(i.imrefref) ? i.imrefref : String.Empty); + dic.Add("Riferimento:", !string.IsNullOrEmpty(i.chrifer) ? i.chrifer : String.Empty); + dic.Add("Telefono rif.:", !string.IsNullOrEmpty(i.chtelef) ? i.chtelef : String.Empty); + #endregion + break; + + case Clienti.Lifta: + #region lifta + dic.Add("Esercizio ", !string.IsNullOrEmpty(i.chcodese) ? i.chcodese : String.Empty); + dic.Add("REF ", !string.IsNullOrEmpty(i.imrefref) ? i.imrefref : String.Empty); + dic.Add("Riferimento:", !string.IsNullOrEmpty(i.chrifer) ? i.chrifer : String.Empty); + dic.Add("Telefono rif.:", !string.IsNullOrEmpty(i.chtelef) ? i.chtelef : String.Empty); + #endregion + break; + + case Clienti.Ferrari: + #region ferrari + dic.Add("Esercizio", !string.IsNullOrEmpty(i.chcodese) ? i.chcodese : String.Empty); + dic.Add("Tipo", !string.IsNullOrEmpty(i.chtipo) ? i.chtipo : String.Empty); + dic.Add("Numero chiamata", !string.IsNullOrEmpty(i.chnumero.ToString()) ? i.chnumero.ToString() : String.Empty); + dic.Add("Data chiamata", !string.IsNullOrEmpty(i.chdata.ToString()) ? i.chdata.ToString() : String.Empty); + dic.Add("Ora inserimento chiamata", !string.IsNullOrEmpty(i.chora.ToString()) ? i.chora.ToString() : String.Empty); + dic.Add("Min inserimento chiamata", !string.IsNullOrEmpty(i.chmin.ToString()) ? i.chmin.ToString() : String.Empty); + dic.Add("Operatore assegnazione", !string.IsNullOrEmpty(i.chopass.ToString()) ? i.chopass.ToString() : String.Empty); + dic.Add("Operatore chiusura", !string.IsNullOrEmpty(i.chopchi.ToString()) ? i.chopchi.ToString() : String.Empty); + dic.Add("Azienda impianto", !string.IsNullOrEmpty(i.chaziimp) ? i.chaziimp : String.Empty); + dic.Add("Ora appuntamento fine", !string.IsNullOrEmpty(i.choraapf.ToString()) ? i.choraapf.ToString() : String.Empty); + dic.Add("Min appuntamento fine", !string.IsNullOrEmpty(i.chminapf.ToString()) ? i.chminapf.ToString() : String.Empty); + dic.Add("Riferimento chiamata", !string.IsNullOrEmpty(i.chrifer) ? i.chrifer : String.Empty); + dic.Add("Riferimento telefono", !string.IsNullOrEmpty(i.chtelef) ? i.chtelef : String.Empty); + dic.Add("Codice segnalazione", !string.IsNullOrEmpty(i.chcodseg) ? i.chcodseg : String.Empty); + dic.Add("Fermo impianto", !string.IsNullOrEmpty(i.chstopi) ? i.chstopi : String.Empty); + dic.Add("Data assegnazione chiamata", !string.IsNullOrEmpty(i.chdtass.ToString()) ? i.chdtass.ToString() : String.Empty); + dic.Add("Ora assegnazione chiamata", !string.IsNullOrEmpty(i.chorass.ToString()) ? i.chorass.ToString() : String.Empty); + dic.Add("Min assegnazione chiamata", !string.IsNullOrEmpty(i.chminass.ToString()) ? i.chminass.ToString() : String.Empty); + dic.Add("Data chiusura chiamata", !string.IsNullOrEmpty(i.chdtchi.ToString()) ? i.chdtchi.ToString() : String.Empty); + dic.Add("Ora chiusura chiamata", !string.IsNullOrEmpty(i.chorachi.ToString()) ? i.chorachi.ToString() : String.Empty); + dic.Add("Min chiusura chiamata", !string.IsNullOrEmpty(i.chminchi.ToString()) ? i.chminchi.ToString() : String.Empty); + dic.Add("Data inizio intervento", !string.IsNullOrEmpty(i.chdtlin.ToString()) ? i.chdtlin.ToString() : String.Empty); + dic.Add("Ora inizio intervento", !string.IsNullOrEmpty(i.chorali.ToString()) ? i.chorali.ToString() : String.Empty); + dic.Add("Min inizio intervento", !string.IsNullOrEmpty(i.chminli.ToString()) ? i.chminli.ToString() : String.Empty); + dic.Add("Data fine intervento", !string.IsNullOrEmpty(i.chdtlfi.ToString()) ? i.chdtlfi.ToString() : String.Empty); + + dic.Add("Ora fine intervento", !string.IsNullOrEmpty(i.choralf.ToString()) ? i.choralf.ToString() : String.Empty); + dic.Add("Min fine intervento", !string.IsNullOrEmpty(i.chminlf.ToString()) ? i.chminlf.ToString() : String.Empty); + dic.Add("Numero 1 rapportino futuro", !string.IsNullOrEmpty(i.chnrap1.ToString()) ? i.chnrap1.ToString() : String.Empty); + dic.Add("Serie 1 rapportino futuro", !string.IsNullOrEmpty(i.chsrap1) ? i.chsrap1 : String.Empty); + dic.Add("Numero 2 rapportino futuro", !string.IsNullOrEmpty(i.chnrap2.ToString()) ? i.chnrap2.ToString() : String.Empty); + dic.Add("Modalità raccolta chiamata", !string.IsNullOrEmpty(i.chmodrac) ? i.chmodrac : String.Empty); + dic.Add("Numero chiamata per impianto per anno", !string.IsNullOrEmpty(i.chprgann.ToString()) ? i.chprgann.ToString() : String.Empty); + dic.Add("Importo manodopera", !string.IsNullOrEmpty(i.chimpman.ToString()) ? i.chimpman.ToString() : String.Empty); + dic.Add("Percentuale manodopera", !string.IsNullOrEmpty(i.chperman.ToString()) ? i.chperman.ToString() : String.Empty); + dic.Add("Stampa manodopera", !string.IsNullOrEmpty(i.chflstim) ? i.chflstim : String.Empty); + dic.Add("Chiusura da remoto", !string.IsNullOrEmpty(i.chfleste) ? i.chfleste : String.Empty); + dic.Add("Riferimento seriale importazione", !string.IsNullOrEmpty(i.chserext) ? i.chserext : String.Empty); + dic.Add("Descrizione impianto", !string.IsNullOrEmpty(i.imdescri) ? i.imdescri : String.Empty); + dic.Add("Tipo impianto", !string.IsNullOrEmpty(i.imtipoim) ? i.imtipoim : String.Empty); + dic.Add("Matricola impianto ", !string.IsNullOrEmpty(i.immatric) ? i.immatric : String.Empty); + dic.Add("Numero impianto ", !string.IsNullOrEmpty(i.imnumimp) ? i.imnumimp : String.Empty); + dic.Add("Ultimo amministratore ", !string.IsNullOrEmpty(i.imultamm) ? i.imultamm : String.Empty); + dic.Add("Desc Ultimo amministratore ", !string.IsNullOrEmpty(i.imultdam) ? i.imultdam : String.Empty); + dic.Add("Telefono Ult. Amministratore", !string.IsNullOrEmpty(i.imulttam) ? i.imulttam : String.Empty); + + + dic.Add("Ubicazione impianto", !string.IsNullOrEmpty(i.imubicaz) ? i.imubicaz : String.Empty); + dic.Add("Zona manutenzione", !string.IsNullOrEmpty(i.imzonman) ? i.imzonman : String.Empty); + dic.Add("Pubblico/privato", !string.IsNullOrEmpty(i.imflpupr) ? i.imflpupr : String.Empty); + dic.Add("Zona chiamate", !string.IsNullOrEmpty(i.imzonchi) ? i.imzonchi : String.Empty); + dic.Add("Zona supervisione", !string.IsNullOrEmpty(i.imzonsup) ? i.imzonsup : String.Empty); + dic.Add("Data inizio manutenzione", i.imdainma != null ? i.imdainma.ToString() : String.Empty); + dic.Add("Data fine manutenzione", !string.IsNullOrEmpty(i.imdafima.ToString()) ? i.imdafima.ToString() : String.Empty); + dic.Add("Data costruzione", !string.IsNullOrEmpty(i.imdatcos.ToString()) ? i.imdatcos.ToString() : String.Empty); + dic.Add("Numero telesoccorso ", !string.IsNullOrEmpty(i.imteleso) ? i.imteleso : String.Empty); + dic.Add("Email cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Ultimo cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Codice cliente", !string.IsNullOrEmpty(i.ancodice) ? i.ancodice : String.Empty); + dic.Add("Tipo anagrafica", !string.IsNullOrEmpty(i.antipcon) ? i.antipcon : String.Empty); + #endregion + break; + case Clienti.Sicilia: + #region sicilia + dic.Add("Esercizio", !string.IsNullOrEmpty(i.chcodese) ? i.chcodese : String.Empty); + dic.Add("Tipo", !string.IsNullOrEmpty(i.chtipo) ? i.chtipo : String.Empty); + dic.Add("Numero chiamata", !string.IsNullOrEmpty(i.chnumero.ToString()) ? i.chnumero.ToString() : String.Empty); + dic.Add("Data chiamata", !string.IsNullOrEmpty(i.chdata.ToString()) ? i.chdata.ToString() : String.Empty); + dic.Add("Ora inserimento chiamata", !string.IsNullOrEmpty(i.chora.ToString()) ? i.chora.ToString() : String.Empty); + dic.Add("Min inserimento chiamata", !string.IsNullOrEmpty(i.chmin.ToString()) ? i.chmin.ToString() : String.Empty); + dic.Add("Operatore assegnazione", !string.IsNullOrEmpty(i.chopass.ToString()) ? i.chopass.ToString() : String.Empty); + dic.Add("Operatore chiusura", !string.IsNullOrEmpty(i.chopchi.ToString()) ? i.chopchi.ToString() : String.Empty); + dic.Add("Azienda impianto", !string.IsNullOrEmpty(i.chaziimp) ? i.chaziimp : String.Empty); + dic.Add("Ora appuntamento fine", !string.IsNullOrEmpty(i.choraapf.ToString()) ? i.choraapf.ToString() : String.Empty); + dic.Add("Min appuntamento fine", !string.IsNullOrEmpty(i.chminapf.ToString()) ? i.chminapf.ToString() : String.Empty); + dic.Add("Riferimento chiamata", !string.IsNullOrEmpty(i.chrifer) ? i.chrifer : String.Empty); + dic.Add("Riferimento telefono", !string.IsNullOrEmpty(i.chtelef) ? i.chtelef : String.Empty); + dic.Add("Codice segnalazione", !string.IsNullOrEmpty(i.chcodseg) ? i.chcodseg : String.Empty); + dic.Add("Fermo impianto", !string.IsNullOrEmpty(i.chstopi) ? i.chstopi : String.Empty); + dic.Add("Data assegnazione chiamata", !string.IsNullOrEmpty(i.chdtass.ToString()) ? i.chdtass.ToString() : String.Empty); + dic.Add("Ora assegnazione chiamata", !string.IsNullOrEmpty(i.chorass.ToString()) ? i.chorass.ToString() : String.Empty); + dic.Add("Min assegnazione chiamata", !string.IsNullOrEmpty(i.chminass.ToString()) ? i.chminass.ToString() : String.Empty); + dic.Add("Data chiusura chiamata", !string.IsNullOrEmpty(i.chdtchi.ToString()) ? i.chdtchi.ToString() : String.Empty); + dic.Add("Ora chiusura chiamata", !string.IsNullOrEmpty(i.chorachi.ToString()) ? i.chorachi.ToString() : String.Empty); + dic.Add("Min chiusura chiamata", !string.IsNullOrEmpty(i.chminchi.ToString()) ? i.chminchi.ToString() : String.Empty); + dic.Add("Data inizio intervento", !string.IsNullOrEmpty(i.chdtlin.ToString()) ? i.chdtlin.ToString() : String.Empty); + dic.Add("Ora inizio intervento", !string.IsNullOrEmpty(i.chorali.ToString()) ? i.chorali.ToString() : String.Empty); + dic.Add("Min inizio intervento", !string.IsNullOrEmpty(i.chminli.ToString()) ? i.chminli.ToString() : String.Empty); + dic.Add("Data fine intervento", !string.IsNullOrEmpty(i.chdtlfi.ToString()) ? i.chdtlfi.ToString() : String.Empty); + + dic.Add("Ora fine intervento", !string.IsNullOrEmpty(i.choralf.ToString()) ? i.choralf.ToString() : String.Empty); + dic.Add("Min fine intervento", !string.IsNullOrEmpty(i.chminlf.ToString()) ? i.chminlf.ToString() : String.Empty); + dic.Add("Numero 1 rapportino futuro", !string.IsNullOrEmpty(i.chnrap1.ToString()) ? i.chnrap1.ToString() : String.Empty); + dic.Add("Serie 1 rapportino futuro", !string.IsNullOrEmpty(i.chsrap1) ? i.chsrap1 : String.Empty); + dic.Add("Numero 2 rapportino futuro", !string.IsNullOrEmpty(i.chnrap2.ToString()) ? i.chnrap2.ToString() : String.Empty); + dic.Add("Modalità raccolta chiamata", !string.IsNullOrEmpty(i.chmodrac) ? i.chmodrac : String.Empty); + dic.Add("Numero chiamata per impianto per anno", !string.IsNullOrEmpty(i.chprgann.ToString()) ? i.chprgann.ToString() : String.Empty); + dic.Add("Importo manodopera", !string.IsNullOrEmpty(i.chimpman.ToString()) ? i.chimpman.ToString() : String.Empty); + dic.Add("Percentuale manodopera", !string.IsNullOrEmpty(i.chperman.ToString()) ? i.chperman.ToString() : String.Empty); + dic.Add("Stampa manodopera", !string.IsNullOrEmpty(i.chflstim) ? i.chflstim : String.Empty); + dic.Add("Chiusura da remoto", !string.IsNullOrEmpty(i.chfleste) ? i.chfleste : String.Empty); + dic.Add("Riferimento seriale importazione", !string.IsNullOrEmpty(i.chserext) ? i.chserext : String.Empty); + dic.Add("Descrizione impianto", !string.IsNullOrEmpty(i.imdescri) ? i.imdescri : String.Empty); + dic.Add("Tipo impianto", !string.IsNullOrEmpty(i.imtipoim) ? i.imtipoim : String.Empty); + dic.Add("Matricola impianto ", !string.IsNullOrEmpty(i.immatric) ? i.immatric : String.Empty); + dic.Add("Numero impianto ", !string.IsNullOrEmpty(i.imnumimp) ? i.imnumimp : String.Empty); + dic.Add("Ultimo amministratore ", !string.IsNullOrEmpty(i.imultamm) ? i.imultamm : String.Empty); + dic.Add("Desc Ultimo amministratore ", !string.IsNullOrEmpty(i.imultdam) ? i.imultdam : String.Empty); + dic.Add("Telefono Ult. Amministratore", !string.IsNullOrEmpty(i.imulttam) ? i.imulttam : String.Empty); + + + dic.Add("Ubicazione impianto", !string.IsNullOrEmpty(i.imubicaz) ? i.imubicaz : String.Empty); + dic.Add("Zona manutenzione", !string.IsNullOrEmpty(i.imzonman) ? i.imzonman : String.Empty); + dic.Add("Pubblico/privato", !string.IsNullOrEmpty(i.imflpupr) ? i.imflpupr : String.Empty); + dic.Add("Zona chiamate", !string.IsNullOrEmpty(i.imzonchi) ? i.imzonchi : String.Empty); + dic.Add("Zona supervisione", !string.IsNullOrEmpty(i.imzonsup) ? i.imzonsup : String.Empty); + dic.Add("Data inizio manutenzione", i.imdainma != null ? i.imdainma.ToString() : String.Empty); + dic.Add("Data fine manutenzione", !string.IsNullOrEmpty(i.imdafima.ToString()) ? i.imdafima.ToString() : String.Empty); + dic.Add("Data costruzione", !string.IsNullOrEmpty(i.imdatcos.ToString()) ? i.imdatcos.ToString() : String.Empty); + dic.Add("Numero telesoccorso ", !string.IsNullOrEmpty(i.imteleso) ? i.imteleso : String.Empty); + dic.Add("Email cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Ultimo cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Codice cliente", !string.IsNullOrEmpty(i.ancodice) ? i.ancodice : String.Empty); + dic.Add("Tipo anagrafica", !string.IsNullOrEmpty(i.antipcon) ? i.antipcon : String.Empty); + #endregion + + break; + case Clienti.Discovery: + #region discovery + dic.Add("Esercizio", !string.IsNullOrEmpty(i.chcodese) ? i.chcodese : String.Empty); + dic.Add("Tipo", !string.IsNullOrEmpty(i.chtipo) ? i.chtipo : String.Empty); + dic.Add("Numero chiamata", !string.IsNullOrEmpty(i.chnumero.ToString()) ? i.chnumero.ToString() : String.Empty); + dic.Add("Data chiamata", !string.IsNullOrEmpty(i.chdata.ToString()) ? i.chdata.ToString() : String.Empty); + dic.Add("Ora inserimento chiamata", !string.IsNullOrEmpty(i.chora.ToString()) ? i.chora.ToString() : String.Empty); + dic.Add("Min inserimento chiamata", !string.IsNullOrEmpty(i.chmin.ToString()) ? i.chmin.ToString() : String.Empty); + dic.Add("Operatore assegnazione", !string.IsNullOrEmpty(i.chopass.ToString()) ? i.chopass.ToString() : String.Empty); + dic.Add("Operatore chiusura", !string.IsNullOrEmpty(i.chopchi.ToString()) ? i.chopchi.ToString() : String.Empty); + dic.Add("Azienda impianto", !string.IsNullOrEmpty(i.chaziimp) ? i.chaziimp : String.Empty); + dic.Add("Ora appuntamento fine", !string.IsNullOrEmpty(i.choraapf.ToString()) ? i.choraapf.ToString() : String.Empty); + dic.Add("Min appuntamento fine", !string.IsNullOrEmpty(i.chminapf.ToString()) ? i.chminapf.ToString() : String.Empty); + dic.Add("Riferimento chiamata", !string.IsNullOrEmpty(i.chrifer) ? i.chrifer : String.Empty); + dic.Add("Riferimento telefono", !string.IsNullOrEmpty(i.chtelef) ? i.chtelef : String.Empty); + dic.Add("Codice segnalazione", !string.IsNullOrEmpty(i.chcodseg) ? i.chcodseg : String.Empty); + dic.Add("Fermo impianto", !string.IsNullOrEmpty(i.chstopi) ? i.chstopi : String.Empty); + dic.Add("Data assegnazione chiamata", !string.IsNullOrEmpty(i.chdtass.ToString()) ? i.chdtass.ToString() : String.Empty); + dic.Add("Ora assegnazione chiamata", !string.IsNullOrEmpty(i.chorass.ToString()) ? i.chorass.ToString() : String.Empty); + dic.Add("Min assegnazione chiamata", !string.IsNullOrEmpty(i.chminass.ToString()) ? i.chminass.ToString() : String.Empty); + dic.Add("Data chiusura chiamata", !string.IsNullOrEmpty(i.chdtchi.ToString()) ? i.chdtchi.ToString() : String.Empty); + dic.Add("Ora chiusura chiamata", !string.IsNullOrEmpty(i.chorachi.ToString()) ? i.chorachi.ToString() : String.Empty); + dic.Add("Min chiusura chiamata", !string.IsNullOrEmpty(i.chminchi.ToString()) ? i.chminchi.ToString() : String.Empty); + dic.Add("Data inizio intervento", !string.IsNullOrEmpty(i.chdtlin.ToString()) ? i.chdtlin.ToString() : String.Empty); + dic.Add("Ora inizio intervento", !string.IsNullOrEmpty(i.chorali.ToString()) ? i.chorali.ToString() : String.Empty); + dic.Add("Min inizio intervento", !string.IsNullOrEmpty(i.chminli.ToString()) ? i.chminli.ToString() : String.Empty); + dic.Add("Data fine intervento", !string.IsNullOrEmpty(i.chdtlfi.ToString()) ? i.chdtlfi.ToString() : String.Empty); + + dic.Add("Ora fine intervento", !string.IsNullOrEmpty(i.choralf.ToString()) ? i.choralf.ToString() : String.Empty); + dic.Add("Min fine intervento", !string.IsNullOrEmpty(i.chminlf.ToString()) ? i.chminlf.ToString() : String.Empty); + dic.Add("Numero 1 rapportino futuro", !string.IsNullOrEmpty(i.chnrap1.ToString()) ? i.chnrap1.ToString() : String.Empty); + dic.Add("Serie 1 rapportino futuro", !string.IsNullOrEmpty(i.chsrap1) ? i.chsrap1 : String.Empty); + dic.Add("Numero 2 rapportino futuro", !string.IsNullOrEmpty(i.chnrap2.ToString()) ? i.chnrap2.ToString() : String.Empty); + dic.Add("Modalità raccolta chiamata", !string.IsNullOrEmpty(i.chmodrac) ? i.chmodrac : String.Empty); + dic.Add("Numero chiamata per impianto per anno", !string.IsNullOrEmpty(i.chprgann.ToString()) ? i.chprgann.ToString() : String.Empty); + dic.Add("Importo manodopera", !string.IsNullOrEmpty(i.chimpman.ToString()) ? i.chimpman.ToString() : String.Empty); + dic.Add("Percentuale manodopera", !string.IsNullOrEmpty(i.chperman.ToString()) ? i.chperman.ToString() : String.Empty); + dic.Add("Stampa manodopera", !string.IsNullOrEmpty(i.chflstim) ? i.chflstim : String.Empty); + dic.Add("Chiusura da remoto", !string.IsNullOrEmpty(i.chfleste) ? i.chfleste : String.Empty); + dic.Add("Riferimento seriale importazione", !string.IsNullOrEmpty(i.chserext) ? i.chserext : String.Empty); + dic.Add("Descrizione impianto", !string.IsNullOrEmpty(i.imdescri) ? i.imdescri : String.Empty); + dic.Add("Tipo impianto", !string.IsNullOrEmpty(i.imtipoim) ? i.imtipoim : String.Empty); + dic.Add("Matricola impianto ", !string.IsNullOrEmpty(i.immatric) ? i.immatric : String.Empty); + dic.Add("Numero impianto ", !string.IsNullOrEmpty(i.imnumimp) ? i.imnumimp : String.Empty); + dic.Add("Ultimo amministratore ", !string.IsNullOrEmpty(i.imultamm) ? i.imultamm : String.Empty); + dic.Add("Desc Ultimo amministratore ", !string.IsNullOrEmpty(i.imultdam) ? i.imultdam : String.Empty); + dic.Add("Telefono Ult. Amministratore", !string.IsNullOrEmpty(i.imulttam) ? i.imulttam : String.Empty); + + + dic.Add("Ubicazione impianto", !string.IsNullOrEmpty(i.imubicaz) ? i.imubicaz : String.Empty); + dic.Add("Zona manutenzione", !string.IsNullOrEmpty(i.imzonman) ? i.imzonman : String.Empty); + dic.Add("Pubblico/privato", !string.IsNullOrEmpty(i.imflpupr) ? i.imflpupr : String.Empty); + dic.Add("Zona chiamate", !string.IsNullOrEmpty(i.imzonchi) ? i.imzonchi : String.Empty); + dic.Add("Zona supervisione", !string.IsNullOrEmpty(i.imzonsup) ? i.imzonsup : String.Empty); + dic.Add("Data inizio manutenzione", i.imdainma != null ? i.imdainma.ToString() : String.Empty); + dic.Add("Data fine manutenzione", !string.IsNullOrEmpty(i.imdafima.ToString()) ? i.imdafima.ToString() : String.Empty); + dic.Add("Data costruzione", !string.IsNullOrEmpty(i.imdatcos.ToString()) ? i.imdatcos.ToString() : String.Empty); + dic.Add("Numero telesoccorso ", !string.IsNullOrEmpty(i.imteleso) ? i.imteleso : String.Empty); + dic.Add("Email cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Ultimo cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Codice cliente", !string.IsNullOrEmpty(i.ancodice) ? i.ancodice : String.Empty); + dic.Add("Tipo anagrafica", !string.IsNullOrEmpty(i.antipcon) ? i.antipcon : String.Empty); + #endregion + break; + + case Clienti.Sarom: + #region Sarom + dic.Add("Esercizio", !string.IsNullOrEmpty(i.chcodese) ? i.chcodese : String.Empty); + dic.Add("Tipo", !string.IsNullOrEmpty(i.chtipo) ? i.chtipo : String.Empty); + dic.Add("Numero chiamata", !string.IsNullOrEmpty(i.chnumero.ToString()) ? i.chnumero.ToString() : String.Empty); + dic.Add("Data chiamata", !string.IsNullOrEmpty(i.chdata.ToString()) ? i.chdata.ToString() : String.Empty); + dic.Add("Ora inserimento chiamata", !string.IsNullOrEmpty(i.chora.ToString()) ? i.chora.ToString() : String.Empty); + dic.Add("Min inserimento chiamata", !string.IsNullOrEmpty(i.chmin.ToString()) ? i.chmin.ToString() : String.Empty); + dic.Add("Operatore assegnazione", !string.IsNullOrEmpty(i.chopass.ToString()) ? i.chopass.ToString() : String.Empty); + dic.Add("Operatore chiusura", !string.IsNullOrEmpty(i.chopchi.ToString()) ? i.chopchi.ToString() : String.Empty); + dic.Add("Azienda impianto", !string.IsNullOrEmpty(i.chaziimp) ? i.chaziimp : String.Empty); + dic.Add("Ora appuntamento fine", !string.IsNullOrEmpty(i.choraapf.ToString()) ? i.choraapf.ToString() : String.Empty); + dic.Add("Min appuntamento fine", !string.IsNullOrEmpty(i.chminapf.ToString()) ? i.chminapf.ToString() : String.Empty); + dic.Add("Riferimento chiamata", !string.IsNullOrEmpty(i.chrifer) ? i.chrifer : String.Empty); + dic.Add("Riferimento telefono", !string.IsNullOrEmpty(i.chtelef) ? i.chtelef : String.Empty); + dic.Add("Codice segnalazione", !string.IsNullOrEmpty(i.chcodseg) ? i.chcodseg : String.Empty); + dic.Add("Fermo impianto", !string.IsNullOrEmpty(i.chstopi) ? i.chstopi : String.Empty); + dic.Add("Data assegnazione chiamata", !string.IsNullOrEmpty(i.chdtass.ToString()) ? i.chdtass.ToString() : String.Empty); + dic.Add("Ora assegnazione chiamata", !string.IsNullOrEmpty(i.chorass.ToString()) ? i.chorass.ToString() : String.Empty); + dic.Add("Min assegnazione chiamata", !string.IsNullOrEmpty(i.chminass.ToString()) ? i.chminass.ToString() : String.Empty); + dic.Add("Data chiusura chiamata", !string.IsNullOrEmpty(i.chdtchi.ToString()) ? i.chdtchi.ToString() : String.Empty); + dic.Add("Ora chiusura chiamata", !string.IsNullOrEmpty(i.chorachi.ToString()) ? i.chorachi.ToString() : String.Empty); + dic.Add("Min chiusura chiamata", !string.IsNullOrEmpty(i.chminchi.ToString()) ? i.chminchi.ToString() : String.Empty); + dic.Add("Data inizio intervento", !string.IsNullOrEmpty(i.chdtlin.ToString()) ? i.chdtlin.ToString() : String.Empty); + dic.Add("Ora inizio intervento", !string.IsNullOrEmpty(i.chorali.ToString()) ? i.chorali.ToString() : String.Empty); + dic.Add("Min inizio intervento", !string.IsNullOrEmpty(i.chminli.ToString()) ? i.chminli.ToString() : String.Empty); + dic.Add("Data fine intervento", !string.IsNullOrEmpty(i.chdtlfi.ToString()) ? i.chdtlfi.ToString() : String.Empty); + + dic.Add("Ora fine intervento", !string.IsNullOrEmpty(i.choralf.ToString()) ? i.choralf.ToString() : String.Empty); + dic.Add("Min fine intervento", !string.IsNullOrEmpty(i.chminlf.ToString()) ? i.chminlf.ToString() : String.Empty); + dic.Add("Numero 1 rapportino futuro", !string.IsNullOrEmpty(i.chnrap1.ToString()) ? i.chnrap1.ToString() : String.Empty); + dic.Add("Serie 1 rapportino futuro", !string.IsNullOrEmpty(i.chsrap1) ? i.chsrap1 : String.Empty); + dic.Add("Numero 2 rapportino futuro", !string.IsNullOrEmpty(i.chnrap2.ToString()) ? i.chnrap2.ToString() : String.Empty); + dic.Add("Modalità raccolta chiamata", !string.IsNullOrEmpty(i.chmodrac) ? i.chmodrac : String.Empty); + dic.Add("Numero chiamata per impianto per anno", !string.IsNullOrEmpty(i.chprgann.ToString()) ? i.chprgann.ToString() : String.Empty); + dic.Add("Importo manodopera", !string.IsNullOrEmpty(i.chimpman.ToString()) ? i.chimpman.ToString() : String.Empty); + dic.Add("Percentuale manodopera", !string.IsNullOrEmpty(i.chperman.ToString()) ? i.chperman.ToString() : String.Empty); + dic.Add("Stampa manodopera", !string.IsNullOrEmpty(i.chflstim) ? i.chflstim : String.Empty); + dic.Add("Chiusura da remoto", !string.IsNullOrEmpty(i.chfleste) ? i.chfleste : String.Empty); + dic.Add("Riferimento seriale importazione", !string.IsNullOrEmpty(i.chserext) ? i.chserext : String.Empty); + dic.Add("Descrizione impianto", !string.IsNullOrEmpty(i.imdescri) ? i.imdescri : String.Empty); + dic.Add("Tipo impianto", !string.IsNullOrEmpty(i.imtipoim) ? i.imtipoim : String.Empty); + dic.Add("Matricola impianto ", !string.IsNullOrEmpty(i.immatric) ? i.immatric : String.Empty); + dic.Add("Numero impianto ", !string.IsNullOrEmpty(i.imnumimp) ? i.imnumimp : String.Empty); + dic.Add("Ultimo amministratore ", !string.IsNullOrEmpty(i.imultamm) ? i.imultamm : String.Empty); + dic.Add("Desc Ultimo amministratore ", !string.IsNullOrEmpty(i.imultdam) ? i.imultdam : String.Empty); + dic.Add("Telefono Ult. Amministratore", !string.IsNullOrEmpty(i.imulttam) ? i.imulttam : String.Empty); + + + dic.Add("Ubicazione impianto", !string.IsNullOrEmpty(i.imubicaz) ? i.imubicaz : String.Empty); + dic.Add("Zona manutenzione", !string.IsNullOrEmpty(i.imzonman) ? i.imzonman : String.Empty); + dic.Add("Pubblico/privato", !string.IsNullOrEmpty(i.imflpupr) ? i.imflpupr : String.Empty); + dic.Add("Zona chiamate", !string.IsNullOrEmpty(i.imzonchi) ? i.imzonchi : String.Empty); + dic.Add("Zona supervisione", !string.IsNullOrEmpty(i.imzonsup) ? i.imzonsup : String.Empty); + dic.Add("Data inizio manutenzione", i.imdainma != null ? i.imdainma.ToString() : String.Empty); + dic.Add("Data fine manutenzione", !string.IsNullOrEmpty(i.imdafima.ToString()) ? i.imdafima.ToString() : String.Empty); + dic.Add("Data costruzione", !string.IsNullOrEmpty(i.imdatcos.ToString()) ? i.imdatcos.ToString() : String.Empty); + dic.Add("Numero telesoccorso ", !string.IsNullOrEmpty(i.imteleso) ? i.imteleso : String.Empty); + dic.Add("Email cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Ultimo cliente", !string.IsNullOrEmpty(i.an_email) ? i.an_email : String.Empty); + dic.Add("Codice cliente", !string.IsNullOrEmpty(i.ancodice) ? i.ancodice : String.Empty); + dic.Add("Tipo anagrafica", !string.IsNullOrEmpty(i.antipcon) ? i.antipcon : String.Empty); + #endregion + break; + + default: + + break; + } + o.altri = dic; + + o.imazirif = i.imazirif; + o.imrefref = i.imrefref; + return o; + } + private string getCommessaSietBySerial(string seriale) + { + string commessa = string.Empty; + + try + { + //_commDescSiet = _Siet_commDesc.Commdesc; + //var c = _commDescSiet.Where(c => c.laserial.Equals(seriale)).First(); + //if (c != null && !string.IsNullOrEmpty(c.lacodcom)) + //{ + // commessa = c.lacodcom.Trim(); + // if (!string.IsNullOrEmpty(c.lacodcen)) + // { + // commessa = commessa + " - " + c.lacodcen.Trim(); + // } + //} + } + catch + { + Console.WriteLine(string.Format("*********** {1} Errore Chiamata al metodo getCommessaSietBySerial: seriale:{0} ", seriale, DateTime.Now.ToString())); + } + + return commessa; + } + #endregion + /// chiamatetest + [HttpGet("chiamatetest")] + public async Task>> chiamate(string token) + { + try + { + List ilist = new List(); + string ten = getClaimValueByToken(token, "tenant"); + string ten2 = getClaimValueByToken(token, "tenant2"); + string tenOut = getClaimValueByToken(token, "tenant"); + string tecnico = getClaimValueByToken(token, "tccodice"); + string tenConf = getClaimValueByToken(token, "tenantConfigurazioni"); + if (string.IsNullOrEmpty(ten)) + { + ten = tenConf; + } + + _chiamate = getChiamateByTenant(ten); + + + var calltec = await _chiamate.Where( + t => t.tccodice == tecnico + && t.chcodazi == ten + ).OrderByDescending(t => t.chdtapp).ToListAsync(); + + foreach (Chiamate ch in calltec) + { + Chiamate_out o = new Chiamate_out(); + + o = fillChiamateOut(ch, ten); + + + ilist.Add(o); + } + // cerco le chiamate che devo fare per sostituzioni SE funzione abilitata + //bool cerca_sostituzioni = false; + //cerca_sostituzioni = checkSostituzioneAbilitata(ten); + //if (cerca_sostituzioni) + //{ + // //step 1 : trovo tutte le MIE sostituzioni + // _sostituzione = getSostituzioneByTenant(ten); + // var s = _sostituzione.Where(t => t.tscodazi.Equals(ten) && t.tscodsos.Trim().Equals(tecnico)); + // foreach (Sostituzione ss in s) + // { + // string tecnico_sostituito = string.Empty; + // tecnico_sostituito = ss.tscodtec != null ? ss.tscodtec : string.Empty; + + // //2023-03-13: cancellato il filtro sulla zona perchè il tecnico che sostituisce spesso è di un'altra zona + // //string zona = string.Empty; + // //zona = ss.tscodzon != null ? ss.tscodzon : "zonavuota"; + + // //step 2 : trovo tutte le chiamate del tecnico che sto sostitutendo e le aggiungo alla mie + // var calltecSost = await _chiamate.Where( + // t => t.tccodice == tecnico_sostituito + // && t.chcodazi == ten + // //&& t.imzonchi.Equals(zona) + // ).OrderByDescending(t => t.chdtapp).ToListAsync(); + + // foreach (Chiamate ch in calltecSost) + // { + // Chiamate_out o = new Chiamate_out(); + // if (tenOut.Equals(Clienti.VT)) + // { + // o = fillChiamateOutVT(ch, ten); + // } + // else + // { + // o = fillChiamateOut(ch, ten); + // } + + // ilist.Add(o); + // } + // } + //} + + IEnumerable enumerable = ilist as IEnumerable; + + //return StatusCode(StatusCodes.Status200OK, enumerable.Take(100)); + return StatusCode(StatusCodes.Status200OK, enumerable); + } + catch (Exception ex) + { + string err = "Errore: " + ex.Message; + return StatusCode(StatusCodes.Status500InternalServerError, err); + } + } + } diff --git a/ApiPolo/Data/Maras_DbContext.cs b/ApiPolo/Data/Maras_DbContext.cs index 7c67cfb..b88f741 100644 --- a/ApiPolo/Data/Maras_DbContext.cs +++ b/ApiPolo/Data/Maras_DbContext.cs @@ -1,9 +1,11 @@ using ApiPolo.Interfaces; using ApiPolo.Models; +using ApiPolo.Models.Security_dbcontext; using Microsoft.EntityFrameworkCore; namespace ApiPolo.Data { + /// public class Maras_DbContext : DbContext,ITenantDbContext { #region PROPERTIES @@ -55,11 +57,14 @@ namespace ApiPolo.Data public DbSet? Commesse { get; set; } #endregion + /// + public Maras_DbContext(DbContextOptions options) : base(options) + { + } - + /// protected override void OnModelCreating(ModelBuilder modelBuilder) { - void TryConfigureEntity(Action configure, string entityName) { try diff --git a/ApiPolo/Data/Marro_DbContext.cs b/ApiPolo/Data/Marro_DbContext.cs new file mode 100644 index 0000000..1bda6c2 --- /dev/null +++ b/ApiPolo/Data/Marro_DbContext.cs @@ -0,0 +1,176 @@ +using ApiPolo.Interfaces; +using ApiPolo.Models; +using ApiPolo.Models.Security_dbcontext; +using Microsoft.EntityFrameworkCore; + +namespace ApiPolo.Data +{ + /// + public class Marro_DbContext : DbContext,ITenantDbContext + { + #region PROPERTIES + public DbSet? Causali { get; set; } + + public DbSet? Chiusure { get; set; } + + public DbSet? Azi { get; set; } + + public DbSet? ccci { get; set; } + + public DbSet? ccciWiev { get; set; } + + public DbSet? Chiamate { get; set; } + + public DbSet? Clienti { get; set; } + + public DbSet? Componen { get; set; } // IN CONFLITTO CON Compo_Impia + + //public DbSet? Componen { get; set; } //CAMBIARE NOME!!! + + public DbSet? Impia { get; set; } + + public DbSet? Mag { get; set; } + + public DbSet? Magaz { get; set; } + + public DbSet? Manutenzioni { get; set; } + + public DbSet? Pagamenti { get; set; } + + public DbSet? Prese { get; set; } + + public DbSet? Rapps { get; set; } + + public DbSet? rapp { get; set; } + + public DbSet? Sost { get; set; } + + public DbSet? Saldi { get; set; } + + public DbSet? StoRapp { get; set; } + + public DbSet? Tecnici { get; set; } + public DbSet? StoImp { get; set; } + + public DbSet? Timbr { get; set; } + + public DbSet? Commesse { get; set; } + #endregion + + /// + public Marro_DbContext(DbContextOptions options) : base(options) + { + } + + /// + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + void TryConfigureEntity(Action configure, string entityName) + { + try + { + configure(modelBuilder); + } + catch (Exception ex) + { + Console.WriteLine($"Warning: Skipping entity '{entityName}' due to error: {ex.Message}"); + } + } + + TryConfigureEntity(mb => mb.Entity().ToView("API_CAUS_RAPP"), "API_CAUS_RAPP"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_CHIUSURE"), "API_CHIUSURE"); + + TryConfigureEntity(mb => + { + mb.Entity().ToTable("PIAZIRIF"); + mb.Entity().HasKey(table => new + { + table.piazihoc, + table.picodtec, + table.pirifazi + }); + }, "PIAZIRIF"); + + TryConfigureEntity(mb => + { + mb.Entity().ToTable("PIASSCHIU"); + mb.Entity().HasKey(table => new + { + table.picodazi, + table.picodint, + table.picodchi + }); + }, "PIASSCHIU"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_ASSCHIU"), "API_ASSCHIU"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_CHIAMATE"), "API_CHIAMATE"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_CLIENTI"), "API_CLIENTI"); + + TryConfigureEntity(mb => + { + mb.Entity().ToTable("DISCOMICOMIMP"); + mb.Entity().HasKey(table => new + { + table.cocodimp, + table.cprownum, + table.cocodazi + }); + }, "DISCOMICOMIMP"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_MICOMIMP"), "API_MICOMIMP"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_IMPIANTI"), "API_IMPIANTI"); + + TryConfigureEntity(mb => + { + mb.Entity().ToTable("DISCOMAG_NEW"); + mb.Entity().HasKey(table => new + { + table.seriale_rapportino, + table.riga + }); + }, "DISCOMAG_NEW"); + + TryConfigureEntity(mb => mb.Entity().ToTable("DISCOMAGAZZIN"), "DISCOMAGAZZIN"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_MANPROG"), "API_MANPROG"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_PAGAMENTI"), "API_PAGAMENTI"); + + TryConfigureEntity(mb => + { + mb.Entity().ToTable("PIPRESA"); + mb.Entity().HasKey(table => new + { + table.picodazi, + table.pimpianto, + table.picodint, + table.pidatman + }); + }, "PIPRESA"); + + TryConfigureEntity(mb => mb.Entity().ToTable("RAPP_NEW"), "RAPP_NEW"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_RAPPORTINI"), "API_RAPPORTINI"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_SALDIART_PREZZI"), "API_SALDIART_PREZZI"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_SOSTITUZIONI"), "API_SOSTITUZIONI"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_STO_RAPP"), "API_STO_RAPP"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_TECNICI"), "API_TECNICI"); + + TryConfigureEntity(mb => mb.Entity().ToTable("TIMBRATURE"), "TIMBRATURE"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_COMMESSE"), "API_COMMESSE"); + + TryConfigureEntity(mb => mb.Entity().ToView("API_STO_IMP"), "API_STO_IMP"); + + + } + } +} diff --git a/ApiPolo/Interfaces/TenantDbContextFactory.cs b/ApiPolo/Interfaces/TenantDbContextFactory.cs index 1c18d20..aed0627 100644 --- a/ApiPolo/Interfaces/TenantDbContextFactory.cs +++ b/ApiPolo/Interfaces/TenantDbContextFactory.cs @@ -1,29 +1,27 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; +using ApiPolo.Data; using ApiPolo.Interfaces; -using System; -using System.Collections.Generic; using static ApiPolo.Controllers.PoloController; -using ApiPolo.Data; -namespace ApiPolo.Services +public class TenantDbContextFactory : ITenantDbContextFactory { - public class TenantDbContextFactory : ITenantDbContextFactory + private readonly IServiceProvider _serviceProvider; + + public TenantDbContextFactory(IServiceProvider serviceProvider) { - private readonly IServiceProvider _serviceProvider; + _serviceProvider = serviceProvider; + } - public TenantDbContextFactory(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - } - - public ITenantDbContext GetDbContext(string tenant) + public ITenantDbContext GetDbContext(string tenant) + { + // Create a scope to resolve DbContext + using (var scope = _serviceProvider.CreateScope()) { return tenant switch { - Clienti.Maras => _serviceProvider.GetRequiredService(), + Clienti.Maras => scope.ServiceProvider.GetRequiredService(), + Clienti.Marrocco => scope.ServiceProvider.GetRequiredService(), // Add other tenants as needed - // Clienti.AnotherTenant => _serviceProvider.GetRequiredService(), + // Clienti.AnotherTenant => scope.ServiceProvider.GetRequiredService(), _ => throw new KeyNotFoundException($"No DbContext found for tenant: {tenant}") }; } diff --git a/ApiPolo/Startup.cs b/ApiPolo/Startup.cs index 9e7c94b..f432278 100644 --- a/ApiPolo/Startup.cs +++ b/ApiPolo/Startup.cs @@ -1015,12 +1015,19 @@ namespace ApiPolo )); #endregion + + //TEST + services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString("MARAS") , options => { options.CommandTimeout(commandTimeoutInSeconds); } )); + services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString("MARRO") + , options => { options.CommandTimeout(commandTimeoutInSeconds); } + )); + // FACTORY MUTI-TENANT - services.AddSingleton(); + services.AddScoped(); services.AddSwaggerGen(gen =>