Esempio n. 1
0
 public void Execute(TipoSpesatura tipo, string fullPath, string excelFileName, string newFileName, decimal importoSpesa, string codice, string descrizione, string codiceTipoPratica, bool verbose, LoginInfo utente)
 {
     _verbose = verbose;
     _tipo = tipo;
     _excelPath = excelFileName;
     _importoSpesa = importoSpesa;
     _descrizione = descrizione;
     _codice = codice;
     _utente = utente;
     copyFile(fullPath, newFileName, utente.LoginName + "&" + codice + "&" + importoSpesa + "&" + _descrizione + "&" + codiceTipoPratica);
 }
Esempio n. 2
0
 public ListaPremiAssicurativiUC(AssicurazioneContrattoDTO contratto, LoginInfo currentUser)
 {
     InitializeComponent();
     if (!DesignMode)
     {
         inizializza();
         if (contratto != null)
         {
             LoadData(contratto);
         }
     }
 }
Esempio n. 3
0
        public void Execute(TipoSpesatura tipo, string faxFullPath, string excelFileName, string newFileName, decimal importoSpesa, string codice, string descrizione, string codiceTipoPratica, bool verbose, LoginInfo utente)
        {
            _verbose = verbose;
            _tipo = tipo;
            _excelPath = excelFileName;
            _faxFullPath = faxFullPath;
            _importoSpesa = importoSpesa;
            _descrizione = descrizione;
            _codice = codice;
            _codiceTipoPratica = codiceTipoPratica;
            _utente = utente;

            System.Drawing.Image objImage = System.Drawing.Image.FromFile(_faxFullPath);
            _numeroPagine = objImage.GetFrameCount(new System.Drawing.Imaging.FrameDimension(objImage.FrameDimensionsList[0]));

            aggiornaDatabase();
        }
Esempio n. 4
0
 public SpesaturaFax(string excelPath, LoginInfo utente)
 {
     _excelFullPath = excelPath;
     _utente = utente;
 }
Esempio n. 5
0
        public void Execute(TipoSpesatura tipo, string fullPath, string excelFileName, string faxPath, decimal importoSpesa, string codice, string descrizione, string codiceTipoPratica, bool verbose, LoginInfo utente)
        {
            System.Drawing.Image objImage = System.Drawing.Image.FromFile(fullPath);
            _tipo = tipo;
            _verbose = verbose;
            _numeroPagine = objImage.GetFrameCount(new System.Drawing.Imaging.FrameDimension(objImage.FrameDimensionsList[0]));

            _descrizione = descrizione;
            _codice = codice;
            _excelFullPath = excelFileName;
            _importoSpesa = importoSpesa;
            _utente = utente;

            Esegui(codice, importoSpesa * _numeroPagine, utente.SiglaUtente);
        }
Esempio n. 6
0
 public void SetLoginInfo(LoginInfo login)
 {
     _currentLogin = login;
 }
Esempio n. 7
0
        public void Execute(string fullPath, LoginInfo currentUser)
        {
            condomini.Value = null;
            tipoPratica.Value = null;
            descrizione.Value = null;
            nomeFile.Value = null;
            tipoProvenienza.Value = null;

            _utentiExcel = null;
            _userLock = string.Empty;

            _currentUser = currentUser;
            _fullPath = fullPath;

            if (_persistenceContext == null)
            {
                System.Collections.IDictionary args = new System.Collections.Specialized.ListDictionary();
                args.Add("currentUser", _currentUser.LoginName);
                _persistenceContext = (IPersistenceContext)_container.Kernel.Resolve(typeof(IPersistenceContext), args);
            }
            _persistenceContext.BeginTransaction();

            // Controllo se gia spesata
            using (StreamReader sr = new StreamReader(_fullPath))
            {
                String line;
                while ((line = sr.ReadLine()) != null)
                {
                    if (line.StartsWith("SpesaturaInfo"))
                    {
                        RiepilogoSpesatura form = new RiepilogoSpesatura(line);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            this.ShowDialog();
                            return;
                        }
                        else
                            return;
                    }
                }
            }

            IFaxSpesaturaDao spesDao = _daoFactory.GetFaxSpesaturaDao();
            string checksum = Utility.GetFileChecksum(new FileInfo(_fullPath));
            if (String.IsNullOrEmpty(checksum))
            {
                log4net.MDC.Set("user", _currentUser.LoginName);
                _log.Fatal("FaxGest - SpesaturaUI.Execute: Checksum vuoto - File: " + _fullPath);
                MessageBox.Show("Errore inaspettato: Non è possibile identificare la spesatura per il file: "+ _fullPath);
            }
            else
            {

                try
                {
                    object spesatura = spesDao.GetByHashCode(checksum);
                    if (spesatura != null)
                    {
                        RiepilogoSpesatura form = new RiepilogoSpesatura((FaxSpesatura)spesatura);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            this.ShowDialog();
                            return;
                        }
                        else
                        {
                            try
                            {
                                _persistenceContext.RollbackAndCloseSession();
                            }
                            catch{}
                            return;
                        }
                    }
                }
                catch (Exception ex)
                {
                    log4net.MDC.Set("user", _currentUser.LoginName);
                    _log.Fatal("FaxGest - SpesaturaUI.Execute: Errore inaspettato durante il controllo della spesatura - Checksum: " + checksum + ", File: " + _fullPath, ex);
                    throw (ex);
                }

                this.ShowDialog();
            }
        }