context: using System;
  using System.Drawing;
  using System.Drawing.Printing;
  using System.Collections;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Windows.Forms;
  using OpenDentBusiness;
  using OpenDental.UI;
  
  namespace OpenDental{
  	/// <summary>The Next appoinment tracking tool.</summary>
  	public class FormTrackNext : System.Windows.Forms.Form{
  		private OpenDental.UI.Button butClose;
  		private List<Appointment> AptList;
  		private OpenDental.UI.ODGrid gridMain;
  		private ComboBox comboProv;
  		private Label label4;
  		private OpenDental.UI.Button butRefresh;
  		private ComboBox comboOrder;
  		private Label label1;
  		private OpenDental.UI.Button butPrint;
  		private int pagesPrinted;
  		private bool headingPrinted;
  		private PrintDocument pd;
  		private ComboBox comboSite;
  		private Label labelSite;
  		private int headingPrintH;
  		private ComboBox comboClinic;
  		private Label labelClinic;
  		private Dictionary<long,string> patientNames;
  		private List<Clinic> _listUserClinics;
  		private IContainer components;
  		private ContextMenuStrip menuRightClick;
  		public PatientSelectedEventHandler PatientGoTo;
  
  		///<summary>PatientGoTo must be set before calling Show() or ShowDialog().</summary>
  		public FormTrackNext(){
  			InitializeComponent();// Required for Windows Form Designer support
  			Lan.F(this);
  		}
  
  		/// <summary>
  		/// Clean up any resources being used.
  		/// </summary>
  		protected override void Dispose( bool disposing )
  		{
  			if( disposing )
  			{
  				if(components != null)
  				{
  					components.Dispose();
  				}
  			}
  			base.Dispose( disposing );
  		}
  
  		#region Windows Form Designer generated code
  		/// <summary>
  		/// Required method for Designer support - do not modify
  		/// the contents of this method with the code editor.
  		/// </summary>
  		private void InitializeComponent()
  		{
  			this.components = new System.ComponentModel.Container();
  			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormTrackNext));
  			this.butClose = new OpenDental.UI.Button();
  			this.gridMain = new OpenDental.UI.ODGrid();
  			this.comboProv = new System.Windows.Forms.ComboBox();
  			this.label4 = new System.Windows.Forms.Label();
  			this.butRefresh = new OpenDental.UI.Button();
  			this.comboOrder = new System.Windows.Forms.ComboBox();
  			this.label1 = new System.Windows.Forms.Label();
  			this.butPrint = new OpenDental.UI.Button();
  			this.comboSite = new System.Windows.Forms.ComboBox();
  			this.labelSite = new System.Windows.Forms.Label();
  			this.comboClinic = new System.Windows.Forms.ComboBox();
  			this.labelClinic = new System.Windows.Forms.Label();
  			this.menuRightClick = new System.Windows.Forms.ContextMenuStrip(this.components);
  			this.SuspendLayout();
  			// 
  			// butClose
  			// 
  			this.butClose.AdjustImageLocation = new System.Drawing.Point(0, 0);
  			this.butClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  			this.butClose.Autosize = true;
  			this.butClose.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle;
  			this.butClose.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver;
  			this.butClose.CornerRadius = 4F;
  			this.butClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  			this.butClose.Location = new System.Drawing.Point(755, 600);
  			this.butClose.Name = "butClose";
  			this.butClose.Size = new System.Drawing.Size(87, 24);
  			this.butClose.TabIndex = 0;
  			this.butClose.Text = "&Close";
  			this.butClose.Click += new System.EventHandler(this.butClose_Click);
  			// 
  			// gridMain
  			// 
  			this.gridMain.HScrollVisible = false;
  			this.gridMain.Location = new System.Drawing.Point(12, 53);
  			this.gridMain.Name = "gridMain";
  			this.gridMain.ScrollValue = 0;
  			this.gridMain.Size = new System.Drawing.Size(734, 571);
  			this.gridMain.TabIndex = 2;
  			this.gridMain.Title = "Planned Appointments";
  			this.gridMain.TranslationName = "FormTrackNext";
  			this.gridMain.CellDoubleClick += new OpenDental.UI.ODGridClickEventHandler(this.gridMain_CellDoubleClick);
  			this.gridMain.MouseUp += new System.Windows.Forms.MouseEventHandler(this.grid_MouseUp);
  			// 
  			// comboProv
  			// 
  			this.comboProv.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  			this.comboProv.Location = new System.Drawing.Point(336, 5);
  			this.comboProv.MaxDropDownItems = 40;
  			this.comboProv.Name = "comboProv";
  			this.comboProv.Size = new System.Drawing.Size(181, 21);
  			this.comboProv.TabIndex = 26;
  			// 
  			// label4
  			// 
  			this.label4.Location = new System.Drawing.Point(244, 9);
  			this.label4.Name = "label4";
  			this.label4.Size = new System.Drawing.Size(91, 14);
  			this.label4.TabIndex = 25;
  			this.label4.Text = "Provider";
  			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  			// 
  			// butRefresh
  			// 
  			this.butRefresh.AdjustImageLocation = new System.Drawing.Point(0, 0);
  			this.butRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  			this.butRefresh.Autosize = true;
  			this.butRefresh.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle;
  			this.butRefresh.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver;
  			this.butRefresh.CornerRadius = 4F;
  			this.butRefresh.Location = new System.Drawing.Point(755, 5);
  			this.butRefresh.Name = "butRefresh";
  			this.butRefresh.Size = new System.Drawing.Size(87, 24);
  			this.butRefresh.TabIndex = 24;
  			this.butRefresh.Text = "&Refresh";
  			this.butRefresh.Click += new System.EventHandler(this.butRefresh_Click);
  			// 
  			// comboOrder
  			// 
  			this.comboOrder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  			this.comboOrder.Location = new System.Drawing.Point(104, 5);
  			this.comboOrder.MaxDropDownItems = 40;
  			this.comboOrder.Name = "comboOrder";
  			this.comboOrder.Size = new System.Drawing.Size(133, 21);
  			this.comboOrder.TabIndex = 30;
  			// 
  			// label1
  			// 
  			this.label1.Location = new System.Drawing.Point(11, 9);
  			this.label1.Name = "label1";
  			this.label1.Size = new System.Drawing.Size(91, 14);
  			this.label1.TabIndex = 29;
  			this.label1.Text = "Order by";
  			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  			// 
  			// butPrint
  			// 
  			this.butPrint.AdjustImageLocation = new System.Drawing.Point(0, 0);
  			this.butPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  			this.butPrint.Autosize = true;
  			this.butPrint.BtnShape = OpenDental.UI.enumType.BtnShape.Rectangle;
  			this.butPrint.BtnStyle = OpenDental.UI.enumType.XPStyle.Silver;
  			this.butPrint.CornerRadius = 4F;
  			this.butPrint.Image = global::OpenDental.Properties.Resources.butPrintSmall;
  			this.butPrint.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
  			this.butPrint.Location = new System.Drawing.Point(755, 552);
  			this.butPrint.Name = "butPrint";
  			this.butPrint.Size = new System.Drawing.Size(87, 24);
  			this.butPrint.TabIndex = 31;
  			this.butPrint.Text = "Print List";
  			this.butPrint.Click += new System.EventHandler(this.butPrint_Click);
  			// 
  			// comboSite
  			// 
  			this.comboSite.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  			this.comboSite.Location = new System.Drawing.Point(613, 29);
  			this.comboSite.MaxDropDownItems = 40;
  			this.comboSite.Name = "comboSite";
  			this.comboSite.Size = new System.Drawing.Size(133, 21);
  			this.comboSite.TabIndex = 33;
  			// 
  			// labelSite
  			// 
  			this.labelSite.Location = new System.Drawing.Point(520, 31);
  			this.labelSite.Name = "labelSite";
  			this.labelSite.Size = new System.Drawing.Size(91, 14);
  			this.labelSite.TabIndex = 32;
  			this.labelSite.Text = "Site";
  			this.labelSite.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  			// 
  			// comboClinic
  			// 
  			this.comboClinic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  			this.comboClinic.Location = new System.Drawing.Point(613, 5);
  			this.comboClinic.MaxDropDownItems = 40;
  			this.comboClinic.Name = "comboClinic";
  			this.comboClinic.Size = new System.Drawing.Size(133, 21);
  			this.comboClinic.TabIndex = 35;
  			// 
  			// labelClinic
  			// 
  			this.labelClinic.Location = new System.Drawing.Point(520, 9);
  			this.labelClinic.Name = "labelClinic";
  			this.labelClinic.Size = new System.Drawing.Size(91, 14);
  			this.labelClinic.TabIndex = 34;
  			this.labelClinic.Text = "Clinic";
  			this.labelClinic.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
  			// 
  			// menuRightClick
  			// 
  			this.menuRightClick.Name = "menuRightClick";
  			this.menuRightClick.Size = new System.Drawing.Size(61, 4);
  			// 
  			// FormTrackNext
  			// 
  			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  			this.CancelButton = this.butClose;
  			this.ClientSize = new System.Drawing.Size(852, 640);
  			this.Controls.Add(this.comboClinic);
  			this.Controls.Add(this.labelClinic);
  			this.Controls.Add(this.comboSite);
  			this.Controls.Add(this.labelSite);
  			this.Controls.Add(this.butPrint);
  			this.Controls.Add(this.comboOrder);
  			this.Controls.Add(this.label1);
  			this.Controls.Add(this.comboProv);
  			this.Controls.Add(this.label4);
  			this.Controls.Add(this.butRefresh);
  			this.Controls.Add(this.gridMain);
  			this.Controls.Add(this.butClose);
  			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  			this.MaximizeBox = false;
  			this.Name = "FormTrackNext";
  			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  			this.Text = "Track Planned Appointments";
  
gt: 			this.Load += new System.EventHandler(this.FormTrackNext_Load);