private void load()
        {
            Visible = false;

            // --------------------------------------------------------
            // Controllo se è ammessa creazione del riparto
            // --------------------------------------------------------
            var importo = getBilancioService().GetImportoPreventivo(_esercizio.ID);
            if (importo != null)
            {
                var messaggio = getRateCondominiService().IsAllowNewPianoRateale(_esercizio.ID);

                if (string.IsNullOrEmpty(messaggio.FatalMessage))
                {
                    var result = DialogResult.Yes;
                    if(!string.IsNullOrEmpty(messaggio.WarnMessage))
                        result = CommonMessages.DisplayConfirm("ATTENZIONE: " + messaggio.WarnMessage + Environment.NewLine + "Vuoi confermare l'operazione?");

                    if(result == DialogResult.Yes)
                    {
                        importoDaRipartire.Text = importo.Value.ToString("c");
                        Visible = true;

                        hideShowControls(true);
                        numeroRate.ValueChanged -= numeroRateValueChanged;
                        arrotondamentoImporti.ValueChanged -= arrotondamentoImportiValueChanged;
                        numeroRate.Value = 4;
                        arrotondamentoImporti.SelectedIndex = 0;
                        numeroRate.ValueChanged += numeroRateValueChanged;
                        arrotondamentoImporti.ValueChanged += arrotondamentoImportiValueChanged;

                        // --------------------------------------------------------
                        // Caricamento primo tab del wizard
                        // --------------------------------------------------------
                        rendicontoBindingSource.DataSource = getBilancioService().GetRendicontiByEsercizio(_esercizio.ID, TipoRendiconto.Preventivo);
                        if (rendicontoBindingSource.Count == 1)
                        {
                            rendicontoPreventivo.ValueChanged -=rendicontoPreventivoValueChanged;
                            rendicontoPreventivo.SelectedIndex = 0;
                            rendicontoPreventivo.ValueChanged += rendicontoPreventivoValueChanged;
                        }

                        var form = new ExecuteLoadDataObjectAsync<ResultRiepilogoRipartoDTO>();
                        Func<ResultRiepilogoRipartoDTO> loadDati = () => getRateCondominiService().GetRiepilogoRiparto(_esercizio.ID, null, null, getIdRendiconto(), _tipo);
                        form.LoadData(loadDati);
                        form.ShowDialog();

                        if (form.DataSourceObject.RiepilogoRiparto != null)
                        {
                            riepilogoRipartoBindingSource.DataSource = form.DataSourceObject.RiepilogoRiparto;


                            form.Dispose();
                            hideShowControls(false);

                            //riepilogoRipartoBindingSource.DataSource = getRateCondominiService().GetRiepilogoRiparto(_esercizio.ID, null, null, getIdRendiconto());

                            if (listaRiepilogoRiparto.DisplayLayout.Bands[0].Summaries.Count == 0)
                            {
                                DataGridHelper.AddSummary(listaRiepilogoRiparto.DisplayLayout.Bands[0], "SaldoEsercizioPrecedente", "c");
                                DataGridHelper.AddSummary(listaRiepilogoRiparto.DisplayLayout.Bands[0], "TotaleADebito", "c");
                                DataGridHelper.AddSummary(listaRiepilogoRiparto.DisplayLayout.Bands[0], "Importo", "c");
                            }

                            // --------------------------------------------------------
                            // Caricamento secondo tab del wizard
                            // --------------------------------------------------------
                            int? rataAssegnazioneResiduo = null;
                            if (assegnazioneResiduo.Value != null && (int)assegnazioneResiduo.Value > -1)
                                rataAssegnazioneResiduo = (int)assegnazioneResiduo.Value;
                            var resultPianoRateale = getRateCondominiService().CreatePianoRateale(new PianoRatealeDTO { IdEsercizio = _esercizio.ID, ArrontondamentoImporti = (decimal)arrotondamentoImporti.Value, IdRendiconto = getIdRendiconto(), IdRataArrotondamenti = rataAssegnazioneResiduo, Tipo = _tipo }, (int)numeroRate.Value, (List<RiepilogoRipartoDTO>)riepilogoRipartoBindingSource.DataSource);
                            if (resultPianoRateale.Result != null)
                            {
                                _pianoRateale = resultPianoRateale.Result;
                                pianoRatealeDettaglioDTOBindingSource.DataSource = _pianoRateale.Rate;

                                loadRataArrotondamento();
                                rendicontoPreventivo.ValueChanged -= rendicontoPreventivoValueChanged;
                                rendicontoPreventivo.Value = _pianoRateale.IdRendiconto;
                                rendicontoPreventivo.ValueChanged += rendicontoPreventivoValueChanged;

                                if (listaRate.DisplayLayout.Bands[0].Summaries.Count == 0)
                                {
                                    DataGridHelper.AddSummary(listaRate.DisplayLayout.Bands[0], "PercentualeRipartoSaldo", "##.00%");
                                    DataGridHelper.AddSummary(listaRate.DisplayLayout.Bands[0], "PercentualeRiparto", "##.00%");
                                    DataGridHelper.AddSummary(listaRate.DisplayLayout.Bands[0], "Importo", "c");
                                }

                                assegnazioneResiduo.ValueChanged -= assegnazioneResiduoValueChanged;
                                assegnazioneResiduo.SelectedIndex = 0;
                                assegnazioneResiduo.ValueChanged += assegnazioneResiduoValueChanged;

                                mainTab.Tabs["pianoRateale"].Enabled = false;
                                mainTab.Tabs["rateSoggetti"].Enabled = false;
                                _avanzamento = AvanzamentoWizard.RiepilogoRiparto;

                                listaRiepilogoRiparto.PerformAction(UltraGridAction.EnterEditMode, false, false);
                                listaRiepilogoRiparto.UpdateData();
                            }
                            else
                            {
                                if (!string.IsNullOrEmpty(resultPianoRateale.FatalMessage))
                                    CommonMessages.DisplayWarning(string.Format("Si sono verificati dei problemi nella creazione del piano rateale:{0}{1}", Environment.NewLine, resultPianoRateale.FatalMessage));
                                var mainContabilita = (MainContabilita)ParentForm;
                                if (mainContabilita != null)
                                    mainContabilita.ToClose = true;
                            }
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(form.DataSourceObject.FatalMessage))
                                CommonMessages.DisplayWarning("Non è ammessa la creazione del piano rateale:" + Environment.NewLine + form.DataSourceObject.FatalMessage);
                            var mainContabilita = (MainContabilita)ParentForm;
                            if (mainContabilita != null)
                                mainContabilita.ToClose = true;
                        }

                    }
                }
                else
                {
                    CommonMessages.DisplayWarning("Non è ammessa la creazione del piano rateale:" + Environment.NewLine + messaggio.FatalMessage);
                    var mainContabilita = (MainContabilita)ParentForm;
                    if (mainContabilita != null) 
                        mainContabilita.ToClose = true;
                }
            }
            else
            {
                CommonMessages.DisplayWarning("Prima di definire il riparto rateale occorre generare il bilancio preventivo.");
                var mainContabilita = (MainContabilita)ParentForm;
                if (mainContabilita != null) 
                    mainContabilita.ToClose = true;
            }
        }
