Beispiel #1
0
        private byte [] getImmagineFotografo(Fotografo f)
        {
            string nomeFile = AiutanteFoto.nomeFileImgFotografo(f);

            if (nomeFile != null && File.Exists(nomeFile))
            {
                IGestoreImmagineSrv g = LumenApplication.Instance.getServizioAvviato <IGestoreImmagineSrv>();
                return(g.load(nomeFile).getBytes());
            }
            else
            {
                return(null);
            }
        }
        private void caricaImmagineEsistente()
        {
            string nomeFile = AiutanteFoto.nomeFileImgFotografo(entitaCorrente);

            if (nomeFile != null && File.Exists(nomeFile))
            {
                IGestoreImmagineSrv g = LumenApplication.Instance.getServizioAvviato <IGestoreImmagineSrv>();
                immagineFotografo = g.load(nomeFile);
            }
            else
            {
                immagineFotografo = null;
            }
        }
        protected override bool cancella(Fotografo entita)
        {
            bool esito = base.cancella(entita);

            if (esito == true)
            {
                string nomeFileImg = AiutanteFoto.nomeFileImgFotografo(entita);
                try {
                    File.Delete(nomeFileImg);
                } catch (Exception) {
                    _giornale.Warn("Impossibile cancellare il file con l'immagine del fotografo: " + nomeFileImg);
                }
            }
            return(esito);
        }
        bool esisteImmagineFotografoCorrente()
        {
            string nomeFile = AiutanteFoto.nomeFileImgFotografo(entitaCorrente);

            return(File.Exists(nomeFile));
        }