private void FixupNotificacion(Notificacion previousValue)
        {
            if (previousValue != null && previousValue.NOTIFICACION_ACTIVA.Contains(this))
            {
                previousValue.NOTIFICACION_ACTIVA.Remove(this);
            }

            if (Notificacion != null)
            {
                if (!Notificacion.NOTIFICACION_ACTIVA.Contains(this))
                {
                    Notificacion.NOTIFICACION_ACTIVA.Add(this);
                }
                if (IdNotificacion != Notificacion.IdNotificacion)
                {
                    IdNotificacion = Notificacion.IdNotificacion;
                }
            }
        }
Пример #2
0
        public void InsertNotificacion(Model.SynClases.Notificacion element, System.Data.Objects.ObjectContext context)
        {
            try
            {
                if (element != null && context != null)
                {
                    NoscDBEntities entity = context as NoscDBEntities;
                    if (entity != null)
                    {
                        Notificacion insert = new Notificacion()
                        {
                            IdNotificacion = element.IdNotificacion,
                            FechaCreacion = element.FechaCreacion,
                            Parametro = element.Parametro,
                            Mensaje = element.Mensaje,
                            Titulo = element.Titulo,
                            IdUsuario = element.IdUsuario,
                            IdApp = element.IdApp,
                            FechaNotificacion = element.FechaNotificacion,
                            IsCerrado = element.IsCerrado,
                            FechaCerrado = element.FechaCerrado,
                            CanCerrar = element.CanCerrar,
                            IsModified = element.IsModified,
                            LastModifiedDate = element.LastModifiedDate,
                            ServerLastModifiedDate = element.ServerLastModifiedDate,
                            Recurrencia = element.Recurrencia,
                            FechaUltimaMuestra = element.FechaUltimaMuestra,
                            IsNotificacionActiva = element.IsNotificacionActiva,
                            IsDescartarOnClick = element.IsDescartarOnClick
                        };
                        entity.Notificacions.AddObject(insert);
                        entity.SaveChanges();
                    }
                }
            }
            catch (Exception)
            {

                throw;
            }
        }