Example #2
0
        private void btnPdfClick(object sender, EventArgs e)
        {
            try
            {
                if (CommonMessages.DisplayConfirm("Sei sicuro di voler confermare il versamento delle ritenute selezionate?") == DialogResult.Yes)
                {
                    validationSummary1.Validate();

                    if (validationSummary1.IsValid)
                    {
                        if (mittente.Value != null)
                        {
                            var mittenteCondominio = mittente.Value.ToString() == "C";

                            try
                            {
                                if (getRitenutaAccontoService().Salva(getRitenuteSelezionate(), dataPagamento.DateTime, descrizioneDisposizione.Text, nomeFile.Text + @".pdf", descrizioneAddebitoInteressi.Text, descrizioneAddebitoSanzioni.Text, mittenteCondominio, testataPerCondominio.Checked, TipoVersamentoF24Enum.PDF))
                                {
                                    CommonMessages.DisplayComplete("Il versamento delle ritenute è stato regolarmente registrato.");
                                    ritenuteAccontoUILoad(this, EventArgs.Empty);
                                    try
                                    {
                                        wizardPagamentoRitenute.Tabs[1].Enabled = false;
                                        wizardPagamentoRitenute.Tabs[0].Enabled = true;
                                        wizardPagamentoRitenute.SelectedTab = wizardPagamentoRitenute.Tabs[0];
                                    }
                                    catch (Exception ex)
                                    {
                                        _log.ErrorFormat("Errore nel tab changed - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                                    }
                                    _avanzamento = AvanzamentoWizard.SceltaRitenute;

                                    btnFine.Visible = false;
                                    btnPdf.Visible = false;
                                }
                                else
                                    CommonMessages.DisplayWarning("Si sono verificati problemi durante la registrazione del versamento delle ritenute.");
                            }
                            catch (Exception ex)
                            {
                                _log.ErrorFormat("Errore nel salvataggio del ritenute - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                                CommonMessages.DisplayWarning("Si sono verificati problemi durante la registrazione del versamento delle ritenute.");
                            }
                        }
                    }
                    else
                        validationSummary1.ShowErrorSummary();
                }

            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nella creazione del PDF delle ritenute - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                throw;
            }
        }
Example #3
0
        private void btnIndietroClick(object sender, EventArgs e)
        {
            try
            {
                if (_avanzamento == AvanzamentoWizard.Fine || _avanzamento == AvanzamentoWizard.Errori)
                {
                    wizardGenerazione770.Tabs["creazioneFile"].Enabled = false;
                    btnIndietro.Enabled = false;

                    btnAvanti.Enabled = true;
                    btnFine.Visible = false;

                    wizardGenerazione770.Tabs["ritenute"].Enabled = true;
                    try
                    {
                        wizardGenerazione770.SelectedTab = wizardGenerazione770.Tabs["ritenute"];
                    }
                    catch (Exception ex)
                    {
                        _log.ErrorFormat("Errore nella selezione del tab - SELECTED - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                    }

                    _avanzamento = AvanzamentoWizard.SceltaRitenute;
                }
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nella selezione del tab - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                throw;
            }
        }
        private void load()
        {
            Clear();
            if (_esercizio != null)
            {
                listaRateSoggetti.Visible = true;
                panelButtons.Visible = true;

                // ----------------------------------------------------------------------
                // Caricamento primo TAB
                // ----------------------------------------------------------------------
                getRateCondominiService().GetPianoRatealeByEsercizio(_esercizio.ID, true);
                Visible = true;

                listaRateSoggetti.InitializeRow += listaRateSoggettiInitializeRow;
                listaRateSoggetti.CellChange += listaRateSoggettiCellChange;

                dettaglioEmissioneRateDTOBindingSource.DataSource =
                    getRateCondominiService().GetRateDaRichiamare(_esercizio.ID);
                btnAvanti.Enabled = dettaglioEmissioneRateDTOBindingSource.Count != 0;

                causale.Text = getRateCondominiService().GetCausale(_esercizio);

                intestazoneAzienda.Text = getRateCondominiService().GetIntestazioneMAVAzienda();

                mainTab.Tabs["riepilogoRate"].Enabled = true;
                mainTab.Tabs["emissione"].Enabled = false;
                mainTab.SelectedTab = mainTab.Tabs["riepilogoRate"];
                _avanzamento = AvanzamentoWizard.RiepilogoRate;

                listaRateSoggetti.InitializeRow -= listaRateSoggettiInitializeRow;
            }

        }
Example #5
0
        private void btnIndietroClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.Fine)
            {
                validationSummary1.Validators.Remove(reqDescrizione);
                validationSummary1.Validators.Remove(reqNomeFile);
                validationSummary1.Validators.Remove(reqDescrizioneInteressi);
                validationSummary1.Validators.Remove(reqDescrizioneSanzioni);
                validationSummary1.Validators.Remove(customValidatorFileName);

                wizardPagamentoRitenute.Tabs[1].Enabled = false;
                wizardPagamentoRitenute.Tabs[0].Enabled = true;
                wizardPagamentoRitenute.SelectedTab = wizardPagamentoRitenute.Tabs[0];
                btnIndietro.Enabled = false;
                btnAvanti.Enabled = true;
                btnFine.Visible = false;
                btnPdf.Visible = false;

                _avanzamento = AvanzamentoWizard.SceltaRitenute;
            }
        }
        private void reset()
        {
            try
            {
                if (mainTab != null)
                {
                    if (mainTab.Tabs.Exists("lettere"))
                        mainTab.Tabs["lettere"].Enabled = false;
                    if (mainTab.Tabs.Exists("riepilogo"))
                    {
                        mainTab.Tabs["riepilogo"].Enabled = true;
                        mainTab.SelectedTab = mainTab.Tabs["riepilogo"];
                    }
                }

                _avanzamento = AvanzamentoWizard.Riepilogo;
                btnConferma.Visible = false;
                btnIndietro.Enabled = false;
                btnAvanti.Enabled = true;

                if(_riepilogoRataVersateUC1 != null)
                    btnAvanti.Enabled = _riepilogoRataVersateUC1.GetRowCount() > 0;
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nel reset - {0} - {1}", ex, Gipasoft.Library.Utility.GetMethodDescription(), Security.Login.Instance.CurrentLogin().Azienda);
            }
        }
        private void btnIndietroClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.EmissioneRate)
            {
                btnAvanti.Enabled = true;
                btnConferma.Visible = false;
                btnIndietro.Enabled = false;

                mainTab.Tabs["riepilogoRate"].Enabled = true;
                mainTab.Tabs["emissione"].Enabled = false;
                mainTab.SelectedTab = mainTab.Tabs["riepilogoRate"];
                _avanzamento = AvanzamentoWizard.RiepilogoRate;
            }
        }
Example #8
0
        private void setWizardHome()
        {
            _avanzamento = AvanzamentoWizard.SceltaParametri;
            mainTab.ActiveTab = mainTab.Tabs["parametri"];
            mainTab.SelectedTab = mainTab.Tabs["parametri"];
            mainTab.Tabs["parametri"].Enabled = true;
            mainTab.Tabs["riepilogoRate"].Enabled = false;
            mainTab.Tabs["emissione"].Enabled = false;
            btnConferma.Visible = false;
            btnModulo.Visible = false;

            btnAvanti.Enabled = true;
            btnIndietro.Enabled = false;
        }
Example #9
0
        private void btnAvantiClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.SceltaRitenute)
            {
                validationSummaryConferma.Validate();
                if (validationSummaryConferma.IsValid)
                {
                    if (sceltaCondominioCombo1.CondominioSelected == null)
                    {
                        codiceFiscaleCondominio.Checked = false;
                        codiceFiscaleCondominio.Enabled = false;
                    }
                    else
                        codiceFiscaleCondominio.Enabled = true;

                    wizardGenerazione770.Tabs["ritenute"].Enabled = false;
                    btnIndietro.Visible = true;
                    btnIndietro.Enabled = true;

                    var dati = DataGridHelper.GetRigheSelezionate<DatiCertificazioneDTO>(lista, true);
                    var messageList = getGestioneFiscaleService().IsAllowGenerazioneModelloCertificazioneUnica((int)anno.Value, dati, getFirmatarioDichiarazione(), getIntermediarioDichiarazione());
                    if (messageList.Count == 0)
                    {
                        btnAvanti.Enabled = false;
                        btnFine.Visible = true;
                        
                        wizardGenerazione770.Tabs["creazioneFile"].Enabled = true;
                        wizardGenerazione770.SelectedTab = wizardGenerazione770.Tabs["creazioneFile"];

                        _avanzamento = AvanzamentoWizard.Fine;
                    }
                    else
                    {
                        btnAvanti.Enabled = false;
                        wizardGenerazione770.Tabs["errori"].Visible = true;
                        wizardGenerazione770.Tabs["errori"].Enabled = true;
                        wizardGenerazione770.SelectedTab = wizardGenerazione770.Tabs["errori"];

                        idMessageBindingSource.DataSource = messageList;
                        _avanzamento = AvanzamentoWizard.Errori;
                    }
                }
                else
                    validationSummaryConferma.ShowErrorSummary();

                return;
            }

            if (_avanzamento == AvanzamentoWizard.Errori)
            {
                if (sceltaCondominioCombo1.CondominioSelected == null)
                {
                    codiceFiscaleCondominio.Checked = false;
                    codiceFiscaleCondominio.Enabled = false;
                }
                else
                    codiceFiscaleCondominio.Enabled = true;

                var dati = DataGridHelper.GetRigheSelezionate<DatiCertificazioneDTO>(lista, true);
                var messageList = getGestioneFiscaleService().IsAllowGenerazioneModelloCertificazioneUnica((int)anno.Value, dati, getFirmatarioDichiarazione(), getIntermediarioDichiarazione());
                if (messageList.Count == 0)
                {
                    wizardGenerazione770.Tabs["errori"].Visible = false;
                    btnAvanti.Enabled = false;
                    btnFine.Visible = true;

                    wizardGenerazione770.Tabs["creazioneFile"].Enabled = true;
                    wizardGenerazione770.SelectedTab = wizardGenerazione770.Tabs["creazioneFile"];

                    _avanzamento = AvanzamentoWizard.Fine;
                }
                else
                    idMessageBindingSource.DataSource = messageList;

                return;
            }

            if (_avanzamento == AvanzamentoWizard.Fine)
            {
                validationSummaryCreazioneFile.Validate();
                if (validationSummaryCreazioneFile.IsValid)
                {
                    return;
                }
                validationSummaryCreazioneFile.ShowErrorSummary();
            }
        }
