コード例 #1
0
        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")
            });
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public static void Status(ModelViewNotificationUpdate model)
 {
     new BusinessNotification().Status(model);
 }