Changeset 789 for Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs
- Timestamp:
- Jun 6, 2010, 8:59:53 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/Printing.cs
r788 r789 148 148 printArea.Y += 15; 149 149 printArea.Height -= 15; 150 150 151 // write appointment date 152 string str = "Appointment Date: " + ptRow.ApptDate + "\n\n"; 153 g.DrawString(str, fBody, Brushes.Black, printArea); 154 155 // move down 156 int strHeight = (int)g.MeasureString(str, fBody, printArea.Width).Height; 157 printArea.Y += strHeight; 158 printArea.Height -= strHeight; 159 151 160 // write missive 152 161 g.DrawString(letter, fBody, Brushes.Black, printArea); … … 165 174 166 175 /// <summary> 167 /// PrintLetter to be given or mailed to the patient168 /// </summary> 169 /// <param name="pt row">Strongly typed PatientApptsRow to pass (just one ApptRow)</param>176 /// Cancellation Letter to be given or mailed to the patient 177 /// </summary> 178 /// <param name="ptRow">Strongly typed PatientApptsRow to pass (just one ApptRow)</param> 170 179 /// <param name="e">You know what that is</param> 171 180 /// <param name="letter">Contains letter string</param> … … 190 199 printArea.Y += 15; 191 200 printArea.Height -= 15; 201 202 // write appointment date 203 string str = "Appointment Date: " + ptRow.OldApptDate + "\n\n"; 204 g.DrawString(str, fBody, Brushes.Black, printArea); 205 206 // move down 207 int strHeight = (int)g.MeasureString(str, fBody, printArea.Width).Height; 208 printArea.Y += strHeight; 209 printArea.Height -= strHeight; 192 210 193 211 // write missive … … 206 224 } 207 225 226 /// <summary> 227 /// Print rebook letters. Prints old and new appointments dates then the missive. 228 /// </summary> 229 /// <param name="ptRow">Strongly typed appointment row</param> 230 /// <param name="e">etc</param> 231 /// <param name="letter">Text of the letter to print</param> 232 /// <param name="title">Title to print at the top of the letter</param> 233 public static void PrintRebookLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title) 234 { 235 Rectangle printArea = e.MarginBounds; 236 Graphics g = e.Graphics; 237 StringFormat sf = new StringFormat(); 238 sf.Alignment = StringAlignment.Center; //for title 239 Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title 240 Font fBody = new Font(FontFamily.GenericSerif, 12); 241 g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title 242 243 // move down 244 int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height; 245 printArea.Y += titleHeight; 246 printArea.Height -= titleHeight; 247 248 // draw underline 249 g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y)); 250 printArea.Y += 15; 251 printArea.Height -= 15; 252 253 // write old and new appointment dates 254 string str = "Old Appointment Date:\t\t" + ptRow.OldApptDate + "\n"; 255 str += "New Appointment Date:\t\t" + ptRow.NewApptDate + "\n\n"; 256 g.DrawString(str, fBody, Brushes.Black, printArea); 257 258 // move down 259 int strHeight = (int)g.MeasureString(str, fBody, printArea.Width).Height; 260 printArea.Y += strHeight; 261 printArea.Height -= strHeight; 262 263 // write missive 264 g.DrawString(letter, fBody, Brushes.Black, printArea); 265 266 //print Address in lower left corner for windowed envolopes 267 printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66)); 268 printArea.Height = (int)(e.MarginBounds.Height * 0.20); 269 sf.Alignment = StringAlignment.Near; 270 sf.LineAlignment = StringAlignment.Center; 271 StringBuilder address = new StringBuilder(100); 272 address.AppendLine(ptRow.Name); 273 address.AppendLine(ptRow.STREET); 274 address.AppendLine(ptRow.CITY + ", " + ptRow.STATE + " " + ptRow.ZIP); 275 g.DrawString(address.ToString(), fBody, Brushes.Black, printArea, sf); 276 277 } 278 279 /// <summary> 280 /// Print message on a page; typically that there are no appointments to be found. 281 /// </summary> 282 /// <param name="msg">The exact string to print.</param> 283 /// <param name="e">Print Page event args</param> 208 284 public static void PrintMessage(string msg, PrintPageEventArgs e) 209 285 {
Note:
See TracChangeset
for help on using the changeset viewer.