Exemple #1
0
        public async Task <bool> DeleteReminderNote(int noteId, int userId, DeleteReminderRequest reminder)
        {
            try
            {
                SqlConnection connection = DBConnection();
                SqlCommand    command    = StoreProcedureConnection("spReminder", connection);
                connection.Open();
                command.Parameters.AddWithValue("@UserId", userId);
                command.Parameters.AddWithValue("@Id", noteId);
                command.Parameters.AddWithValue("@AddReminder", reminder.Reminder);
                command.Parameters.AddWithValue("@ModifiedDateTime", DateTime.Now);
                int result = await command.ExecuteNonQueryAsync();

                connection.Close();
                if (result != 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                };
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemple #2
0
        public async Task <IActionResult> DeleteReminderNote(int noteId, DeleteReminderRequest reminder)
        {
            var userId = TokenUserId();

            if (await note.DeleteReminderNote(noteId, userId, reminder))
            {
                string status = "delete reminder successfully";
                return(Ok(new { status, userId, noteId, reminder }));
            }
            else
            {
                string status = "delete reminder not successfully";
                return(BadRequest(new { status, userId, noteId, reminder }));
            }
        }
Exemple #3
0
 public async Task <bool> DeleteReminderNote(int noteId, int userId, DeleteReminderRequest reminder)
 {
     return(await notes.DeleteReminderNote(noteId, userId, reminder));
 }