public void AddCustomer(Customer customer) { // 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()) { customerDao.InsertCustomer(customer); transaction.Complete(); } }
public void AddPatient(Patient patient) { //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()) { patientDAO.InsertPatient(patient); transaction.Complete(); } }
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 AddStudentAppointment(int PatientID, int DoctorID, DateTime date, string[] strSet, int TimeID) { //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.StudentSchedule(PatientID, DoctorID, date, strSet, TimeID); transaction.Complete(); } }
public void AddDoctor(Doctor doctor) { //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()) { doctorDAO.InsertDoctor(doctor); transaction.Complete(); } apptDAO.calSetup(doctor.DoctorID); }
public int DeleteCustomer(int customerId) { // TODO: add access security here.. // TODO: add argument validation here.. Customer customer = customerDao.GetCustomer(customerId); customer.Orders = orderDao.GetOrders(customer); int rowsAffected = 0; // Business rule: cannot delete Customers that have Orders if (customer.Orders.Count == 0) { // Run within the context of a database transaction // The Decorator Design Pattern. using (TransactionDecorator transaction = new TransactionDecorator()) { rowsAffected = customerDao.DeleteCustomer(customer); transaction.Complete(); } } return rowsAffected; }