public IActionResult Edit(int gameID, int id) { var model = new NoteEditViewModel(); model.Note = NoteModel.GenerateNoteModelFromDTO(work.NoteRepository.GetDTO(id)); model.NoteTypes = work.NoteTypeRepository.GetAll().Select(e => NoteTypeModel.GenerateNoteTypeModelFromDTO(e)); return(View(model)); }
public IActionResult Create(int gameID) { var model = new NoteCreateViewModel(); model.Note = new NoteModel() { GameID = gameID }; model.NoteTypes = work.NoteTypeRepository.GetAll().Select(e => NoteTypeModel.GenerateNoteTypeModelFromDTO(e)); return(View(model)); }
public IActionResult Create(NoteCreateViewModel model) { if (!ModelState.IsValid) { model.NoteTypes = work.NoteTypeRepository.GetAll().Select(e => NoteTypeModel.GenerateNoteTypeModelFromDTO(e)); return(View(model)); } work.NoteRepository.Add(NoteModel.GenerateNoteDTOFromModel(model.Note)); work.Save(); return(RedirectToAction("Index", new { GameID = model.Note.GameID })); }
public static NoteType Map(NoteTypeModel noteType) { NoteType data; switch (noteType) { case NoteTypeModel.Memo: data = NoteType.Memo; break; case NoteTypeModel.Meeting: data = NoteType.Meeting; break; case NoteTypeModel.Task: data = NoteType.Task; break; default: throw new ArgumentException($"Couldn't map unexpected note type model: {noteType}"); } return(data); }
public Task <BaseResponseMessage> SaveNotesFile(string notesFilePath, NoteTypeModel noteType) { throw new NotImplementedException(); }
public Task <BaseResponseMessage> ImportNotes(IList <NoteModel> notes, NoteTypeModel noteType) { throw new NotImplementedException(); }