Ignore:
Timestamp:
Mar 23, 2011, 5:15:51 AM (13 years ago)
Author:
Sam Habiel
Message:

CGAppointment: Added Provider as a Member of Class. (auto property)
CGDocument: No changes
CGDocumentManager: Added UserPreferences as a member of a Class (private and property)
CGView: Changes to support printing of Routing Slip
DAppointPage: Changes to support UserPreferences member for auto printing the routing slips
DCheckIn: Extensive changes in load code (now uses LINQ instead of ADO.net). Changes to support UserPreferences member for auto printing the routing slips.
Patient: Documentation for UserFriendlyAge.
Provider: New class to represent Provider
UserPreferences: New class to represent User preferences. Does not interact with DB right now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs

    r1110 r1111  
    12641264
    12651265            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);
    12741268        }
    12751269        //end new code
     
    19301924                private void AppointmentCheckIn()
    19311925                {
    1932                        
    19331926                        int nApptID = this.calendarGrid1.SelectedAppointment;
    19341927                        Debug.Assert(nApptID != 0);
     
    19501943                                        return;
    19511944                                }
    1952                                 //Find the default provider for the resource & load into combo box
    1953                                 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                                 try
    1962                                 {
    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                                 }
    19781945
    19791946                                DCheckIn dlgCheckin = new DCheckIn();
    1980                                 dlgCheckin.InitializePage(a, this.m_DocManager, sProv, nHospLoc);
     1947                                dlgCheckin.InitializePage(a);
    19811948                                calendarGrid1.CGToolTip.Active = false;
    19821949                                if (dlgCheckin.ShowDialog(this) != DialogResult.OK)
     
    19921959                                DateTime dtCheckIn = dlgCheckin.CheckInTime;
    19931960
    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
    19951966                this.Document.CheckInAppointment(nApptID, dtCheckIn);
    19961967
    1997                 //Tell appointment that it is checked in
    1998                 a.CheckInTime = DateTime.Now;
    1999 
    2000                 //smh new code
     1968                //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...
    20011972                if (dlgCheckin.PrintRouteSlip)
    2002                  //   this.printRoutingSlip.Print();
    2003                 // end new code
     1973                    this.PrintRoutingSlip(a);
    20041974
    20051975                //redraw grid
     
    22182188                                this.Document.CreateAppointment(appt);
    22192189
    2220                 //Experimental now.
     2190               
    22212191                if (dAppt.PrintAppointmentSlip)
    22222192                {
    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);
    22262194                }
    22272195
     
    32473215        }
    32483216
    3249         private void printRoutingSlip_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
     3217        private void PrintRoutingSlip(CGAppointment appt)
    32503218        {
    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();
    32543229        }
    32553230
     
    33113286        #endregion events
    33123287
     3288        /// <summary>
     3289        /// Refresh grid if needed.
     3290        /// </summary>
    33133291        void RequestRefreshGrid()
    33143292        {
Note: See TracChangeset for help on using the changeset viewer.