Пример #1
0
        /// <summary>
        /// Salva o log de alteração do Grupo
        /// </summary>
        /// <param name="session"></param>
        /// <returns></returns>
        public override Colosoft.Business.SaveResult Save(Colosoft.Data.IPersistenceSession session)
        {
            if (ExistsInStorage)
            {
                #region Log

                if (ChangedProperties.Contains("IdGrupo"))
                {
                    var planoContasAnterior = Microsoft.Practices.ServiceLocation.ServiceLocator
                                              .Current.GetInstance <IProvedorPlanoContas>()
                                              .ObtemPlanoContas(IdConta);

                    var logAlteracao = ObterLogAlteracao();

                    logAlteracao.ValorAnterior = planoContasAnterior.Grupo.Descricao;
                    logAlteracao.ValorAtual    = Grupo.Descricao;
                    logAlteracao.Campo         = "Grupo";

                    logAlteracao.Save(session);
                }

                #endregion
            }

            return(base.Save(session));
        }
Пример #2
0
        /// <summary>
        /// Raises a Property Changed event
        /// </summary>
        protected virtual void OnPropertyChanged(string propertyName, object before, object after)
        {
            // Register Property Changed
            if (!ChangedProperties.Contains(propertyName) && propertyName != "" && before != after)
            {
                ChangedProperties.Add(propertyName);
            }

            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
Пример #3
0
 public void AddChangedProperties(IEnumerable <string> props)
 {
     if (ChangedProperties == null)
     {
         ChangedProperties = props.ToArray();
     }
     else
     {
         ChangedProperties = ChangedProperties.Concat(props.Where(p => !ChangedProperties.Contains(p))).ToArray();
     }
 }
Пример #4
0
        /// <summary>
        /// Raises a Property Changed event
        /// </summary>
        public void OnPropertyChanged(string propertyName, object before, object after)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));

            if (propertyName == null || ChangeTrackingDisabled)
            {
                return;
            }

            // Register Property Changed
            if (!ChangedProperties.Contains(propertyName) && before != after)
            {
                ChangedProperties.Add(propertyName);
            }
        }