private void btnConfermaClick(object sender, EventArgs e) { try { validationSummary1.Validate(); if (validationSummary1.IsValid) { var result = getVersamentoService().InsertVersamentoByPersona((int)esercizi.Value, (int)contoPatrimoniale.Value, (int?)sottoContoPatrimoniale.Value, dataVersamento.DateTime, assegno.Text, causale.Text, nota.Text, _idMovimentoBancario, DataGridHelper.GetRigheSelezionate<RataPersonaDTO>(listaRate, false), getTipoVersamentoDopoChiusura(), null); if (result != null && result.Count > 0) { var message = result.Where(res => !string.IsNullOrEmpty(res.Message)).Aggregate(string.Empty, (current, res) => current + (res.Message + Environment.NewLine)); if (string.IsNullOrEmpty(message)) { OnAfterUpdate(new AfterUpdateArgs(0)); _idMovimentoPatrimoniale = result[0].IdMovimentoContabile; var formConferma = new ConfermaVersamentoUI(_condominio, getEsercizio(), result, getVersamentoService()); formConferma.ShowDialog(); formConferma.Dispose(); rataPersonaDTOBindingSource.Clear(); condomini.Value = null; contoPatrimoniale.Value = null; sottoContoPatrimoniale.Value = null; importo.ValueObject = null; assegno.Text = null; nota.Text = null; _importoModificato = false; } else CommonMessages.DisplayWarning("Si sono verificati problemi nella registrazione del versamento:" + Environment.NewLine + message + Environment.NewLine + "Si prega di riprovare."); } } else validationSummary1.ShowErrorSummary(); } catch (Exception ex) { _log.ErrorFormat("Errore inaspettato nella conferma del versamento - {0} - esercizio tendina:{1} - esercizio variabile:{2} - condomino:{3}", ex, Utility.GetMethodDescription(), esercizi.Value, _esercizio.ID, _idCondomino); throw; } }
private void btnConfermaClick(object sender, EventArgs e) { validationSummary1.Validate(); if (validationSummary1.IsValid) { var result = getVersamentoService().InsertVersamento((int)esercizi.Value, (int)condomini.Value, (int)contoPatrimoniale.Value, (int?)sottoContoPatrimoniale.Value, dataVersamento.DateTime, importo.Value, assegno.Text, causale.Text, nota.Text, _idMovimentoBancario, DataGridHelper.GetRigheSelezionate<RataSoggettoVersataDTO>(listaRate, false), getTipoVersamentoDopoChiusura(), null); if (string.IsNullOrEmpty(result.Message)) { OnAfterUpdate(new AfterUpdateArgs(0)); _idMovimentoPatrimoniale = result.IdMovimentoContabile; var listaResult = new List<ResultVersamento>(1) {result}; var formConferma = new ConfermaVersamentoUI(_condominio, getEsercizio(), listaResult, getVersamentoService()); formConferma.ShowDialog(this); formConferma.Dispose(); rataSoggettoDTOBindingSource.Clear(); condomini.Value = null; contoPatrimoniale.Value = null; sottoContoPatrimoniale.Value = null; importo.ValueObject = null; assegno.Text = null; nota.Text = null; _importoModificato = false; } else CommonMessages.DisplayWarning("Si sono verificati problemi nella registrazione del versamento:" + Environment.NewLine + result.Message + Environment.NewLine + "Si prega di riprovare."); } else validationSummary1.ShowErrorSummary(); }
private void btnConfermaClick(object sender, EventArgs e) { validationSummary1.Validate(); if (validationSummary1.IsValid) { var result = getVersamentiCondominiService().InsertVersamento(getEsercizio().ID, (int)condomini.Value, (int)contoPatrimoniale.Value, (int?)sottoContoPatrimoniale.Value, dataVersamento.DateTime, importo.Value, assegno.Text, causale.Text, nota.Text, null, null, getTipoVersamentoDopoChiusura(), null); if (string.IsNullOrEmpty(result.Message)) { var listaResult = new List<ResultVersamento>(1) {result}; var formConferma = new ConfermaVersamentoUI(_condominio, getEsercizio(), listaResult, getVersamentiCondominiService()); formConferma.ShowDialog(this); formConferma.Dispose(); condomini.Value = null; contoPatrimoniale.Value = null; sottoContoPatrimoniale.Value = null; importo.ValueObject = null; assegno.Text = null; nota.Text = null; } else CommonMessages.DisplayWarning("Si sono verificati problemi nella registrazione del versamento: " + Environment.NewLine + result.Message + Environment.NewLine + "Si prega di riprovare."); } else validationSummary1.ShowErrorSummary(); }