Inheritance diagram for AppointmentList:
Public Member Functions | |
AppointmentList (String prefix, Form form) | |
void | loadValues () |
void | deleteAppointment (int id) |
void | display (boolean hidden) |
Public Attributes | |
ActionButton | action |
AppointmentEditor | editor |
int | appointment_id = 0 |
Static Public Attributes | |
static final int | EDIT = 1 |
static final int | DELETE = 2 |
Definition at line 3 of file AppointmentList.java.
|
Definition at line 12 of file AppointmentList.java. References action, Widget::addChild(), and Widget::n(). 00013 { 00014 super(prefix, form); 00015 action = new ActionButton(n("action"), form); 00016 addChild(action); 00017 }
|
|
Definition at line 59 of file AppointmentList.java. References Query::close(), Form::connectDb(), Query::execute(), Widget::form, and Form::pw. 00060 { 00061 Query q = new Query(form.connectDb(), form.pw); 00062 try 00063 { 00064 String where = " WHERE appointment_id = " + id + ";\n"; 00065 q.execute( 00066 "DELETE FROM appointment_services" + where + 00067 "DELETE FROM diagnoses" + where + 00068 "DELETE FROM referrals" + where + 00069 "DELETE FROM appointments" + where 00070 ); 00071 } 00072 finally 00073 { 00074 q.close(); 00075 } 00076 }
|
|
Reimplemented from Widget. Definition at line 78 of file AppointmentList.java. References action, appointment_id, Query::close(), Form::connectDb(), DELETE, ActionButton::display(), EDIT, Widget::form, Widget::modalChild, Widget::p(), Widget::printAttribute(), Form::pw, Query::query(), and Query::r. 00079 { 00080 super.display(hidden); 00081 00082 printAttribute("appointment_id", "" + appointment_id); 00083 00084 if (hidden || modalChild != null) return; 00085 00086 p("<p align=center>"); 00087 action.display("Create new appointment...", EDIT, -1); 00088 p("</p>"); 00089 00090 Query q = new Query(form.connectDb(), form.pw); 00091 try 00092 { 00093 q.query("\n"+ 00094 " SELECT to_char(a.begintime, 'DD Mon YYYY HH:MI AM'), \n"+ 00095 " to_char(a.endtime, 'DD Mon YYYY HH:MI AM'), d.name, p.name,\n"+ 00096 " a.appointment_id\n"+ 00097 " FROM appointments AS a\n"+ 00098 " INNER JOIN doctors AS d USING (doctor_id)\n"+ 00099 " INNER JOIN patients AS p USING (patient_id)\n"+ 00100 " ORDER BY a.begintime, a.endtime\n"+ 00101 " "); 00102 00103 if (q.r != null) 00104 { 00105 p("<table border=1>\n"); 00106 p("<tr><td>Begin Time</td><td>End Time</td><td>Patient</td><td>Doctor</td><td> </td></tr>\n"); 00107 while(q.r.next()) 00108 { 00109 p("<tr><td>" + q.r.getString(1) + "</td><td>" + q.r.getString(2) 00110 + "</td><td>" + q.r.getString(3) + "</td><td>" + q.r.getString(4) 00111 + "</td><td>"); 00112 00113 int id = q.r.getInt(5); 00114 00115 action.display("Edit", EDIT, id); 00116 action.display("Delete", DELETE, id); 00117 00118 p("</td></tr>\n"); 00119 } 00120 p("</table>\n"); 00121 } 00122 } 00123 catch(SQLException e) 00124 { 00125 p(e); 00126 } 00127 finally 00128 { 00129 q.close(); 00130 } 00131 }
|
|
Reimplemented from Widget. Definition at line 19 of file AppointmentList.java. References ActionButton::action, action, Widget::addChild(), appointment_id, DELETE, deleteAppointment(), AppointmentEditor::done, EDIT, editor, Widget::form, Widget::loadAttribute(), AppointmentEditor::loadDefaults(), AppointmentEditor::loadValues(), Widget::modal, Widget::modalChild, Widget::n(), ActionButton::param, and Widget::toInt(). 00020 { 00021 super.loadValues(); 00022 00023 int a = toInt(loadAttribute("appointment_id"),0); 00024 boolean editing = a != 0; 00025 00026 for(;;) 00027 if (editing) 00028 { 00029 if (a != 0) appointment_id = a; 00030 editor = new AppointmentEditor(appointment_id, n("editor"), form); 00031 addChild(editor); 00032 if (a != 0) editor.loadValues(); else editor.loadDefaults(); 00033 if (editor.done) 00034 appointment_id = 0; 00035 else 00036 { 00037 modalChild = editor; 00038 editor.modal = true; 00039 } 00040 return; 00041 } 00042 else 00043 { 00044 switch (action.action) 00045 { 00046 case EDIT: 00047 editing = true; 00048 appointment_id = action.param; 00049 break; 00050 case DELETE: 00051 deleteAppointment(action.param); 00052 return; 00053 default: 00054 return; 00055 } 00056 } 00057 }
|
|
Definition at line 5 of file AppointmentList.java. |
|
Definition at line 7 of file AppointmentList.java. |
|
Definition at line 10 of file AppointmentList.java. |
|
Definition at line 9 of file AppointmentList.java. |
|
Definition at line 6 of file AppointmentList.java. |