Beispiel #1
0
        public void RegisterUserAction(UserActionEvent userAction)
        {
            _connection.Open();
            var command = new SQLiteCommand(_connection);

            command.CommandText = "INSERT INTO UserAction(UserId, Type) VALUES(@userId, @type)";
            command.Parameters.AddWithValue("@userId", userAction.UserId);
            command.Parameters.AddWithValue("@type", userAction.Type);
            command.Prepare();
            command.ExecuteNonQuery();
            _connection.Close();
        }
Beispiel #2
0
        public IActionResult Post([FromBody] RegisterUserActionRequest userActionRequest)
        {
            var userAction = new UserActionEvent {
                Id = "0", UserId = userActionRequest.UserId, Type = userActionRequest.Type
            };
            var result   = Facade.RegisterUserAction(userAction);
            var response = new RegisterUserActionResponse {
                HasDiscount = result
            };

            return(Ok(response));
        }
Beispiel #3
0
 public bool RegisterUserAction(UserActionEvent userAction)
 {
     Repository.RegisterUserAction(userAction);
     return(CheckForDiscount(userAction.UserId));
 }
Beispiel #4
0
 public void Handle(UserActionEvent message)
 {
     IsHidden = true;
 }