public async Task <IActionResult> NewNote(NewNoteView model, CancellationToken cancellationToken) { if (ModelState.IsValid) { Note note = new Note(); note.DepartmentId = DepartmentId; note.UserId = UserId; note.AddedOn = DateTime.UtcNow; note.Title = model.Title; note.Body = System.Net.WebUtility.HtmlDecode(model.Body); if (ClaimsAuthorizationHelper.IsUserDepartmentAdmin()) { note.IsAdminOnly = bool.Parse(model.IsAdminOnly); } else { note.IsAdminOnly = false; } note.Category = model.Category; await _notesService.SaveAsync(note, cancellationToken); return(RedirectToAction("Index", "Notes", new { Area = "User" })); } return(View(model)); }
public async Task <IActionResult> NewNote() { NewNoteView model = new NewNoteView(); return(View(model)); }
public IActionResult NewNote() { NewNoteView model = new NewNoteView(); return(View(model)); }