Пример #1
0
        private void dettaglioAziendaUILoad(object sender, EventArgs e)
        {
            _loghi = getAziendaService().GetLogo();

            // --------------------------------------------------
            //  Logo immagine - Vecchi Report
            // --------------------------------------------------
            var logo = _loghi.LogoAzienda;
            if (logo != null)
            {
                try
                {
                    var stream = new MemoryStream(getAziendaService().GetLogo().LogoAzienda);
                    if(stream.Length > 0)
                        anteprimaLogo.Image = Image.FromStream(stream);
                }
                catch (Exception ex)
                {
                    _log.ErrorFormat("Errore nell'anteprima del logo - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                }

            }

            // --------------------------------------------------
            //  Logo RTF
            // --------------------------------------------------
            _logoRtfEsercizio = _loghi.LogoRtfEsercizioAzienda;
            if (_logoRtfEsercizio != null)
                editLogoRtf.LoadDocumento(null, new MemoryStream(_logoRtfEsercizio), "RTF");

            editLogoRtf.HideAllegati();
            editLogoRtf.ShowHideIllustrationsBar(true);
            editLogoRtf.ShowHideTableBars(true);
            tipoLogoRtf.Value = "E";

            _logoRtfEsercizio = _loghi.LogoRtfEsercizioAzienda;
            _logoRtfDate = _loghi.LogoRtfDateAzienda;


            // --------------------------------------------------
            //  Logo immagine - Firma
            // --------------------------------------------------
            var firma = getAziendaService().GetLogo().FirmaAzienda;
            if (firma != null)
            {
                try
                {
                    var stream = new MemoryStream(firma);
                    anteprimaFirma.Image = Image.FromStream(stream);
                }
                catch (ArgumentException ex)
                {
                    CommonMessages.DisplayWarning("La firma inserita non è in formato corretto,");
                    _log.DebugFormat("L'immagine inserita non è corretta - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                }
                catch (Exception ex)
                {
                    _log.ErrorFormat("Errore nell'anteprima della firma - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                }
            }

            // --------------------------------------------------
            //  Logo immagine - Firma Amministratore
            // --------------------------------------------------
            var firmaAmministratore = getAziendaService().GetLogo().FirmaAmministratore;
            if (firmaAmministratore != null)
            {
                try
                {
                    var stream = new MemoryStream(firmaAmministratore);
                    anteprimaFirmaAmministratore.Image = Image.FromStream(stream);
                }
                catch (ArgumentException ex)
                {
                    CommonMessages.DisplayWarning("La firma amministratore inserita non è in formato corretto,");
                    _log.DebugFormat("L'immagine inserita non è corretta - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                }
                catch (Exception ex)
                {
                    _log.ErrorFormat("Errore nell'anteprima della firma - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
                }
            }

            numeroFax.Text = _azienda.NumeroFaxHeader;
            numeroFax.ValueChanged += numeroFaxValueChanged;

            if(!string.IsNullOrEmpty(_azienda.UtenteServiziMessaggistica) && !(string.IsNullOrEmpty(_azienda.PasswordServiziMessaggistica)))
                backgroundWorkerMessaggistica.RunWorkerAsync();

            abiRitenuteLeave(null, EventArgs.Empty);
            cabRitenuteLeave(null, EventArgs.Empty);

            try
            {
                if (_azienda.FontSizeMessaggistica > 0 && !string.IsNullOrEmpty(_azienda.FontNameMessaggistica))
                {
                    etichetteFontDialog.Font = new Font(_azienda.FontNameMessaggistica, _azienda.FontSizeMessaggistica);
                    sceltaFont.Text = etichetteFontDialog.Font.Name + @";" + etichetteFontDialog.Font.Size;
                }
            }
            catch (Exception ex)
            {
                _log.WarnFormat("Errore inaspettato durante l'impostazione del font di default della messaggistica - {0} - azienda:{1}",  ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
            }

            try
            {
                cmbTray.Enabled = false;
                if (getStampaEtichetteService().IsPrinterInstalled())
                {
                    etichettatrici.Enabled = true;
                    tipoEtichettaDymo.Enabled = true;
                    etichettatrici.DataSource = getStampaEtichetteService().GetPrinters();
                    etichettatrici.Value = getStampaEtichetteService().GetCurrentPrinter();

                    // check if selected/current printer is a twin turbo printer
                    cmbTray.Enabled = getStampaEtichetteService().IsTwinTurboPrinter(etichettatrici.Text);
                    if (cmbTray.Enabled)
                    {
                        // show the current tray selection if the printer
                        // is a twin turbo
                        switch (getStampaEtichetteService().GetCurrentPaperTray())
                        {
                            case 0: // left tray
                                cmbTray.SelectedIndex = 0;
                                break;

                            case 1: // right tray
                                cmbTray.SelectedIndex = 1;
                                break;

                            case 2: // auto switch
                                cmbTray.SelectedIndex = 2;
                                break;

                            default: // tray selection not set, so default to auto switch
                                cmbTray.SelectedIndex = 2;
                                break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore inaspettato durante il controllo della etichettatrice dymo  - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
            }

            setTipoVersamentoDopoChiusura();
            setTipoVersamentoPrimaApertura();

            DataSourceHelper.PopulateCombo(modalitaConvocazione, Conversione.EnumToList<TipoModalitaConvocazione>());
            movimentiDopoChiusura.ValueChanged += movimentiDopoChiusuraValueChanged;

            tipoLogoRtf.ValueChanged += tipoLogoRtf_ValueChanged;
            Text = @"Studio - " + _azienda.Descrizione;
        }
Пример #2
0
        public AssembleaSvolgimentoOnLine(int aziendaID, AssembleaDTO assemblea, CondominioDTO condominio, EsercizioDTO esercizio, ReferenteDTO amministratore, int convocazione, IAssembleaService AssembleaService, IStrutturaCondominioService StrutturaCondominioService, IModelloLettera ModelloLetteraService, Loghi loghi)
        {
            _aziendaID = aziendaID;
            _assemblea = assemblea;
            _condominio = condominio;
            _esercizio = esercizio;
            _amministratore = amministratore;
            _convocazione = convocazione;

            _assembleaService = AssembleaService;
            _modelloLetteraService = ModelloLetteraService;
            _strutturaCondominioService = StrutturaCondominioService;

            _loghi = loghi;
        }
Пример #3
0
        public AssembleaSvolgimentoLocal(int aziendaID, AssembleaDTO assemblea, CondominioDTO condominio, EsercizioDTO esercizio, ReferenteDTO amministratore, int convocazione, List<StabileDTO> stabili, List<ConvocazioneAssembleaDTO> convocati, List<ConvocazioneAssembleaDTO> appello, Dictionary<int, List<ConvocazioneAssembleaDTO>> votanti, List<ModelloFraseDTO> frasi, List<TipoOrdineDelGiornoDTO> tipiOrdineGiorno, Loghi loghi)
        {
            _aziendaID = aziendaID;
            _assemblea = assemblea;
            _condominio = condominio;
            _esercizio = esercizio;
            _convocazione = convocazione;
            _amministratore = amministratore;

            _stabili = stabili;
            _convocati = convocati;
            _appello = appello;
            _votanti = votanti;
            _frasi = frasi;
            _tipiOrdineGiorno = tipiOrdineGiorno;

            _loghi = loghi;
        }
Пример #4
0
        public AssembleaSvolgimentoLocal(string filename,string password="")
        {
            _filename = filename;
            _password = password;
            
            var sUnzipTempFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
            var oUnzipTempFolder = new DirectoryInfo(sUnzipTempFolder);
            oUnzipTempFolder.Create();

            ZipUtil.UnZipFiles(_filename, sUnzipTempFolder, _password, false);

            var oTempFolder = oUnzipTempFolder.GetDirectories()[0];
            var sTempFolder = oTempFolder.FullName;

            _aziendaID = new Serializer<int>().Deserialize(Path.Combine(sTempFolder, "aziendaid.xml"));

            _assemblea = new Serializer<AssembleaDTO>().Deserialize(Path.Combine(sTempFolder, "assemblea.xml"));
            _condominio = new Serializer<CondominioDTO>().Deserialize(Path.Combine(sTempFolder, "condominio.xml"));
            _esercizio= new Serializer<EsercizioDTO>().Deserialize(Path.Combine(sTempFolder, "esercizio.xml"));
            _amministratore = new Serializer<ReferenteDTO>().Deserialize(Path.Combine(sTempFolder, "amministratore.xml"));
            
            _convocazione = new Serializer<int>().Deserialize(Path.Combine(sTempFolder, "convocazione.xml"));

            _stabili = new Serializer<List<StabileDTO>>().Deserialize(Path.Combine(sTempFolder, "stabili.xml")); 
            _convocati = new Serializer<List<ConvocazioneAssembleaDTO>>().Deserialize(Path.Combine(sTempFolder, "convocati.xml"));
            _appello = new Serializer<List<ConvocazioneAssembleaDTO>>().Deserialize(Path.Combine(sTempFolder, "appello.xml"));

            _tipiOrdineGiorno = new Serializer<List<TipoOrdineDelGiornoDTO>>().Deserialize(Path.Combine(sTempFolder, "tipiordinegiorno.xml"));

            _votanti = new Dictionary<int, List<ConvocazioneAssembleaDTO>>();
            foreach (var ordinegiorno in _assemblea.OrdineGiorno)
            {
                _votanti.Add(ordinegiorno.ID, new Serializer<List<ConvocazioneAssembleaDTO>>().Deserialize(Path.Combine(sTempFolder, "votanti_" + ordinegiorno.ID + ".xml")));
            }

            _frasi = new Serializer<List<ModelloFraseDTO>>().Deserialize(Path.Combine(sTempFolder, "frasi.xml"));

            try
            {
                _loghi = new Serializer<Loghi>().Deserialize(Path.Combine(sTempFolder, "loghi.xml"));
            }
            catch (Exception)
            {
                //ignoro questa condizione...
            }

            try
            {
                oUnzipTempFolder.Delete(true);
            }
            catch (Exception)
            {
                //vedi salvataggio...
            }

        }
Пример #5
0
        public Loghi GetLogo()
        {
            Loghi loghi;
            if (!_cache.Contains("loghi"))
            {
                loghi = new Loghi();
                _cache.Add("loghi", loghi);
            }
            else
                loghi = (Loghi)_cache["loghi"];

            if (loghi.LogoAzienda == null)
            {
                loghi.LogoAzienda = GetServiceClient().GetLogoAzienda(GetUserInfo()).Body;
                loghi.LogoRtfEsercizioAzienda = GetServiceClient().GetLogoRtfEsercizioAzienda(GetUserInfo()).Body;
                loghi.LogoRtfDateAzienda = GetServiceClient().GetLogoRtfDateAzienda(GetUserInfo()).Body;
                loghi.FirmaAzienda = GetServiceClient().GetFirmaAzienda(GetUserInfo()).Body;
                loghi.FirmaAmministratore = GetServiceClient().GetFirmaAmministratore(GetUserInfo()).Body;
                _cache.Add("loghi", loghi);
            }

            CloseService();
            return loghi;
        }