Пример #1
0
        private void SaveNote(string newContent)
        {
            if (_content == newContent)
            {
                return;
            }

            if (newContent == "")
            {
                var eraseNote = new EraseNote(_taskId);
                _commandDispatcher.Send(eraseNote);
                _content = newContent;
                if (NoteErased != null)
                {
                    var eventArgs = new NoteErasedEventArgs(_taskId);
                    NoteErased(this, eventArgs);
                }
                return;
            }

            var saveNote = new SaveNote(_taskId, newContent);

            _commandDispatcher.Send(saveNote);
            _content = newContent;
            if (NoteSaved != null)
            {
                var eventArgs = new NoteSavedEventArgs(newContent, _taskId);
                NoteSaved(this, eventArgs);
            }
        }
 private void SaveNote(SaveNote message)
 {
     using (var db = new MyDbContext())
     {
         Note note = db.Notes.FirstOrDefault(x => x.ID == SelectedNote.ID);
         note.Title   = SelectedNote.Title;
         note.Content = SelectedNote.Content;
         db.SaveChanges();
     }
     MessageBox.Show("Note has been saved successfully!");
 }
Пример #3
0
 public DataTable UpdateMeetingNote(SaveNote obj)
 {
     using (SqlCommand sqlCommand = new SqlCommand())
     {
         sqlCommand.CommandType = CommandType.StoredProcedure;
         sqlCommand.CommandText = Procedures.InsertUpdateNote;
         sqlCommand.Parameters.AddWithValue("@NotificationId", obj.NotificationId);
         sqlCommand.Parameters.AddWithValue("@Note", obj.MeetingNote);
         return(DAL.GetDataTable(ConfigurationHelper.connectionString, sqlCommand));
     }
 }
Пример #4
0
        private void AddSnip()
        {
            ScreenCapture snippingTool = new ScreenCapture();

            this.Hide();
            if (snippingTool.SetCanvas())
            {
                Image    snip        = snippingTool.GetSnapShot();
                SaveNote save_dialog = new SaveNote(snip);
                save_dialog.ShowDialog();
                this.Show();
            }
            else
            {
                this.Show();
            }
        }