| 1 | using System; | 
|---|
| 2 | using System.Collections.Generic; | 
|---|
| 3 | using System.ComponentModel; | 
|---|
| 4 | using System.Data; | 
|---|
| 5 | using System.Drawing; | 
|---|
| 6 | using System.Linq; | 
|---|
| 7 | using System.Text; | 
|---|
| 8 | using System.Windows.Forms; | 
|---|
| 9 |  | 
|---|
| 10 | namespace IndianHealthService.ClinicalScheduling | 
|---|
| 11 | { | 
|---|
| 12 | /// <summary> | 
|---|
| 13 | /// Form which displays exams for User so that the user would pick one of them | 
|---|
| 14 | /// for which to make an appointment | 
|---|
| 15 | /// </summary> | 
|---|
| 16 | public partial class DRadExamsSelect : Form | 
|---|
| 17 | { | 
|---|
| 18 | //return values | 
|---|
| 19 | public int ExamIEN { get; private set; } | 
|---|
| 20 | public string ProcedureName { get; private set; } | 
|---|
| 21 | public bool PrintAppointmentSlip { get { return chkPrint.Checked; } } | 
|---|
| 22 | //end return values | 
|---|
| 23 |  | 
|---|
| 24 | //private fields | 
|---|
| 25 | public bool _myCodeIsFiringIstheCheckBoxChangedEvent = false; | 
|---|
| 26 | //private fields | 
|---|
| 27 |  | 
|---|
| 28 | /// <summary> | 
|---|
| 29 | /// ctor | 
|---|
| 30 | /// </summary> | 
|---|
| 31 | /// <param name="_radExams">Strongly Typed Table of Exams</param> | 
|---|
| 32 | public DRadExamsSelect(List<RadiologyExam> _radExams) | 
|---|
| 33 | { | 
|---|
| 34 | InitializeComponent(); | 
|---|
| 35 |  | 
|---|
| 36 | this.lstExams.DataSource = _radExams; | 
|---|
| 37 | this.lstExams.SelectionMode = SelectionMode.One; | 
|---|
| 38 |  | 
|---|
| 39 | //Set Default Checkbox | 
|---|
| 40 | _myCodeIsFiringIstheCheckBoxChangedEvent = true; | 
|---|
| 41 | chkPrint.Checked = CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially; | 
|---|
| 42 | _myCodeIsFiringIstheCheckBoxChangedEvent = false; | 
|---|
| 43 | } | 
|---|
| 44 |  | 
|---|
| 45 | private void btnOK_Click(object sender, EventArgs e) | 
|---|
| 46 | { | 
|---|
| 47 | SharedFinishLine(); | 
|---|
| 48 | } | 
|---|
| 49 |  | 
|---|
| 50 | private void lstExams_MouseDoubleClick(object sender, MouseEventArgs e) | 
|---|
| 51 | { | 
|---|
| 52 | SharedFinishLine(); | 
|---|
| 53 | } | 
|---|
| 54 |  | 
|---|
| 55 | private void SharedFinishLine() | 
|---|
| 56 | { | 
|---|
| 57 | if (lstExams.SelectedIndex < 0) | 
|---|
| 58 | { | 
|---|
| 59 | this.DialogResult = DialogResult.None; | 
|---|
| 60 | return; | 
|---|
| 61 | } | 
|---|
| 62 |  | 
|---|
| 63 | ExamIEN = (lstExams.Items[lstExams.SelectedIndex] as RadiologyExam).IEN; | 
|---|
| 64 | ProcedureName = (lstExams.Items[lstExams.SelectedIndex] as RadiologyExam).Procedure; | 
|---|
| 65 | this.DialogResult = DialogResult.OK; | 
|---|
| 66 | } | 
|---|
| 67 |  | 
|---|
| 68 | /// <summary> | 
|---|
| 69 | /// Save preference for Auto Printing Appointment Slip in the DB | 
|---|
| 70 | /// </summary> | 
|---|
| 71 | /// <param name="sender"></param> | 
|---|
| 72 | /// <param name="e"></param> | 
|---|
| 73 | private void chkPrint_CheckedChanged(object sender, EventArgs e) | 
|---|
| 74 | { | 
|---|
| 75 | if (_myCodeIsFiringIstheCheckBoxChangedEvent) return; | 
|---|
| 76 |  | 
|---|
| 77 | CGDocumentManager.Current.UserPreferences.PrintAppointmentSlipAutomacially = chkPrint.Checked; | 
|---|
| 78 | } | 
|---|
| 79 |  | 
|---|
| 80 |  | 
|---|
| 81 | } | 
|---|
| 82 | } | 
|---|