Esempio n. 1
0
 public ActionResult Edit(NoteModel noteModel)
 {
     if (ModelState.IsValid)
     {
         noteModel.UpdateAt = DateTime.Now;
         Note note = noteModel.ToEntity();
         noteService.Update(note);
         return(RedirectToAction("Index"));
     }
     return(View(noteModel));
 }
Esempio n. 2
0
 public ActionResult Create(NoteModel noteModel)
 {
     if (ModelState.IsValid)
     {
         noteModel.NoteID   = Guid.NewGuid().ToString();
         noteModel.CreateAt = DateTime.Now;
         noteModel.UpdateAt = DateTime.Now;
         Note note = noteModel.ToEntity();
         noteService.Create(note);
         return(RedirectToAction("Index"));
     }
     return(View(noteModel));
 }