public virtual ActionResult Create(CreateNoteVM note, string hiddenTags) { try { if (ModelState.IsValid) { NoteDM _note = Mapper.Map <NoteDM>(note); _note.CreationDate = DateTime.Now; _note.Author = AccountDM.GetUserId(User.Identity.Name); NoteDM.Add(_note); return(RedirectToAction("Index", "Home")); } return(View(note)); } catch (Exception e) { Logger.Log("Create form post failed", e); return(View("~/Views/Shared/Error.cshtml")); } }
public CreateNoteView() { InitializeComponent(); BindingContext = new CreateNoteVM(); }