private void ShowProgressNote(int clientId, int noteId = 0) { ProgressNoteInformation clientProgressNote = null; // Create a note object if (noteId == 0) { // Create a new note object clientProgressNote = new ProgressNoteInformation { ClientId = clientId }; ClientAppointment lastAppointment = ClientAppointment.GetLastAppointmentForClient(clientId); if (lastAppointment != null) { clientProgressNote.DateOfService = lastAppointment.StartTime.Date; clientProgressNote.TimeStarted = lastAppointment.StartTime; clientProgressNote.TimeEnded = lastAppointment.EndTime; } } else { clientProgressNote = ProgressNoteInformation.ReturnClientProgressNote(noteId); } // Create the progress note form ProgressNoteForm progressForm = new ProgressNoteForm { MainFormObject = this, CurrentProgressNote = clientProgressNote }; // Pass in the note if (noteId > 0) { progressForm.EditMode = true; } // Show the screen DialogResult dlgResult = progressForm.ShowDialog(); // Refresh the list FillClientTreeView(); // If we deleted what we had selected, select the first item in the list if (dlgResult == DialogResult.Abort) { treeViewClients.SelectedNode = treeViewClients.Nodes[0].Nodes[0]; } }
private void ShowProgressNoteReport(int progressNoteId) { ProgressNoteInformation selProgressNote = ProgressNoteInformation.ReturnClientProgressNote(progressNoteId); if (selProgressNote != null) { ProgressNoteReport progressNoteReport = new ProgressNoteReport { objectDataSourcePN = { DataSource = selProgressNote } }; documentViewerMain.PrintingSystem = progressNoteReport.PrintingSystem; progressNoteReport.CreateDocument(); } }
private void simpleButtonEdit_Click(object sender, System.EventArgs e) { if (dataGridViewNoteList.SelectedRows.Count > 0) { DataGridViewRow dgr = dataGridViewNoteList.SelectedRows[0]; // get the progress note id from the tag of the selected item int progressNoteId = (int)dgr.Tag; ProgressNoteForm noteForm = new ProgressNoteForm { CurrentProgressNote = ProgressNoteInformation.ReturnClientProgressNote(progressNoteId) }; // Show the screen noteForm.ShowDialog(); } }