public ModelViewNotification Get(ModelViewNotificationUpdate model)
        {
            if (model.TokenApp != GlobalConfiguration.TokenWEB)
            {
                if (model.TokenApp != GlobalConfiguration.TokenMobile)
                {
                    throw new Exception("TokenInvalid");
                }
            }

            var data = new RepositoryNotification().Get(model.MessageID);

            return(new ModelViewNotification()
            {
                MessageID = data.MessageID,
                Message = data.Message,
                MessageRead = data.MessageRead,
                Title = data.Title,
                Url = data.Url,
                UserID = data.UserID,
                UserName = data.UserName,
                Status = data.Status,
                CreateDate = data.CreateDate,
                ModifyDate = data.ModifyDate,
                CreateDateString = data.CreateDate.ToString("dd/MM/yyyy HH:mm:ss"),
                ModifyDateString = data.ModifyDate.ToString("dd/MM/yyyy HH:mm:ss")
            });
        }
        public void Status(ModelViewNotificationUpdate model)
        {
            if (model.TokenApp != GlobalConfiguration.TokenWEB)
            {
                if (model.TokenApp != GlobalConfiguration.TokenMobile)
                {
                    throw new Exception("TokenInvalid");
                }
            }

            var data = new RepositoryNotification().Get(model.MessageID);

            data.MessageRead = model.MessageRead;
            data.Status      = model.Status;
            new RepositoryNotification().Update(data);
        }
Exemplo n.º 3
0
 public static void Status(ModelViewNotificationUpdate model)
 {
     new BusinessNotification().Status(model);
 }