Example #10
0
        private void load()
        {
            _loaded = false;

            // ----------------------------------------------------------------------
            // Caricamento primo TAB
            // ----------------------------------------------------------------------
            var form = new ExecuteLoadDataObjectAsync<PianoRatealeDTO>("Il piano rateale è in corso di caricamento ....." + Environment.NewLine + "Si prega di attendere.");
            Func<PianoRatealeDTO> loadDati = () => getRateCondominiService().GetPianoRatealeByEsercizio(_esercizio.ID, true);
            form.LoadData(loadDati);
            form.ShowDialog();
            _pianoRateale = form.DataSourceObject;
            form.Dispose();

            if (_pianoRateale != null)
            {
                listaRate.InitializeRow += listaRate_InitializeRow;
                listaRate.CellChange += listaRateCellChange;

                pianoRatealeDettaglioDTOBindingSource.DataSource = _pianoRateale.Rate;

                var formSoggetti = new ExecuteLoadDataListAsync<RiepilogoRataSoggettoDTO>("E' in corso la ricerca dei condomini ....." + Environment.NewLine + "Si prega di attendere.");
                Func<List<RiepilogoRataSoggettoDTO>> loadDatiSoggetti = () => getRateCondominiService().GetRiepilogoRataSoggettoByEsercizio(_esercizio.ID, getRateRichiamate());
                formSoggetti.LoadData(loadDatiSoggetti);
                formSoggetti.ShowDialog();
                riepilogoRataSoggettoDTOBindingSource.DataSource = formSoggetti.DataSourceObject;
                formSoggetti.Dispose();

                var testoCausale = getRateCondominiService().GetCausale(_esercizio);
                if (testoCausale.Length > 94)
                    testoCausale = testoCausale.Substring(0, 94);
                causale.Text = testoCausale;

                intestazoneAzienda.Text = getRateCondominiService().GetIntestazioneMAVAzienda();

                mainTab.Tabs["parametri"].Enabled = true;
                mainTab.Tabs["riepilogoRate"].Enabled = false;
                mainTab.Tabs["emissione"].Enabled = false;
                mainTab.SelectedTab = mainTab.Tabs["parametri"];
                _avanzamento = AvanzamentoWizard.SceltaParametri;

                listaSoggetti.UpdateData();
                listaSoggetti.PerformAction(UltraGridAction.ExitEditMode);

                listaSoggetti.BeforeHeaderCheckStateChanged += listaSoggetti_BeforeHeaderCheckStateChanged;
                listaSoggetti.AfterHeaderCheckStateChanged += listaSoggetti_AfterHeaderCheckStateChanged;

            }
            else
            {
                CommonMessages.DisplayWarning("Non è stato definito alcun piano rateale.");
            }

        }
