Example #1
0
        public bool Update(int idMillesimo, int idConto, int idUnita, decimal valore)
        {
            try
            {
                var isInserimento = false;
                var daoFactory = _windsorRepository.GetDaoFactory(_info.Azienda);
                var millesimo = daoFactory.GetMillesimoDao().GetByContoSoggetto(idConto, idUnita);

                var repo = new MillesimoRepository(_info, _windsorRepository);
                if (millesimo != null)
                    repo.Update(millesimo.ID, valore);
                else
                {
                    repo.Insert(idConto, idUnita, valore);
                    isInserimento = true;
                }

                return isInserimento;
            }
            catch (Exception ex)
            {
                _log.Error("Errore nel salvataggio dei millesimi: " + Library.Utility.GetMethodDescription() + " - idMillesimo:" + idMillesimo + " - idConto:" + idConto + " - idUnita:" + idUnita + " - valore: " + valore, ex);
                throw;
            }
        }