public ComAllegato LoadAllegatoComunicazioneById(long idAllegato) { using (IComAllegatoDao dao = getDaoContext().DaoImpl.ComAllegatoDao) { return(dao.GetById(idAllegato)); } }
public void UpdateAllegati(SendMail.Model.TipoCanale tipoCanale, Comunicazioni comunicazione) { this.Context.StartTransaction(this.GetType()); try { using (IComAllegatoDao allDao = this.Context.DaoImpl.ComAllegatoDao) { allDao.Update(comunicazione.ComAllegati); } } catch (Exception ex) { if (this.Context.TransactionRootElement == this.GetType()) { this.Context.RollBackTransaction(this.GetType()); } //TASK: Allineamento log - Ciro if (!ex.GetType().Equals(typeof(ManagedException))) { ManagedException mEx = new ManagedException(String.Format("Errore update allegati. Dettaglio: {0}", ex.Message), "ERR_COM_004", string.Empty, string.Empty, ex.InnerException); ErrorLogInfo err = new ErrorLogInfo(mEx); err.objectID = comunicazione.IdComunicazione.ToString(); _log.Error(err); throw mEx; } //ErrorLogInfo error = new ErrorLogInfo(); //error.freeTextDetails = ex.Message; //error.logCode = "ERR_COM_004"; //_log.Error(error); else { throw ex; } } if (this.Context.TransactionRootElement == this.GetType()) { this.Context.EndTransaction(this.GetType()); } }