예제 #1
0
파일: AI.cs 프로젝트: mohitk30/Notify
        private void AddNote()
        {
            //this.Hide();
            AddNote save_dialog = new AddNote();

            save_dialog.Show();
            //this.Show();
        }
예제 #2
0
        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 = "    "
예제 #3
0
        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));
        }
예제 #5
0
 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));
 }
예제 #6
0
 public RedirectToRouteResult AddNote(AddNote model)
 {
     return(this.RedirectToAction(c => c.Details(model.Id)));
 }
예제 #7
0
        private void Button_Click_OpenAdd(object sender, RoutedEventArgs e)
        {
            var window = new AddNote();

            window.ShowDialog();
        }
예제 #8
0
 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));
 }