public DataTable getDateAppointments(AppointmentModel data) { try { cmd = new SqlCommand("usp_LoadDateAppointments"); cmd.Parameters.AddWithValue("@date", data.selectedDate); return(ExecuteReader(cmd)); }catch (Exception err) { message(err.ToString()); return(null); } }
public Boolean deleteAppointment(AppointmentModel data) { try { cmd = new SqlCommand("usp_deleteAppointment"); cmd.Parameters.AddWithValue("@appID", data.appID); return(ExecNonQuery(cmd)); } catch (Exception err) { message(err.ToString()); return(false); } }
public AppointmentUpdateForm(AppointmentModel data) { this.InitializeComponent(); appCtrl.appID = data.appID; appCtrl.appType = data.appType; appCtrl.dateStart = data.dateStart; appCtrl.dateEnd = data.dateEnd; appCtrl.timeStart = data.timeStart; appCtrl.timeEnd = data.timeEnd; appCtrl.appLocation = data.appLocation; appCtrl.appNote = data.appNote; appCtrl.patientName = data.patientName; appCtrl.patientID = data.patientID; }
public int saveNewAppointment(AppointmentModel data) { try { cmd = new SqlCommand("usp_InsertNewAppointment"); cmd.Parameters.AddWithValue("@dateStart", data.dateStart); cmd.Parameters.AddWithValue("@dateEnd", data.dateEnd); cmd.Parameters.AddWithValue("@timeStart", data.timeStart); cmd.Parameters.AddWithValue("@timeEnd", data.timeEnd); cmd.Parameters.AddWithValue("@note", data.appNote); cmd.Parameters.AddWithValue("@location", data.appLocation); cmd.Parameters.AddWithValue("@type", data.appType); cmd.Parameters.AddWithValue("@name", data.patientName); return(ExecuteScalar(cmd)); } catch (Exception err) { message(err.ToString()); return(0); } }
public Boolean updateAppointment(AppointmentModel data) { try { cmd = new SqlCommand("usp_UpdateAppointment"); cmd.Parameters.AddWithValue("@id", data.appID); cmd.Parameters.AddWithValue("@type", data.appType); cmd.Parameters.AddWithValue("@dateStart", data.dateStart); cmd.Parameters.AddWithValue("@dateEnd", data.dateEnd); cmd.Parameters.AddWithValue("@timeStart", data.timeStart); cmd.Parameters.AddWithValue("@timeEnd", data.timeEnd); cmd.Parameters.AddWithValue("@note", data.appNote); cmd.Parameters.AddWithValue("@location", data.appLocation); cmd.Parameters.AddWithValue("@name", data.patientName); //patientName contains patientID or appointment requestor name return(ExecNonQuery(cmd)); } catch (Exception err) { message(err.ToString()); return(false); } }
public NewAppointment(AppointmentModel data) { this.InitializeComponent(); appCtrl.selectedDate = data.selectedDate; }