private void AddNote() { //this.Hide(); AddNote save_dialog = new AddNote(); save_dialog.Show(); //this.Show(); }
public void Command_must_contain_SchoolId_and_Content() { var school = new SchoolAggregate(SchoolId.With(default(Guid))); var author = new ApplicationUser(); var command = new AddNote.Command() { SchoolId = default, Content = " "
void OnAddClick(object sender, EventArgs e) { //For each dialog we use the same instance of ViewModel var customerDialogBox = new AddNote(((CreatePatientViewModel)this.DataContext).AddNoteViewModel); //No need to check DialogResult - it is respnsibility of ViewModel to interpret the result of commands //View only displays the window customerDialogBox.ShowDialog(); }
public void When(AddNote c) { var nextRecord = _state.GetNext(g => new NoteId(g)); if (!_state.StoryExists(c.StoryId)) { throw Error("Story {0} was not found", c.StoryId); } Apply(new NoteAdded(nextRecord, c.Title, c.Text, c.StoryId)); }
public IActionResult AddNote(AddNote Note) { if (ModelState.IsValid) { Console.WriteLine("I am here"); string add_query = $@"INSERT INTO notes (note,created_at,updated_at) VALUES ('{Note.title}',NOW(),NOW())"; DbConnector.Execute(add_query); return(RedirectToAction("Index")); } return(View("Index", Note)); }
public RedirectToRouteResult AddNote(AddNote model) { return(this.RedirectToAction(c => c.Details(model.Id))); }
private void Button_Click_OpenAdd(object sender, RoutedEventArgs e) { var window = new AddNote(); window.ShowDialog(); }