Example #11
0
        private void btnAvantiClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.SceltaParametri)
            {
                // Trovo id righe selezionate
                var idDettaglioRate = new List<int>();
                
                listaRate.BeginUpdate();
                listaRate.SuspendRowSynchronization();
                try
                {
                    idDettaglioRate.AddRange(from row in listaRate.Rows where (bool) row.Cells["SelectColumn"].Value select (int) row.Cells["ID"].Value);
                }
                finally
                {
                    listaRate.ResumeRowSynchronization();
                    listaRate.EndUpdate();
                }

                var idSoggetti = new List<int>();

                var rows = DataGridHelper.GetSelectedRows(listaSoggetti, true);
                if (rows.Count > 0)
                {
                    foreach (var row in rows)
                    {
                        if ((bool)row.Cells["SelectColumn"].Value)
                            idSoggetti.Add((int)row.Cells["ID"].Value);
                    }
                    var result = getRateCondominiService().GetDettaglioEmissioneRateByEsercizio(_esercizio.ID, idDettaglioRate, idSoggetti, getRateRichiamate(), accorpamento.Checked);
                    if (result.Result != null)
                    {
                        if (!string.IsNullOrEmpty(result.WarnMessage))
                            CommonMessages.DisplayWarning(result.WarnMessage);
                        dettaglioEmissioneRateDTOBindingSource.DataSource = result.Result;

                        listaRateSoggetti.BeginUpdate();
                        listaRateSoggetti.SuspendRowSynchronization();
                        try
                        {
                            foreach (var row in listaRateSoggetti.Rows)
                            {
                                if (row.IsDataRow && row.ListObject != null)
                                    inizializzaListaRateSogggetti(row);
                            }
                        }
                        finally
                        {
                            listaRateSoggetti.ResumeRowSynchronization();
                            listaRateSoggetti.EndUpdate();
                        }
                    }
                    
                    if(!string.IsNullOrEmpty(result.FatalMessage))
                        CommonMessages.DisplayWarning(result.FatalMessage);
                }

                emissioneRateValidationSummary.Validate();
                if (emissioneRateValidationSummary.IsValid)
                {
                    btnIndietro.Enabled = true;
                    mainTab.Tabs["parametri"].Enabled = false;
                    mainTab.Tabs["riepilogoRate"].Enabled = true;
                    mainTab.SelectedTab = mainTab.Tabs["riepilogoRate"];
                    _avanzamento = AvanzamentoWizard.RiepilogoRate;
                }
                else
                    emissioneRateValidationSummary.ShowErrorSummary();

                listaRateSoggetti.UpdateData();
                listaRateSoggetti.PerformAction(UltraGridAction.ExitEditMode);
            }
            else if (_avanzamento == AvanzamentoWizard.RiepilogoRate)
            {
                sceltaSoggettiValidationSummary.Validate();

                if (sceltaSoggettiValidationSummary.IsValid)
                {
                    btnAvanti.Enabled = false;
                    btnConferma.Visible = true;
                    btnModulo.Visible = true;
                    mainTab.Tabs["riepilogoRate"].Enabled = false;
                    mainTab.Tabs["emissione"].Enabled = true;
                    mainTab.SelectedTab = mainTab.Tabs["emissione"];
                    string cbiFileFolder = Settings.Default.CBIFileFolder;
                    if (string.IsNullOrEmpty(cbiFileFolder))
                        cbiFileFolder = Utility.GetDocumentsFolder();
                    nomeFileCbi.Text = cbiFileFolder + $@"\MAV_{Conversione.ToFileName(_condominio.Codice)}_{DateTime.Today:dd-MM-yyy} {DateTime.Now.Hour}h{DateTime.Now.Minute}m{DateTime.Now.Second}s.txt";

                    _avanzamento = AvanzamentoWizard.EmissioneRate;
                }
                else
                    sceltaSoggettiValidationSummary.ShowErrorSummary();
            }
        }
Example #12
0
        private void reset()
        {
            mainTab.Tabs["riepilogo"].Enabled = true;
            mainTab.Tabs["pianoRateale"].Enabled = false;
            mainTab.Tabs["rateSoggetti"].Enabled = false;
            mainTab.SelectedTab = mainTab.Tabs["riepilogo"];

            _avanzamento = AvanzamentoWizard.RiepilogoRiparto;
            btnConferma.Visible = false;
            btnIndietro.Enabled = false;
            btnAvanti.Enabled = true;
        }
Example #13
0
        private void btnIndietroClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.CreazionePianoRateale)
            {
                btnIndietro.Enabled = false;
                btnAvanti.Enabled = true;
                mainTab.Tabs["riepilogo"].Enabled = true;
                mainTab.Tabs["pianoRateale"].Enabled = false;
                mainTab.SelectedTab = mainTab.Tabs["riepilogo"];
                _avanzamento = AvanzamentoWizard.RiepilogoRiparto;
            }
            else if (_avanzamento == AvanzamentoWizard.RateSoggetti)
            {
                btnAvanti.Enabled = true;
                btnConferma.Visible = false;

                mainTab.Tabs["pianoRateale"].Enabled = true;
                mainTab.Tabs["rateSoggetti"].Enabled = false;
                mainTab.SelectedTab = mainTab.Tabs["pianoRateale"];
                _avanzamento = AvanzamentoWizard.CreazionePianoRateale;
            }
        }
Example #14
0
        private void btnAvantiClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.RiepilogoRiparto)
            {
                btnIndietro.Enabled = true;
                mainTab.Tabs["riepilogo"].Enabled = false;
                mainTab.Tabs["pianoRateale"].Enabled = true;
                mainTab.SelectedTab = mainTab.Tabs["pianoRateale"];
                _avanzamento = AvanzamentoWizard.CreazionePianoRateale;

                if (listaRate.DisplayLayout.Bands[0].Columns.Exists("PercentualeRiparto"))
                {
                    listaRate.DisplayLayout.Bands[0].Columns["PercentualeRiparto"].EditorComponent = percentageDataFilter;
                    listaRate.DisplayLayout.Bands[0].Columns["PercentualeRipartoSaldo"].EditorComponent = percentageDataFilter;
                }
            }
            else if (_avanzamento == AvanzamentoWizard.CreazionePianoRateale)
            {
                pianoRatealeValidationSummary.Validate();
                if (pianoRatealeValidationSummary.IsValid)
                {
                    btnAvanti.Enabled = false;
                    btnConferma.Visible = true;
                    mainTab.Tabs["pianoRateale"].Enabled = false;
                    mainTab.Tabs["rateSoggetti"].Enabled = true;
                    mainTab.SelectedTab = mainTab.Tabs["rateSoggetti"];
                    _avanzamento = AvanzamentoWizard.RateSoggetti;

                    setPianoRatealeDataSource(true, true);
                    pianoRatealeSoggettiUC1.LoadData(_condominio, _esercizio, _rateSoggetti, _saldiSoggetti, (IList<RiepilogoRipartoDTO>)riepilogoRipartoBindingSource.DataSource, pianoRatealeSoggettiUC1.CurrentTipoLista, true, _tipo);
                }
                else
                    pianoRatealeValidationSummary.ShowErrorSummary();
            }
        }
