Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
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);
     }
 }
Exemplo n.º 6
0
 public NewAppointment(AppointmentModel data)
 {
     this.InitializeComponent();
     appCtrl.selectedDate = data.selectedDate;
 }