public PilBase(Servizio servizio, Ambiente ambiente) { Ambiente = ambiente; Servizio = servizio; IdRichiesta = Guid.NewGuid().ToString(); Init(); }
public void Invio() { Ambiente ambiente = null; Servizio servizio = null; ambiente = new Ambiente { customerid = "nello.citta.npce", costcenter = "UNF", billingcenter = "IdCdF", idsender = "999988", sendersystem = "H2H", smuser = "******", contracttype = "PosteWeb", usertype = "B", LolUri = "http://10.10.5.101/LOLGC/LolService.svc", Username = "******", Password = "******" }; servizio = GetServizio().Result; var operation = new RecuperaIdRichiestaLol(ambiente); var idRichiesta = operation.Execute(); var invioOperation = new InvioLol(ambiente, servizio, idRichiesta); invioOperation.Execute(); }
private Servizio CreateNewServizio() { var servizio = new Servizio(); _servizioRepository.Add(servizio); return(servizio); }
public void caricaParametri(Servizio servizio) { List <Servizio> retList = new List <Servizio>(); try { Query query = InitQuery.getInstance().getQuery("S_PARAMETRI_SERVIZIO_ESTERNO"); query.setParam("idServizio", servizio.getId()); string commandText = query.getSQL(); logger.Debug(commandText); using (DocsPaDB.DBProvider dbProvider = new DBProvider()) { using (IDataReader reader = dbProvider.ExecuteReader(commandText)) { while (reader.Read()) { string descrizioneParametro = reader.GetValue(reader.GetOrdinal("DESCRIZIONE")).ToString(); string tipoParametro = reader.GetValue(reader.GetOrdinal("TIPO_VALORE")).ToString(); servizio.addParametro(descrizioneParametro, tipoParametro); } } } } catch (Exception ex) { logger.Debug(ex); throw new Exception(ex.Message); } }
public List <Servizio> getServizi() { List <Servizio> retList = new List <Servizio>(); try { Query query = InitQuery.getInstance().getQuery("S_SERVIZI_ESTERNI"); string commandText = query.getSQL(); logger.Debug(commandText); using (DocsPaDB.DBProvider dbProvider = new DBProvider()) { using (IDataReader reader = dbProvider.ExecuteReader(commandText)) { while (reader.Read()) { Servizio tempServizio = new Servizio(); tempServizio.setId(reader.GetValue(reader.GetOrdinal("SYSTEM_ID")).ToString()); tempServizio.setDescrizione(reader.GetValue(reader.GetOrdinal("DESCRIZIONE")).ToString()); retList.Add(tempServizio); } } } return(retList); } catch (Exception ex) { logger.Debug(ex); throw new Exception(ex.Message); } }
public void Invio_1_Destinatario_OK() { var ctx = new AppDbContext(_options); var ambiente = new Ambiente { Description = "COLLAUDO", customerid = "nello.citta.npce", costcenter = "UNF", billingcenter = "IdCdF", idsender = "999988", sendersystem = "H2H", smuser = "******", contracttype = "PosteWeb", usertype = "B", //LolUri = "http://10.60.19.13/LOLGC/LolService.svc", LolUri = "http://10.60.20.52/LOLGC/LolService.svc", Username = "******", Password = "******" }; Anagrafica destinatario; Anagrafica mittente; destinatario = ctx.Anagrafiche.First(); mittente = ctx.Anagrafiche.Skip(1).First(); var documento = ctx.Documenti.First(); var servizio = new Servizio(); servizio.ServizioAnagrafiche.Add( new ServizioAnagrafica { Anagrafica = destinatario, IsMittente = false }); servizio.ServizioAnagrafiche.Add( new ServizioAnagrafica { Anagrafica = mittente, IsMittente = true }); servizio.ServizioDocumenti.Add(new ServizioDocumento { Documento = documento }); LOLService service = new LOLService(servizio, ambiente); try { var result = service.Invia(); Assert.IsTrue((int.Parse(result.Code) == 0)); } catch (System.Exception) { throw; } }
private static bool EseguiAzione(Servizio servizio) { bool retVal = false; string parametri; foreach (Dictionary <String, String> parametro in servizio.getParametri()) { } return(retVal); }
public override async Task LoadAsync(int id) { Servizio servizio = (id > 0) ? await _servizioRepository.GetByIdAsync(id) : CreateNewServizio(); Id = id; InitializeServizio(servizio); _allAnagrafiche = _servizioRepository.GetAllAnagrafiche(); _allDocumenti = _servizioRepository.GetAllDocumenti(); SetupControls(); }
public async Task <Servizio> AddServizioAsync(Servizio servizio) { try { var addedEntity = appDbContext.Servizi.Add(servizio); await appDbContext.SaveChangesAsync(); return(addedEntity.Entity); } catch (Exception ex) { throw(ex); } }
public IActionResult AddServizio([FromBody] Servizio servizio) { if (servizio == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var createdServizio = serviziRepository.AddServizioAsync(servizio); return(Created("Servizio", createdServizio)); }
public static string AvviaServizioFatturazione(DocsPaVO.utente.InfoUtente infoUtente, string docNumber, int diagramId) { string result = string.Empty; try { DocsPaDB.Query_DocsPAWS.ExternalServices externalServices = new DocsPaDB.Query_DocsPAWS.ExternalServices(); Servizio servizioFatturazione = externalServices.getServizioFatturazione(); result = InviaASdi(infoUtente, docNumber, diagramId.ToString(), servizioFatturazione.getCodiceEsecutore()); } catch (Exception ex) { result = "-1"; } return(result); }
public async Task <Servizio> AddServizioAsync(Servizio servizio) { try { var servizioJson = new StringContent(JsonSerializer.Serialize(servizio), Encoding.UTF8, "application/json"); var response = await httpClient.PostAsync("api/servizi", servizioJson); if (response.IsSuccessStatusCode) { return(await JsonSerializer.DeserializeAsync <Servizio>(await response.Content.ReadAsStreamAsync())); } } catch (Exception ex) { throw; } return(null); }
public Servizio getServizioFatturazione() { logger.Debug("BEGIN"); Servizio servizio = new Servizio(); try { Query query = InitQuery.getInstance().getQuery("S_GET_SERVIZIO_FATTURAZIONE"); string command = query.getSQL(); logger.Debug("QUERY - " + command); using (DBProvider dbProvider = new DBProvider()) { DataSet ds; if (!dbProvider.ExecuteQuery(out ds, command)) { throw new Exception(dbProvider.LastExceptionMessage); } if (ds != null && ds.Tables[0] != null) { DataRow row = ds.Tables[0].Rows[0]; servizio.setId(row["SYSTEM_ID"].ToString()); servizio.setDescrizione(row["DESCRIZIONE"].ToString()); servizio.setCodiceEsecutore(row["CODICE_ESECUTORE"].ToString()); caricaParametri(servizio); } } } catch (Exception ex) { logger.Error("Errore in getServizioFatturazione - ", ex); servizio = null; } logger.Debug("END"); return(servizio); }
protected override async Task OnInitializedAsync() { Loaded = false; Ambienti = await AmbientiDataService.GetAllAmbienti(); Saved = false; if (string.IsNullOrEmpty(ServizioId)) //new servizio is being created { // add some defaults Servizio = new Servizio { DataCreazione = System.DateTime.Now }; } else { // TODO: Get servizio by id Servizio = await ServiziDataService.GetServizioDetailAsync(int.Parse(ServizioId)); } Loaded = true; }
private void InitializeServizio(Servizio servizio) { Servizio = new ServizioWrapper(servizio); Servizio.PropertyChanged += (s, e) => { if (!HasChanges) { HasChanges = _servizioRepository.HasChanges(); } if (e.PropertyName == nameof(Servizio.HasErrors)) { ((DelegateCommand)SaveCommand).RaiseCanExecuteChanged(); } }; ((DelegateCommand)SaveCommand).RaiseCanExecuteChanged(); // Little trick to trigger validation on a new anagrafica if (Servizio.Id == 0) { Servizio.FronteRetro = false; } SetTitle(); }
public Mansione(Qualifica incarico, Servizio servizio) { _incarico = incarico; _servizio = servizio; Retribuzioni.Add(new RetribuzioneMansione(DateTime.MinValue, DateTime.MaxValue, 0)); }
public NpceOperationBase(Ambiente ambiente, Servizio servizio, string idRichiesta) : this(ambiente, idRichiesta) { _servizio = servizio; }
public InvioLol(Ambiente ambiente, Servizio servizio, string idRichiesta) : base(ambiente, servizio, idRichiesta) { }
public Task EditServizioAsync(Servizio servizio) { throw new NotImplementedException(); }
public MansioneSteward(Servizio servizio) : base(Qualifica.Steward, servizio) { }
public LOLService(Servizio servizio, Ambiente ambiente) : base(servizio, ambiente) { }
public override int GetHashCode() { return(Incarico.GetHashCode() ^ Servizio.GetHashCode() ^ Retribuzioni.GetHashCode()); }
public ServiceBase(Servizio servizio, Ambiente ambiente, string idRichiesta) : this(servizio, ambiente) { IdRichiesta = IdRichiesta; Init(); }
public ServiceBase(Servizio servizio, Ambiente ambiente) { Ambiente = ambiente; Servizio = servizio; Init(); }
public void Invio_1_Destinatario_OK() { var ctx = new AppDbContext(_options); var ambiente = new Ambiente { Description = "COLLAUDO", customerid = "nello.citta.npce", costcenter = "UNF", billingcenter = "IdCdF", idsender = "999988", sendersystem = "H2H", smuser = "******", contracttype = "PosteWeb", contractid = "contracoId", codicefiscale = "mcrpql64t08f537u", partitaiva = "01234567890", usertype = "B", customer = "customer", LolUri = "http://10.60.20.132/NPCE_EntryPoint/WsCE.svc", //LolUri = "http://10.60.19.36/NPCE_EntryPoint/WsCE.svc", Username = "******", Password = "******" }; Anagrafica destinatario; Anagrafica mittente; destinatario = ctx.Anagrafiche.First(); mittente = ctx.Anagrafiche.Skip(1).First(); var documento = ctx.Documenti.First(); var servizio = new Servizio(); servizio.ServizioAnagrafiche.Add( new ServizioAnagrafica { Anagrafica = destinatario, IsMittente = false }); servizio.ServizioAnagrafiche.Add( new ServizioAnagrafica { Anagrafica = mittente, IsMittente = true }); servizio.ServizioDocumenti.Add(new ServizioDocumento { Documento = documento }); servizio.TipoServizioId = (int)TipoServizioId.POSTA4; LOLPil service = new LOLPil(servizio, ambiente); try { var result = service.Invia(); Assert.IsTrue(result.Code == "I"); } catch (System.Exception) { throw; } }
public async Task InvioAsync_Confirm_1_Destinatario_OK_Certificazione() { var ctx = new AppDbContext(_options); var ambiente = new Ambiente { Description = "CERTIFICAZIONE", customerid = "nello.citta.npce", costcenter = "UNF", billingcenter = "IdCdF", idsender = "999988", sendersystem = "H2H", smuser = "******", contracttype = "PosteWeb", contractid = "contractId", codicefiscale = "mcrpql64t08f537u", partitaiva = "01234567890", usertype = "B", customer = "customer", LolUri = "http://10.60.25.228/NPCE_EntryPoint/WsCE.svc", Username = "******", Password = "******" }; Anagrafica destinatario; Anagrafica mittente; destinatario = ctx.Anagrafiche.First(); mittente = ctx.Anagrafiche.Skip(1).First(); var documento = ctx.Documenti.First(); var servizio = new Servizio(); servizio.ServizioAnagrafiche.Add( new ServizioAnagrafica { Anagrafica = destinatario, IsMittente = false }); servizio.ServizioAnagrafiche.Add( new ServizioAnagrafica { Anagrafica = mittente, IsMittente = true }); servizio.ServizioDocumenti.Add(new ServizioDocumento { Documento = documento }); servizio.TipoServizioId = (int)TipoServizioId.POSTA4; LOLPil service = new LOLPil(servizio, ambiente); try { var result = await service.InviaAsync(); string idRichiesta = result.IdRichiesta; Assert.IsTrue(result.Code == "I"); service = new LOLPil(servizio, ambiente); // Attesa prezzatura System.Threading.Thread.Sleep(20000); result = await service.ConfermaAsync(idRichiesta); Assert.IsTrue(result.Code == "I"); } catch (System.Exception) { throw; } }
public PreConfermaLol(Ambiente ambiente, Servizio servizio, string idRichiesta, string guidUtente, bool autoConferma) : base(ambiente, servizio, idRichiesta) { _guidUtente = guidUtente; _autoConferma = autoConferma; }