Example #1
0
 public void OnNext(EntityCambiataMsg value)
 {
     // Qualcuno ha spataccato nella tabella dei formati carta. Rileggo tutto
     if (value.type == typeof(AzioneAuto))
     {
         rileggereAzioniAutomaticheCommand.Execute(false);
     }
 }
 public void OnNext(EntityCambiataMsg value)
 {
     // Qualcuno ha spataccato nella tabella degli eventi. Rileggo tutto
     if (value.type == typeof(Evento))
     {
         refreshEventiCommand.Execute(false);
     }
 }
 public void OnNext(EntityCambiataMsg value)
 {
     // Qualcuno ha spataccato nella tabella degli ScarichiCards. Rileggo tutto
     if (value.type == typeof(ScaricoCard))
     {
         App.Current.Dispatcher.BeginInvoke(
             new Action(() => {
             refreshScarichiCardsCommand.Execute(false);
         }
                        ));
     }
 }
        public void OnNext(EntityCambiataMsg value)
        {
            // Qualcuno ha spataccato nella tabella dei fotografi. Rileggo tutto
            if (value.type == typeof(Fotografo))
            {
//				App.Current.Dispatcher.BeginInvoke(
//					new Action( () => {
                rileggereFotografiCommand.Execute(false);
//					}
//				) );
            }
        }
Example #5
0
        public int saveChanges()
        {
            // Non fare try-catch. Se fallice deve saltare con eccezione.
            int quanti = UnitOfWorkScope.currentDbContext.SaveChanges();

            // Notifico tutta l'applicazione che รจ successo qualcosa
            if (quanti > 0)
            {
                EntityCambiataMsg ecm = new EntityCambiataMsg(this);
                ecm.type = typeof(TEntity);
                pubblicaMessaggio(ecm);
            }
            else
            {
                _giornale.Warn("Salvataggio con zero record. Strano. Controllare");
            }

            return(quanti);
        }