Exemple #1
0
        public IActionResult AddNote([FromBody] RegisterNotes note)
        {
            try
            {
                if (note == null)
                {
                    return(BadRequest("Note is null."));
                }

                bool result = _notesBL.PostNote(note);
                if (result == true)
                {
                    return(this.Ok(new { success = true, message = "Note created successfully" }));
                }
                else
                {
                    return(this.BadRequest(new { success = false, message = "Note Creation failed" }));
                }
            }
            catch (Exception ex)
            {
                return(this.BadRequest(new { success = false, message = ex.Message }));
            }
        }
Exemple #2
0
        public IActionResult AddNewNote([FromBody] Note note)
        {
            try
            {
                if (note == null)
                {
                    return(BadRequest("Note is null."));
                }

                bool result = _notesBL.PostNote(note, Convert.ToInt64(GetTokenType()));
                if (result == true)
                {
                    return(this.Ok(new { success = true, message = "Note created successfully" }));
                }
                else
                {
                    return(this.BadRequest(new { success = false, message = "Note Creation failed" }));
                }
            }
            catch (Exception ex)
            {
                return(this.Ok(new { success = false, message = ex.Message }));
            }
        }