Example #15
0
        public void Reload()
        {
            lista.InitializeRow += listaInitializeRow;
            var filter = new PagamentoFilter
            {
                Detraibile = !_pagamentoCbi
            };
            disposizionePagamentoBindingSource.DataSource = getPagamentoFatturaService().GetDisposizioniDaPagareByFilter(filter);
            lista.AfterCellUpdate -=listaAfterCellUpdate;
            lista.BeforeRowActivate -=listaBeforeRowActivate;
            lista.PerformAction(UltraGridAction.ExitEditMode);
            lista.BeforeRowActivate += listaBeforeRowActivate;
            lista.AfterCellUpdate += listaAfterCellUpdate;
            lista.InitializeRow -= listaInitializeRow;

            btnAvanti.Enabled = true;
            btnIndietro.Enabled = false;
            wizardDisposizionePagamento.Tabs[getConfermaTabKey()].Enabled = false;
            wizardDisposizionePagamento.Tabs["scadenze"].Enabled = true;
            wizardDisposizionePagamento.SelectedTab = wizardDisposizionePagamento.Tabs["scadenze"];
            _avanzamento = AvanzamentoWizard.SceltaScadenze;

            setContoCorrenteValueList();

            lista.UpdateData();
            lista.PerformAction(UltraGridAction.ExitEditMode);

            if (checkErrori(false) != string.Empty)
                btnErrori.Visible = true;

            tipoBonifico_ValueChanged(null, EventArgs.Empty);
        }
Example #16
0
        private void btnAvantiClick(object sender, EventArgs e)
        {
            validationSummary1.Validate();

            if (validationSummary1.IsValid)
            {
                switch (_avanzamento)
                {
                    case AvanzamentoWizard.DatiSubentro:
                        if (_inserimentoSubentroUC.ValidateDati())
                        {
                            _esercizio = _inserimentoSubentroUC.GetEsercizio();

                            if (_ripartizioneSpesaUC == null)
                            {
                                _ripartizioneSpesaUC = new RipartizioneSpeseUC(getCondominio(), _esercizio);
                                ultraTabPageControl2.Controls.Add(_ripartizioneSpesaUC);
                                _ripartizioneSpesaUC.Dock = DockStyle.Fill;
                            }

                            // Se LoadData ritorna false vuol dire che NON è possibile registrare il subentro e quindi la form è in fase di chiusura
                            if(_ripartizioneSpesaUC.LoadData(getCondominio(), _esercizio, _inserimentoSubentroUC.GetDataSubentro(), _inserimentoSubentroUC.GetPersonaUscente(), _inserimentoSubentroUC.GetPersonaEntrante(), _inserimentoSubentroUC.GetUnitaImmobiliarePrincipale().Id, _inserimentoSubentroUC.GetUnitaImmobiliari(), _inserimentoSubentroUC.GetTipoSubentro()))
                            {
                                btnIndietro.Enabled = true;
                                btnAvanti.Enabled = true;
                                btnConferma.Visible = false;
                                btnStampa.Visible = false;

                                mainTab.Tabs["stampa"].Enabled = false;
                                mainTab.Tabs["datiSubentro"].Enabled = false;
                                mainTab.Tabs["ripartizioneSpese"].Enabled = true;
                                mainTab.SelectedTab = mainTab.Tabs["ripartizioneSpese"];
                                _avanzamento = AvanzamentoWizard.RipartizioneSpese;
                            }

                        }
                        break;

                    case AvanzamentoWizard.RipartizioneSpese:
                        if (_ripartizioneSpesaUC.ValidateData())
                        {
                            oggettoLettera.Text = getSubentroService().GetOggettoLettera(_esercizio, getNominativoUscente(), getNominativoEntrante(), _inserimentoSubentroUC.GetDataSubentro());
                            testoLettera.Text = getSubentroService().GetTestoLettera
                                (
                                    getNominativoUscente(), _ripartizioneSpesaUC.GetCompetenzaUscente(),
                                    getNominativoEntrante(), _ripartizioneSpesaUC.GetCompetenzaEntrante(),
                                    _ripartizioneSpesaUC.GetRate()
                                );

                            if (notePredefinite.SelectedIndex >= 0)
                                _note = getSubentroService().FormattaTestoNote(_condominio, getNominativoUscente(), getNominativoEntrante(), ((NotaPredefinitaDTO)notePredefinite.SelectedItem.ListObject).TestoHtml);

                            btnIndietro.Enabled = true;
                            btnAvanti.Enabled = false;
                            btnConferma.Visible = true;
                            btnStampa.Visible = true;

                            mainTab.Tabs["stampa"].Enabled = true;
                            mainTab.Tabs["datiSubentro"].Enabled = false;
                            mainTab.Tabs["ripartizioneSpese"].Enabled = false;
                            mainTab.SelectedTab = mainTab.Tabs["stampa"];
                            _avanzamento = AvanzamentoWizard.Stampa;
                        }
                        break;
                }
            }
            else
                validationSummary1.ShowErrorSummary();
        }
        private void btnAvantiClick(object sender, EventArgs e)
        {
            validationSummary1.Validate();

            if (validationSummary1.IsValid)
            {
                if (_avanzamento == AvanzamentoWizard.Riepilogo)
                {
                    btnIndietro.Enabled = true;
                    btnAvanti.Enabled = false;
                    //if (_riepilogoRataVersateUC1.GetEsercizio() != null)
                        btnConferma.Visible = true;

                    mainTab.Tabs["riepilogo"].Enabled = false;
                    mainTab.Tabs["lettere"].Enabled = true;
                    mainTab.SelectedTab = mainTab.Tabs["lettere"];

                    var dataFineRate = _riepilogoRataVersateUC1.GetDataFineRate();
                    if (dataFineRate != null)
                        parametriStampaSollecitiUC1.SetDataFineRate(dataFineRate.Value);

                    parametriStampaSollecitiUC1.SetCondominoEsercizio(_riepilogoRataVersateUC1.GetCondominio(), _riepilogoRataVersateUC1.GetEsercizio(), _riepilogoRataVersateUC1.GetRaggruppamentoCondominio() == "E");
                    var dataVersamenti = _riepilogoRataVersateUC1.GetDataVersamenti();
                    if (dataVersamenti != null)
                        parametriStampaSollecitiUC1.SetDataVersamenti(dataVersamenti.Value);

                    _avanzamento = AvanzamentoWizard.Lettere;
                }
            }
            else
                validationSummary1.ShowErrorSummary();
        }
