コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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 }));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public Task <BaseResponseMessage> SaveNotesFile(string notesFilePath, NoteTypeModel noteType)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 public Task <BaseResponseMessage> ImportNotes(IList <NoteModel> notes, NoteTypeModel noteType)
 {
     throw new NotImplementedException();
 }