private async Task ExecuteShowDetailCommand(NoteRealm note) { NotesViewModel notesViewModel = this; notesViewModel._singleNavigation.DisableNavigation(); int num = await notesViewModel._navigationService.Navigate <NoteDetailViewModel, NoteRealm>((M1)note, (IMvxBundle)null, new CancellationToken()) ? 1 : 0; }
public ActionResult DeleteConfirmed(string id) { NoteRealm note = db.Notes.Find(id); db.Notes.Remove(note); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Description,Title,PostTime")] NoteRealm note) { if (ModelState.IsValid) { db.Entry(note).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(note)); }
public ActionResult Create([Bind(Include = "Id,Description,Title,PostTime")] NoteRealm note) { if (ModelState.IsValid) { note.PostTime = DateTimeOffset.Now; note.Id = Guid.NewGuid().ToString(); db.Notes.Add(note); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(note)); }
// GET: Notes/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NoteRealm note = db.Notes.Find(id); if (note == null) { return(HttpNotFound()); } return(View(note)); }
private static void AddNotes(UserRealm user, DataBaseHelper dbHelper) { var newNote = new NoteRealm(); newNote.UserId = user.UserKey; Console.WriteLine("Введите название записи : "); newNote.Title = Console.ReadLine(); Console.WriteLine("Введите саму запись : "); newNote.ContentText = Console.ReadLine(); dbHelper.SaveNote(newNote); Console.WriteLine("Хотите добавить еще запись ? y/n"); var result = Console.ReadKey(); if (result.KeyChar == 'y') { Console.WriteLine(); AddNotes(user, dbHelper); } }
public async Task AddOrUpdateAsync(NoteRealm note, Action <NoteRealm> action) { await this._noteRepository.AddOrUpdateAsync(note, action); }
public void AddOrUpdate(NoteRealm note, Action <NoteRealm> action) { this._noteRepository.AddOrUpdate(note, action); }
private void ShowDetail(ListItem x) { this._singleNavigation.DisableNavigation(); if (x.Type == typeof(eKreta.Mobile.Core.Models.Evaluation)) { EvaluationRealm evaluationRealm = this._evaluationDbDataService.Get(x.StringId); if (evaluationRealm == null) { return; } this._navigationService.Navigate <EvaluationDetailViewModel, EvaluationRealm>((M1)evaluationRealm, (IMvxBundle)null, new CancellationToken()); } else if (x.Type == typeof(Ekreta.Mobile.Core.Models.Absence)) { AbsenceRealm absenceRealm = this._absenceDbDataService.Get(x.Id); if (absenceRealm == null) { return; } this._navigationService.Navigate <AbsenceDetailViewModel, AbsenceRealm>((M1)absenceRealm, (IMvxBundle)null, new CancellationToken()); } else if (x.Type == typeof(Ekreta.Mobile.Core.Models.Note)) { NoteRealm noteRealm = this._noteDbDataService.Get(this.ActiveProfile.RolelessId, x.Id); if (noteRealm == null) { return; } this._navigationService.Navigate <NoteDetailViewModel, NoteRealm>((M1)noteRealm, (IMvxBundle)null, new CancellationToken()); } else if (x.Type == typeof(Ekreta.Mobile.Core.Models.Lesson)) { LessonRealm teacherHomeworkId = this._lessonDbDataService.GetByTeacherHomeworkId(x.Id); if (teacherHomeworkId == null) { return; } if (teacherHomeworkId.IsTanuloHaziFeladatEnabled) { this._navigationService.Navigate <HomeWorkStudentDetailViewModel, LessonRealm>((M1)teacherHomeworkId, (IMvxBundle)null, new CancellationToken()); } else { this._navigationService.Navigate <HomeWorkDetailViewModel, LessonRealm>((M1)teacherHomeworkId, (IMvxBundle)null, new CancellationToken()); } } else if (x.Type == typeof(Event)) { Event @event = this._eventDataService.Get(x.StringId); if (@event == null) { return; } this._navigationService.Navigate <EventDetailViewModel, Event>((M1)@event, (IMvxBundle)null, new CancellationToken()); } else { if (!(x.Type == typeof(Ekreta.Mobile.Core.Models.Exam))) { return; } ExamRealm examRealm = this._examDbDataService.Get(x.StringId); if (examRealm == null) { return; } this._navigationService.Navigate <ExamsDetailViewModel, ExamRealm>((M1)examRealm, (IMvxBundle)null, new CancellationToken()); } }