Example #18
0
        private void btnIndietroClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.RipartizioneSpese)
            {
                btnIndietro.Enabled = false;
                btnAvanti.Enabled = true;
                btnConferma.Visible = false;
                btnStampa.Visible = false;

                mainTab.Tabs["datiSubentro"].Enabled = true;
                mainTab.Tabs["ripartizioneSpese"].Enabled = false;
                mainTab.SelectedTab = mainTab.Tabs["datiSubentro"];
                _avanzamento = AvanzamentoWizard.DatiSubentro;
            }
            else if (_avanzamento == AvanzamentoWizard.Stampa)
            {
                btnIndietro.Enabled = true;
                btnAvanti.Enabled = true;
                btnConferma.Visible = false;
                btnStampa.Visible = false;

                mainTab.Tabs["stampa"].Enabled = false;
                mainTab.Tabs["datiSubentro"].Enabled = false;
                mainTab.Tabs["ripartizioneSpese"].Enabled = true;
                mainTab.SelectedTab = mainTab.Tabs["ripartizioneSpese"];
                _avanzamento = AvanzamentoWizard.RipartizioneSpese;
            }
        }
        private void btnAvantiClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.RiepilogoRate)
            {
                riepilogoRataValidationSummary.Validate();

                if (riepilogoRataValidationSummary.IsValid)
                {
                    btnIndietro.Enabled = true;
                    btnAvanti.Enabled = false;

                    btnConferma.Visible = true;
                    mainTab.Tabs["riepilogoRate"].Enabled = false;
                    mainTab.Tabs["emissione"].Enabled = true;
                    mainTab.SelectedTab = mainTab.Tabs["emissione"];
                    string cbiFileFolder = Properties.Settings.Default.CBIFileFolder;
                    if (string.IsNullOrEmpty(cbiFileFolder))
                        cbiFileFolder = Gipasoft.Library.Utility.GetDocumentsFolder();
                    nomeFileCbi.Text = cbiFileFolder + @"\MAV_" + DateTime.Today.ToString("dd-MM-yyyy") + ".txt";

                    _avanzamento = AvanzamentoWizard.EmissioneRate;
                }
                else
                    riepilogoRataValidationSummary.ShowErrorSummary();
            }
        }
Example #20
0
        public void Reload(CondominioDTO condominio, EsercizioDTO esercizio)
        {
            _condominio = condominio;
            _esercizio = esercizio;
            _inserimentoSubentroUC.LoadData(getCondominio());

            btnIndietro.Enabled = false;
            btnAvanti.Enabled = true;
            btnConferma.Visible = false;
            mainTab.Tabs["datiSubentro"].Enabled = true;
            mainTab.Tabs["ripartizioneSpese"].Enabled = false;
            mainTab.SelectedTab = mainTab.Tabs["datiSubentro"];
            _avanzamento = AvanzamentoWizard.DatiSubentro;
        }
 private void setWizardHome()
 {
     _avanzamento = AvanzamentoWizard.RiepilogoRate;
     btnConferma.Visible = false;
     btnAvanti.Enabled = true;
     btnIndietro.Enabled = false;
 }
Example #22
0
        private void disposizionePagamentoUILoad(object sender, EventArgs e)
        {
            Reload();

            if (lista.DisplayLayout.Bands[0].Summaries.Count == 0)
            {
                DataGridHelper.AddSummary(lista.DisplayLayout.Bands[0], "ImportoPagamento", "c");
                DataGridHelper.AddSummary(lista.DisplayLayout.Bands[0], "ImportoScadenza", "c");
                DataGridHelper.AddSummary(lista.DisplayLayout.Bands[0], "ImportoRitenuta", "c");
                DataGridHelper.AddSummary(lista.DisplayLayout.Bands[0], "ImportoAutorizzato", "c");
                DataGridHelper.AddSummary(lista.DisplayLayout.Bands[0], "ImportoDaPagare", "c");
                DataGridHelper.AddSummary(lista.DisplayLayout.Bands[0], "ImportoPagato", "c");
                DataGridHelper.AddSummary(lista.DisplayLayout.Bands[0], "ImponibileSpesa", "c");

                if (!_pagamentoCbi)
                    modelloLetteraTestoDTOBindingSource.DataSource = getPagamentoFatturaService().GetModelliLettera();
                if (modelloLetteraTestoDTOBindingSource.Count == 1)
                    modelliLettera.SelectedIndex = 0;
            }

            if (!lista.DisplayLayout.ValueLists.Exists("ModalitaPagamento"))
            {
                lista.DisplayLayout.ValueLists.Add(DataSourceHelper.GetValueList(_pagamentoFatturaService.GetModalitaPagamento(), "ID", "DescrizioneBreve", "ModalitaPagamento"));
                lista.DisplayLayout.Bands[0].Columns["IdModalitaPagamento"].ValueList = lista.DisplayLayout.ValueLists["ModalitaPagamento"];
            }

            _avanzamento = AvanzamentoWizard.SceltaScadenze;

            new UltraToolTipContextHelperForGrid(lista, ultraToolTipManager1);
        }
Example #23
0
        private void btnAvantiClick(object sender, EventArgs e)
        {
            if(!validationSummary1.Validators.Contains(customRitenuteServerValidator))
                validationSummary1.Validators.Add(customRitenuteServerValidator);

            validationSummary1.Validate();

            if (validationSummary1.IsValid)
            {
                if (_avanzamento == AvanzamentoWizard.SceltaRitenute)
                {
                    validationSummary1.Validators.Add(reqDescrizione);
                    validationSummary1.Validators.Add(reqNomeFile);
                    validationSummary1.Validators.Add(reqDescrizioneInteressi);
                    validationSummary1.Validators.Add(reqDescrizioneSanzioni);
                    validationSummary1.Validators.Add(customValidatorFileName);

                    wizardPagamentoRitenute.Tabs[1].Enabled = true;
                    wizardPagamentoRitenute.Tabs[0].Enabled = false;
                    wizardPagamentoRitenute.SelectedTab = wizardPagamentoRitenute.Tabs[1];
                    btnIndietro.Enabled = true;
                    btnAvanti.Enabled = false;
                    btnFine.Visible = true;
                    btnPdf.Visible = true;
                    _avanzamento = AvanzamentoWizard.Fine;
                    descrizioneDisposizione.Text = @"Versamento Ritenute del " + DateTime.Today.ToLongDateString();

                    var cbiFileFolder = Settings.Default.F24FileFolder;
                    if (string.IsNullOrEmpty(cbiFileFolder))
                        cbiFileFolder = Utility.GetDocumentsFolder();
                    nomeFile.Text = cbiFileFolder + @"\F24_" + DateTime.Today.ToString("dd-MM-yyyy") + @"_" + DateTime.Now.Hour + @"h" + DateTime.Now.Minute + @"m" + DateTime.Now.Second + @"s";
                }
            }
            else
                validationSummary1.ShowErrorSummary();
        }
