Changeset 1111 for Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
- Timestamp:
- Mar 23, 2011, 5:15:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
r1110 r1111 1264 1264 1265 1265 CGAppointment a = (CGAppointment) this.Appointments.AppointmentTable[apptID]; 1266 1267 PrintDocument pd = new PrintDocument() { DocumentName = "Appointment Slip for Appt " + apptID }; //Autoinit for DocName 1268 pd.PrintPage += (s, pe) => //son of a lambda 1269 { 1270 CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(a, pe); 1271 }; 1272 1273 pd.Print(); 1266 1267 PrintAppointmentSlip(a); 1274 1268 } 1275 1269 //end new code … … 1930 1924 private void AppointmentCheckIn() 1931 1925 { 1932 1933 1926 int nApptID = this.calendarGrid1.SelectedAppointment; 1934 1927 Debug.Assert(nApptID != 0); … … 1950 1943 return; 1951 1944 } 1952 //Find the default provider for the resource & load into combo box1953 DataView rv = new DataView(this.m_DocManager.GlobalDataSet.Tables["Resources"]);1954 rv.Sort="RESOURCE_NAME ASC";1955 int nFind = rv.Find((string) a.Resource);1956 DataRowView drv = rv[nFind];1957 1958 string sHospLoc = drv["HOSPITAL_LOCATION_ID"].ToString();1959 sHospLoc = (sHospLoc == "")?"0":sHospLoc;1960 int nHospLoc = 0;1961 try1962 {1963 nHospLoc = Convert.ToInt32(sHospLoc);1964 }1965 catch(Exception ex)1966 {1967 Debug.Write("CGView.AppointmentCheckIn Error: " + ex.Message);1968 }1969 1970 string sProv = "";1971 1972 if (nHospLoc > 0)1973 {1974 DataRow dr = drv.Row;1975 DataRow drHL = dr.GetParentRow(m_DocManager.GlobalDataSet.Relations["HospitalLocationResource"]);1976 sProv = drHL["DEFAULT_PROVIDER"].ToString();1977 }1978 1945 1979 1946 DCheckIn dlgCheckin = new DCheckIn(); 1980 dlgCheckin.InitializePage(a , this.m_DocManager, sProv, nHospLoc);1947 dlgCheckin.InitializePage(a); 1981 1948 calendarGrid1.CGToolTip.Active = false; 1982 1949 if (dlgCheckin.ShowDialog(this) != DialogResult.OK) … … 1992 1959 DateTime dtCheckIn = dlgCheckin.CheckInTime; 1993 1960 1994 //Save to Database 1961 //Tell appointment that it is checked in, for proper coloring; 1962 //When you refresh from the DB, it will have this property. 1963 a.CheckInTime = DateTime.Now; 1964 1965 //Save to Database 1995 1966 this.Document.CheckInAppointment(nApptID, dtCheckIn); 1996 1967 1997 // Tell appointment that it is checked in1998 a. CheckInTime = DateTime.Now;1999 2000 // smh new code1968 //Get Provider (XXXXXXXX: NOT SAVED TO THE DATABASE RIGHT NOW) 1969 a.Provider = dlgCheckin.Provider; 1970 1971 // Print Routing Slip if user checks that box... 2001 1972 if (dlgCheckin.PrintRouteSlip) 2002 // this.printRoutingSlip.Print(); 2003 // end new code 1973 this.PrintRoutingSlip(a); 2004 1974 2005 1975 //redraw grid … … 2218 2188 this.Document.CreateAppointment(appt); 2219 2189 2220 //Experimental now.2190 2221 2191 if (dAppt.PrintAppointmentSlip) 2222 2192 { 2223 System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument(); 2224 pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(appt, e); 2225 pd.Print(); 2193 PrintAppointmentSlip(appt); 2226 2194 } 2227 2195 … … 3247 3215 } 3248 3216 3249 private void printRoutingSlip_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)3217 private void PrintRoutingSlip(CGAppointment appt) 3250 3218 { 3251 int nApptID = this.calendarGrid1.SelectedAppointment; 3252 CGAppointment a = (CGAppointment)this.Appointments.AppointmentTable[nApptID]; 3253 CGDocumentManager.Current.PrintingObject.PrintRoutingSlip(a, "Routing Slip", e); 3219 PrintDocument pd = new PrintDocument() { DocumentName = "Routing Slip for Appt " + appt.AppointmentKey }; 3220 pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintRoutingSlip(appt, "Routing Slip", e); 3221 pd.Print(); 3222 } 3223 3224 private void PrintAppointmentSlip(CGAppointment appt) 3225 { 3226 PrintDocument pd = new PrintDocument() { DocumentName = "Appointment Slip for Appt " + appt.AppointmentKey }; //Autoinit for DocName 3227 pd.PrintPage += (object s, System.Drawing.Printing.PrintPageEventArgs e) => CGDocumentManager.Current.PrintingObject.PrintAppointmentSlip(appt, e); 3228 pd.Print(); 3254 3229 } 3255 3230 … … 3311 3286 #endregion events 3312 3287 3288 /// <summary> 3289 /// Refresh grid if needed. 3290 /// </summary> 3313 3291 void RequestRefreshGrid() 3314 3292 {
Note:
See TracChangeset
for help on using the changeset viewer.