Changeset 755 for Scheduling
- Timestamp:
- May 11, 2010, 1:24:18 AM (15 years ago)
- Location:
- Scheduling/trunk/cs/bsdx0200GUISourceCode
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.csproj
r753 r755 414 414 <SubType>Designer</SubType> 415 415 </EmbeddedResource> 416 <EmbeddedResource Include="DPatientApptDisplay.resx">417 <DependentUpon>DPatientApptDisplay.cs</DependentUpon>418 <SubType>Designer</SubType>419 </EmbeddedResource>420 416 <EmbeddedResource Include="DPatientLetter.resx"> 421 417 <DependentUpon>DPatientLetter.cs</DependentUpon> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientApptDisplay.cs
r753 r755 14 14 public class DPatientApptDisplay : System.Windows.Forms.Form 15 15 { 16 private System.Windows.Forms.Panel panel1;17 private System.Windows.Forms.CheckBox chkIncludePast;18 private DataGridView dataGridView1;19 16 /// <summary> 20 17 /// Required designer variable. … … 24 21 public void InitializeForm(CGDocumentManager docManager, int nPatientID) 25 22 { 26 try 27 { 28 string sSql = "BSDX PATIENT APPT DISPLAY^" + nPatientID.ToString(); 29 DataTable dtAppt = docManager.RPMSDataTable(sSql, "PatientAppts"); 30 dataGridView1.DataSource = dtAppt; 31 } 32 catch (Exception ex) 33 { 34 MessageBox.Show(ex.Message); 35 } 36 } 23 Control UC = new UCPatientAppts(docManager, nPatientID); 24 UC.Dock = DockStyle.Fill; 25 this.Controls.Add(UC); 26 } 37 27 38 28 public DPatientApptDisplay() … … 61 51 /// the contents of this method with the code editor. 62 52 /// </summary> 53 63 54 private void InitializeComponent() 64 55 { 65 this.panel1 = new System.Windows.Forms.Panel();66 this.chkIncludePast = new System.Windows.Forms.CheckBox();67 this.dataGridView1 = new System.Windows.Forms.DataGridView();68 this.panel1.SuspendLayout();69 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();70 this.SuspendLayout();71 //72 // panel173 //74 this.panel1.Controls.Add(this.chkIncludePast);75 this.panel1.Dock = System.Windows.Forms.DockStyle.Top;76 this.panel1.Location = new System.Drawing.Point(0, 0);77 this.panel1.Name = "panel1";78 this.panel1.Size = new System.Drawing.Size(664, 32);79 this.panel1.TabIndex = 1;80 //81 // chkIncludePast82 //83 this.chkIncludePast.Location = new System.Drawing.Point(16, 8);84 this.chkIncludePast.Name = "chkIncludePast";85 this.chkIncludePast.Size = new System.Drawing.Size(184, 16);86 this.chkIncludePast.TabIndex = 0;87 this.chkIncludePast.Text = "Include Past Appointments";88 this.chkIncludePast.CheckedChanged += new System.EventHandler(this.chkIncludePast_CheckedChanged);89 //90 // dataGridView191 //92 this.dataGridView1.AllowUserToAddRows = false;93 this.dataGridView1.AllowUserToDeleteRows = false;94 this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;95 this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;96 this.dataGridView1.Location = new System.Drawing.Point(0, 32);97 this.dataGridView1.Name = "dataGridView1";98 this.dataGridView1.ReadOnly = true;99 this.dataGridView1.Size = new System.Drawing.Size(664, 446);100 this.dataGridView1.TabIndex = 2;101 //102 56 // DPatientApptDisplay 103 57 // 104 58 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 105 59 this.ClientSize = new System.Drawing.Size(664, 478); 106 this.Controls.Add(this.dataGridView1);107 this.Controls.Add(this.panel1);108 60 this.Name = "DPatientApptDisplay"; 109 61 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 110 62 this.Text = "Patient Appointments"; 111 this.panel1.ResumeLayout(false);112 ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();113 63 this.ResumeLayout(false); 114 64 115 65 } 116 66 #endregion 117 118 private void chkIncludePast_CheckedChanged(object sender, System.EventArgs e)119 {120 if (chkIncludePast.Checked == true)121 {122 //this.crViewer1.SelectionFormula = "TRUE"; //MJL 9/11/2007123 }124 else125 {126 //crViewer1.SelectionFormula = "{PatientAppts.ApptDate} >= CurrentDate";127 }128 //crViewer1.RefreshReport();129 }130 67 } 131 68 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/UCPatientAppts.Designer.cs
r753 r755 40 40 this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2(); 41 41 this.panel1 = new System.Windows.Forms.Panel(); 42 this.btnPrint = new System.Windows.Forms.Button(); 42 43 this.chkPastAppts = new System.Windows.Forms.CheckBox(); 43 this.btnPrint = new System.Windows.Forms.Button();44 44 this.printDialog1 = new System.Windows.Forms.PrintDialog(); 45 45 this.PrintPtAppts = new System.Drawing.Printing.PrintDocument(); … … 133 133 this.panel1.TabIndex = 3; 134 134 // 135 // btnPrint 136 // 137 this.btnPrint.Location = new System.Drawing.Point(3, 3); 138 this.btnPrint.Name = "btnPrint"; 139 this.btnPrint.Size = new System.Drawing.Size(75, 23); 140 this.btnPrint.TabIndex = 1; 141 this.btnPrint.Text = "Print"; 142 this.btnPrint.UseVisualStyleBackColor = true; 143 this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click); 144 // 135 145 // chkPastAppts 136 146 // … … 145 155 this.chkPastAppts.CheckedChanged += new System.EventHandler(this.chkPastAppts_CheckedChanged); 146 156 // 147 // btnPrint148 //149 this.btnPrint.Location = new System.Drawing.Point(3, 3);150 this.btnPrint.Name = "btnPrint";151 this.btnPrint.Size = new System.Drawing.Size(75, 23);152 this.btnPrint.TabIndex = 1;153 this.btnPrint.Text = "Print";154 this.btnPrint.UseVisualStyleBackColor = true;155 this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);156 //157 157 // printDialog1 158 158 // … … 164 164 this.PrintPtAppts.DocumentName = "Print Patient Appointments"; 165 165 this.PrintPtAppts.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.PrintPtAppts_PrintPage); 166 this.PrintPtAppts.QueryPageSettings += new System.Drawing.Printing.QueryPageSettingsEventHandler(this.PrintPtAppts_QueryPageSettings); 166 167 // 167 168 // UCPatientAppts -
Scheduling/trunk/cs/bsdx0200GUISourceCode/UCPatientAppts.cs
r753 r755 14 14 public partial class UCPatientAppts : UserControl 15 15 { 16 DataTable dtAppt; 17 DataView dvAppt; 16 DataTable dtAppt; // Main table 17 DataView dvAppt; // Manipulated view of table 18 int rowToPrint; // Used in printing 18 19 /// <summary> 19 /// Ctor 20 /// Ctor - Creates control and populates data into datagridview 20 21 /// </summary> 21 22 /// <param name="docManager">Document Manager from main context</param> … … 44 45 { 45 46 if (ShowPastAppts) dvAppt.RowFilter = ""; 46 else dvAppt.RowFilter = "ApptDate > " + "#" + DateTime.Today.ToShortDateString() + "#"; ;47 else dvAppt.RowFilter = "ApptDate > " + "#" + DateTime.Today.ToShortDateString() + "#"; 47 48 } 48 49 … … 56 57 { 57 58 Graphics g = e.Graphics; 58 using (Font font = new Font("Lucida Console", 72)) 59 Font Serif12Bold = new Font(FontFamily.GenericSerif, 12, FontStyle.Bold); 60 Font Serif12 = new Font(FontFamily.GenericSerif, 12); 61 Font Serif14 = new Font(FontFamily.GenericSerif, 14); 62 Rectangle startDrawRectangle = e.MarginBounds; 63 int widthPerColumn = e.MarginBounds.Width/dgAppts.Columns.Count; 64 int Serif12Height = (int)Serif12.GetHeight(); 65 66 //Draw Header 67 StringFormat sf1 = new StringFormat(); 68 sf1.Alignment = StringAlignment.Center; 69 g.DrawString("Appointment Listing", Serif14, Brushes.Black, startDrawRectangle, sf1); 70 71 startDrawRectangle.Y += (int)Serif14.GetHeight(); 72 73 g.DrawString("Confidential Patient Information", Serif12, Brushes.Black, startDrawRectangle, sf1); 74 75 startDrawRectangle.Y += Serif12Height * 2; 76 77 //Patient Name + Sex + DOB 78 string identifier = "Patient Name: " + dtAppt.Rows[0]["Name"] + "\tSex: " + dtAppt.Rows[0]["Sex"] 79 + "\tDate of Birth: " + dtAppt.Rows[0]["DOB"]; 80 g.DrawString(identifier, Serif12, Brushes.Black, startDrawRectangle); 81 82 startDrawRectangle.Y += Serif12Height * 2; 83 84 foreach (DataGridViewColumn col in dgAppts.Columns) 59 85 { 60 g.DrawString("Hello,\nPrinter", font, Brushes.Black, e.MarginBounds); 86 g.DrawString(col.HeaderText, Serif12Bold, Brushes.Black, startDrawRectangle); 87 startDrawRectangle.X += widthPerColumn; 61 88 } 89 startDrawRectangle.Y += Serif12Height; 90 91 // rowToPrint initialized in print button handler. Helps us keep track of which row we 92 // are on, so that, just in case we need an extra page to print, we would know where 93 // we left off. Royal we of course. 94 for ( ; rowToPrint<dgAppts.Rows.Count; rowToPrint++) 95 { 96 // Post facto statement -- This is starting to look like Mumps... 97 // Start drawing a new page if you hit the bottom margin... 98 // Y incremented at the bottom of the for loop; but checked here 99 // because I need for statement stuff to happen first 100 if (startDrawRectangle.Y > e.MarginBounds.Bottom) 101 { 102 e.HasMorePages = true; 103 break; 104 } 105 106 startDrawRectangle.X = e.MarginBounds.X; 107 108 foreach (DataGridViewCell cell in dgAppts.Rows[rowToPrint].Cells) 109 { 110 g.DrawString(cell.Value.ToString(), Serif12, Brushes.Black, startDrawRectangle); 111 startDrawRectangle.X += widthPerColumn; 112 } 113 114 startDrawRectangle.Y += Serif12Height; 115 116 } 62 117 } 63 118 64 119 private void btnPrint_Click(object sender, EventArgs e) 65 120 { 121 rowToPrint = 0; //reset row to print 66 122 DialogResult res = printDialog1.ShowDialog(); 67 123 if (res == DialogResult.OK) this.printDialog1.Document.Print(); 68 124 } 69 125 126 private void PrintPtAppts_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e) 127 { 128 e.PageSettings.Landscape = true; 129 } 130 70 131 } 71 132 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/UCPatientAppts.resx
r753 r755 121 121 <value>412, 17</value> 122 122 </metadata> 123 <metadata name="patientApptsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">124 <value>412, 17</value>125 </metadata>126 123 <metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 127 124 <value>179, 17</value> 128 </metadata>129 <metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">130 <value>179, 17</value>131 </metadata>132 <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">133 <value>17, 17</value>134 125 </metadata> 135 126 <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> -
Scheduling/trunk/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.XML
r753 r755 664 664 <member name="M:IndianHealthService.ClinicalScheduling.UCPatientAppts.#ctor(IndianHealthService.ClinicalScheduling.CGDocumentManager,System.Int32)"> 665 665 <summary> 666 Ctor 666 Ctor - Creates control and populates data into datagridview 667 667 </summary> 668 668 <param name="docManager">Document Manager from main context</param>
Note:
See TracChangeset
for help on using the changeset viewer.