Example #24
0
        private void btnAvantiClick(object sender, EventArgs e)
        {
            validationSummary1.Validate();

            if (validationSummary1.IsValid)
            {
                if (_avanzamento == AvanzamentoWizard.SceltaScadenze)
                {
                    validationSummary1.Validators.Add(reqDescrizione);
                    validationSummary1.Validators.Add(reqNomeFile);
                    validationSummary1.Validators.Add(percorsoNomeFileValidator);
                    validationSummary1.Validators.Add(customDataRegistrazione);

                    wizardDisposizionePagamento.Tabs[getConfermaTabKey()].Enabled = true;
                    wizardDisposizionePagamento.Tabs["scadenze"].Enabled = false;
                    wizardDisposizionePagamento.SelectedTab = wizardDisposizionePagamento.Tabs[getConfermaTabKey()];
                    btnIndietro.Enabled = true;
                    btnAvanti.Enabled = false;
                    btnFine.Visible = true;
                    _avanzamento = AvanzamentoWizard.Fine;
                    descrizioneDisposizione.Text = @"Bonifici del " + DateTime.Today.ToLongDateString();

                    if (getPagamentoFatturaService().GetDescrizioneAutomaticaPagamentoManuale())
                        descrizioneBonificoManuale.Text = @"Bonifici del " + DateTime.Today.ToLongDateString();

                    assegniBindingSource.DataSource = getRigheSelezionate();
                    setContoAssegniValueList();

                    contoPatrimoniale.Value = null;
                    contoPatrimoniale.Value = "B";
                    var cbiFileFolder = Properties.Settings.Default.CBIFileFolder;
                    if (string.IsNullOrEmpty(cbiFileFolder))
                        cbiFileFolder = Utility.GetDocumentsFolder();
                    directoryFileCbi.Text = cbiFileFolder;
                    setDataPagamento();
                    return;
                }

                if (_avanzamento == AvanzamentoWizard.Fine)
                {
                    var mittenteCondominio = mittente.Value.ToString() == "C";
                    if (modelliLettera.Value != null)
                    {
                        var result = getPagamentoFatturaService().CreatePagamenti(getRigheSelezionate(), descrizioneDisposizione.Text, directoryFileCbi.Text, getTipoBonifico(), stampaLettera.Checked, null, (int) modelliLettera.Value, testataPerCondominio.Checked, mittenteCondominio);
                        if (!string.IsNullOrEmpty(result.Message))
                            CommonMessages.DisplayWarning("I pagamenti NON sono stati creati regolarmente:" + Environment.NewLine + result.Message);
                    }
                }
            }
            else
                validationSummary1.ShowErrorSummary();
        }
Example #25
0
        private void btnFineClick(object sender, EventArgs e)
        {
            validationSummary1.Validate();

            if (validationSummary1.IsValid)
            {
                var mittenteCondominio = mittente.Value.ToString() == "C";

                if (getRitenutaAccontoService().Salva(getRitenuteSelezionate(), dataPagamento.DateTime, descrizioneDisposizione.Text, nomeFile.Text + @".txt", descrizioneAddebitoInteressi.Text, descrizioneAddebitoSanzioni.Text, mittenteCondominio, testataPerCondominio.Checked, TipoVersamentoF24Enum.CBI))
                {
                    CommonMessages.DisplayComplete("Il versamento delle ritenute è stato regolarmente registrato.");
                    ritenuteAccontoUILoad(this, EventArgs.Empty);
                    wizardPagamentoRitenute.Tabs[1].Enabled = false;
                    wizardPagamentoRitenute.Tabs[0].Enabled = true;
                    wizardPagamentoRitenute.SelectedTab = wizardPagamentoRitenute.Tabs[0];
                    _avanzamento = AvanzamentoWizard.SceltaRitenute;
                    btnFine.Visible = false;
                    btnPdf.Visible = false;

                    // Salvo il percorso
                    var file = new FileInfo(nomeFile.Text);
                    Settings.Default.CBIFileFolder = file.DirectoryName;
                    Settings.Default.Save();

                    setVisibleLista(false);
                }
                else
                    CommonMessages.DisplayWarning($"Si sono verificati problemi durante la creazione del file CBI delle ritenute.{Environment.NewLine}Verificare se le ritenute sono state versate ed eventualmente ristampare il file dalla lista delle ritenute versate");
            }
            else
                validationSummary1.ShowErrorSummary();
        }
Example #26
0
        private void btnIndietroClick(object sender, EventArgs e)
        {
            validationSummary1.Validators.Remove(reqNomeFile);
            validationSummary1.Validators.Remove(percorsoNomeFileValidator); 
            
            validationSummary1.Validate();

            if (validationSummary1.IsValid)
            {
                if (_avanzamento == AvanzamentoWizard.Fine)
                {
                    validationSummary1.Validators.Remove(reqDescrizione);
                    validationSummary1.Validators.Add(customDataRegistrazione);

                    wizardDisposizionePagamento.Tabs[getConfermaTabKey()].Enabled = false;
                    wizardDisposizionePagamento.Tabs["scadenze"].Enabled = true;
                    wizardDisposizionePagamento.SelectedTab = wizardDisposizionePagamento.Tabs["scadenze"];
                    btnIndietro.Enabled = false;
                    btnAvanti.Enabled = true;
                    btnFine.Visible = false;
                    _avanzamento = AvanzamentoWizard.SceltaScadenze;
                }
            }
            else
                validationSummary1.ShowErrorSummary();
        }
Example #27
0
        private void btnAvantiClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.SceltaRitenute)
            {
                validationSummarySceltaRitenute.Validate();
                if(validationSummarySceltaRitenute.IsValid)
                {
                    wizardGenerazione770.Tabs["ritenute"].Enabled = false; 
                    btnIndietro.Enabled = true;

                    List<IdMessage> messageList = getGestioneFiscaleService().IsAllowGenerazioneModello770(_ritenuteVersateService.GetCondominio(), _ritenuteVersateService.GetAnno(), sceltaFornitoreCombo1.SelectedListaFornitore, getFirmatarioDichiarazione(), getIntermediarioDichiarazione());
                    if (messageList.Count == 0)
                    {
                        btnAvanti.Enabled = false;
                        btnFine.Visible = true;
                        
                        wizardGenerazione770.Tabs["creazioneFile"].Enabled = true;
                        wizardGenerazione770.SelectedTab = wizardGenerazione770.Tabs["creazioneFile"];

                        _avanzamento = AvanzamentoWizard.Fine;
                    }
                    else
                    {
                        wizardGenerazione770.Tabs["errori"].Visible = true;
                        wizardGenerazione770.Tabs["errori"].Enabled = true;
                        wizardGenerazione770.SelectedTab = wizardGenerazione770.Tabs["errori"];

                        idMessageBindingSource.DataSource = messageList;
                        _avanzamento = AvanzamentoWizard.Errori;
                    }
                }
                else
                    validationSummarySceltaRitenute.ShowErrorSummary();

                return;
            }

            if (_avanzamento == AvanzamentoWizard.Errori)
            {
                List<IdMessage> messageList = getGestioneFiscaleService().IsAllowGenerazioneModello770(_ritenuteVersateService.GetCondominio(), _ritenuteVersateService.GetAnno(), sceltaFornitoreCombo1.SelectedListaFornitore, getFirmatarioDichiarazione(), getIntermediarioDichiarazione());
                if (messageList.Count == 0)
                {
                    wizardGenerazione770.Tabs["errori"].Visible = false;
                    btnAvanti.Enabled = false;
                    btnFine.Visible = true;

                    wizardGenerazione770.Tabs["creazioneFile"].Enabled = true;
                    wizardGenerazione770.SelectedTab = wizardGenerazione770.Tabs["creazioneFile"];

                    _avanzamento = AvanzamentoWizard.Fine;
                }
                else
                    idMessageBindingSource.DataSource = messageList;

                return;
            }

            if (_avanzamento == AvanzamentoWizard.Fine)
            {
                validationSummaryCreazioneFile.Validate();
                if (validationSummaryCreazioneFile.IsValid)
                {
                    return;
                }
                validationSummaryCreazioneFile.ShowErrorSummary();
            }
        }
