예제 #1
0
 /// <summary>
 /// Crea una Nazione valida
 /// </summary>
 public NotaPredefinita(string descrizione, TipoNotaEnum tipo, string testo, Azienda azienda)
 {
     Tipo = tipo;
     Testo = testo;
     Descrizione = descrizione;
     Azienda = azienda;
 }
예제 #2
0
        public List<NotaPredefinitaDTO> GetByTipo(TipoNotaEnum tipo, CondominioDTO condominio)
        {
            try
            {
                var note = GetServiceClient().GetNotePredefiniteByTipo(tipo, GetUserInfo());
                foreach (var nota in note)
                {
                    var testoNotaStr = nota.TestoHtml;
                    if (condominio != null)
                        testoNotaStr = FormattaTesto(condominio, null, null, null, testoNotaStr);

                    nota.Testo = testoNotaStr;
                }
                CloseService();

                return note;

            }
            catch (CommunicationObjectAbortedException ex)
            {
                _log.DebugFormat("Errore nella chiamata al servizio - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
            }
            catch (CommunicationObjectFaultedException ex)
            {
                _log.DebugFormat("Errore nella chiamata al servizio - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
            }
            catch (IOException ex)
            {
                _log.DebugFormat("Errore nella chiamata al servizio - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
            }
            catch (ObjectDisposedException ex)
            {
                _log.DebugFormat("Errore nella chiamata al servizio - {0} - azienda:{1}", ex, Utility.GetMethodDescription(), Login.Instance.CurrentLogin().Azienda);
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nella lettura delle note per tipo - {0} - condominio:{1} - tipo:{2} - azienda:{3}", ex, Utility.GetMethodDescription(), condominio != null ? condominio.ID.ToString() : "<NULL>", tipo, Login.Instance.CurrentLogin().Azienda);
            }

            return new List<NotaPredefinitaDTO>();
        }
예제 #3
0
		public IList<NotaPredefinitaDTO> GetNotePredefiniteByTipo(TipoNotaEnum tipo, UserInfo userinfo)
		{
			var windsorRep = new WindsorConfigRepository();
			try
			{
				windsorRep.BeginTransaction(userinfo);
                var repo = new NotaPredefinitaRepository(userinfo, windsorRep);
                var item = repo.GetByTipo(userinfo.Azienda, tipo);
				windsorRep.Commit();
				return item;
			}
			catch (Exception ex)
			{
                _log.ErrorFormat("Errore nella lettura delle note predefinite - {0} - tipo:{1} - azienda:{2}", ex, Utility.GetMethodDescription(), tipo, userinfo.Azienda);
				windsorRep.Rollback();
				throw;
			}
		}