public void UpdateDoctorAppointment(Appointment appt, int dayID) { //string sql = string.Empty; // TODO: add security here.. // TODO: add argument validation here.. // Run within the context of a database transaction. // The Decorator Design Pattern. using (TransactionDecorator transaction = new TransactionDecorator()) { AppointmentDAO.DocSchedule(appt,dayID); transaction.Complete(); } }
public void DocSchedule(Appointment appt,int dayID) { string[] strSet = new string[38] { "AM_0800", "'" + appt.AM8 + "'", "AM_0830", "'" + appt.AM830 + "'", "AM_0900", "'" +appt.AM9 + "'", "AM_0930", "'" +appt.AM930 + "'", "AM_1000", "'" +appt.AM10 + "'", "AM_1030", "'" + appt.AM1030 + "'", "AM_1100", "'" + appt.AM11 + "'", "AM_1130", "'" + appt.AM1130+ "'", "PM_1200", "'" + appt.PM12 + "'", "PM_1230", "'" + appt.PM1230 + "'", "PM_0100", "'" + appt.PM0100 + "'", "PM_0130", "'" + appt.PM0130 + "'", "PM_0200", "'" + appt.PM0200 + "'", "PM_0230", "'" + appt.PM0230 + "'", "PM_0300", "'" + appt.PM0300 + "'", "PM_0330", "'" +appt.PM0330+ "'", "PM_0400", "'" + appt.PM0400 + "'", "PM_0430", "'" + appt.PM0430 + "'", "PM_0500", "'" + appt.PM0500 + "'" }; string[] strWhere = new string[2] { "Day_ID", dayID.ToString() }; Db.UpdateQuery("TDT", strSet, strWhere); }