Example #28
0
        private void btnFineClick(object sender, EventArgs e)
        {
            // Pagamento CBI
            if (_pagamentoCbi)
            {
                validationSummary1.Validate();

                if (validationSummary1.IsValid)
                {
                    var righeSelezionate = getRigheSelezionate();
                    var idCondomini = righeSelezionate.Select(item => item.IdCondominio).ToList();
                    var messageDataList = getMovimentoContabileService().IsAllowDataRegistrazione(idCondomini, null, DateTime.Today);

                    if (messageDataList.Count == 0)
                    {
                        var mittenteCondominio = mittente.Value.ToString() == "C";
                        var result = getPagamentoFatturaService().CreatePagamenti(righeSelezionate, descrizioneDisposizione.Text, directoryFileCbi.Text, getTipoBonifico(), stampaLettera.Checked, null, null, testataPerCondominio.Checked, mittenteCondominio);
                        if (string.IsNullOrEmpty(result.Message))
                        {
                            CommonMessages.DisplayComplete("I pagamenti sono stati correttamente eseguiti.");
                            btnFine.Visible = false;
                            disposizionePagamentoUILoad(this, EventArgs.Empty);
                            wizardDisposizionePagamento.Tabs[getConfermaTabKey()].Enabled = false;
                            wizardDisposizionePagamento.Tabs["scadenze"].Enabled = true;
                            wizardDisposizionePagamento.SelectedTab = wizardDisposizionePagamento.Tabs["scadenze"];
                        }
                        else
                            CommonMessages.DisplayWarning($"I pagamenti NON sono stati creati regolarmente:{Environment.NewLine}{result.Message}");
                    }
                    else
                    {
                        var messageData = $"La data di registrazione{DateTime.Today:d} non è ammessa:{Environment.NewLine}";
                        messageData = messageDataList.Aggregate(messageData, (current, mess) => current + (mess + Environment.NewLine));
                        CommonMessages.DisplayWarning(messageData);
                    }
                }
                else
                    validationSummary1.ShowErrorSummary();
            }
            // Pagamento Manuale
            else
            {
                validationSummary1.Validators.Add(customValidatorDataPagamento);
                validationSummary1.Validators.Add(sottocontoValidator);
                if (contoPatrimoniale.Value.ToString() == "B")
                    validationSummary1.Validators.Add(modelliLetteraValidator);
                validationSummary1.Validate();

                if (validationSummary1.IsValid)
                {
                    var pagamenti = getRigheSelezionate();
                    if (groupDatiPagamento.Visible)
                        pagamenti = (List<DisposizionePagamentoDTO>)assegniBindingSource.DataSource;

                    var result = getPagamentoFatturaService().CreatePagamenti(pagamenti, descrizioneDisposizione.Text, null, getTipoBonifico(), stampaLettera.Checked, contoPatrimoniale.Value.ToString(), (int?)modelliLettera.Value, testataPerCondominio.Checked, true);
                    if (string.IsNullOrEmpty(result.Message))
                    {
                        CommonMessages.DisplayComplete("I pagamenti sono stati correttamente eseguiti.");
                        if(stampaLettera.Checked)
                        {
                            var modelloLettera = (ModelloLetteraTestoDTO) modelliLettera.SelectedItem.ListObject;
                            var parameters = new LetteraBonificoReportParameters
                            {
                                DataPagamento = DateTime.Today,
                                OggettoLettera = modelloLettera.Oggetto
                            };
                            var anteprima = new AnteprimaStampaLettera(result.Pagamenti, parameters);
                            anteprima.ShowDialog();
                            anteprima.Dispose();
                        }
                    }
                    else
                        CommonMessages.DisplayWarning($"I pagamenti NON sono stati creati regolarmente:{Environment.NewLine}{result.Message}");

                    Reload();
                    descrizioneBonificoManuale.Text = string.Empty;
                    btnFine.Visible = false;
                    btnErrori.Visible = false;
                    wizardDisposizionePagamento.Tabs[getConfermaTabKey()].Enabled = false;
                    wizardDisposizionePagamento.Tabs["scadenze"].Enabled = true;
                    wizardDisposizionePagamento.SelectedTab = wizardDisposizionePagamento.Tabs["scadenze"];
                    wizardDisposizionePagamento.ActiveTab = wizardDisposizionePagamento.Tabs["scadenze"];
                    _avanzamento = AvanzamentoWizard.SceltaScadenze;
                }
                else
                    validationSummary1.ShowErrorSummary();

                validationSummary1.Validators.Remove(customValidatorDataPagamento);
                validationSummary1.Validators.Remove(sottocontoValidator);
                validationSummary1.Validators.Remove(modelliLetteraValidator);
            }
        }
Example #29
0
 private void listaErroriDoubleClickRow(object sender, DoubleClickRowEventArgs e)
 {
     try
     {
         if (e.Row.ListObject is IdMessage)
         {
             var item = (IdMessage)e.Row.ListObject;
             if (item.Tipo == TipoNominativo.Fornitore)
             {
                 var form = getDettaglioFornitoreService().GetFormDettaglio(item.Id);
                 if (form != null)
                 {
                     form.ShowDialog();
                     var messageList = getGestioneFiscaleService().IsAllowGenerazioneModello770(_ritenuteVersateService.GetCondominio(), _ritenuteVersateService.GetAnno(), sceltaFornitoreCombo1.SelectedListaFornitore, getFirmatarioDichiarazione(), getIntermediarioDichiarazione());
                     idMessageBindingSource.DataSource = messageList;
                     if (idMessageBindingSource.Count == 0)
                     {
                         _avanzamento = AvanzamentoWizard.SceltaRitenute;
                         wizardGenerazione770.Tabs["errori"].Visible = false;
                         btnAvantiClick(sender, EventArgs.Empty);
                     }
                     form.Dispose();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         _log.ErrorFormat("Errore nell'apertura del dettaglio dell'errore - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);                
         throw;
     }
 }
        private void btnIndietroClick(object sender, EventArgs e)
        {
            if (_avanzamento == AvanzamentoWizard.Fine || _avanzamento == AvanzamentoWizard.Errori)
            {
                wizardBilancioDetrazione.Tabs["stampaBilancio"].Enabled = false;
                btnIndietro.Enabled = false;

                btnAvanti.Enabled = true;
                btnFine.Visible = false;

                wizardBilancioDetrazione.Tabs["fatture"].Enabled = true;
                wizardBilancioDetrazione.SelectedTab = wizardBilancioDetrazione.Tabs["fatture"];

                _avanzamento = AvanzamentoWizard.SceltaFatture;
            }
        }