private void ok_Click(object sender, EventArgs e) { if (textBoxMrn.Text.Length == 0) { MessageBox.Show(PleaseEnterAMedicalRecordNumberToAddAnAppointment); return; } if (!_init) { _init = true; this.Enabled = false; this._appointment.MRN = this.textBoxMrn.Text; this._appointment.Load(); AddAppointmentView view; if (this._appointment.apptid.HasValue) { AppointmentList appts = new AppointmentList(); appts.LoadFullList(); appts.LoadList(); Appointment goldenAppointment = appts.First(appt => appt.apptID == this._appointment.apptid); view = new AddAppointmentView(goldenAppointment, this._clinicId, AddAppointmentView.Mode.Copy); } else { view = new AddAppointmentView(this._appointment.MRN, this._clinicId); } view.ShowDialog(); this.Close(); } }
public void DeleteTasks(int _institutionId, string unitnum, int apptid) { //SetUserSession(); string assignedBy = ""; if (SessionManager.Instance.ActiveUser != null) { if (string.IsNullOrEmpty(SessionManager.Instance.ActiveUser.ToString()) == false) { assignedBy = SessionManager.Instance.ActiveUser.ToString(); } } SessionManager.Instance.SetActivePatient(unitnum, apptid); RiskApps3.Model.PatientRecord.Patient p = SessionManager.Instance.GetActivePatient(); //Creating task object RiskApps3.Model.PatientRecord.Communication.Task t = new RiskApps3.Model.PatientRecord.Communication.Task(p, "Task", null, assignedBy, DateTime.Now); HraModelChangedEventArgs args = new HraModelChangedEventArgs(null); TaskList tList = new TaskList(p); tList.LoadFullList(); AppointmentList apt = new AppointmentList(); apt.LoadFullList(); foreach (RiskApps3.Model.PatientRecord.Communication.Task task in tList) { PtFollowupList fList = new PtFollowupList(task); fList.LoadFullList(); HraModelChangedEventArgs args1 = new HraModelChangedEventArgs(null); args1.Delete = true; foreach (PtFollowup followup in fList) { followup.BackgroundPersistWork(args1); } task.BackgroundPersistWork(args1); } //Creating folowup object }