public void registerNewPatient() { DateTime now = DateTime.Now; _patient = new Patient(Name, Surname, Gender, DateOfBirth, Convert.ToInt32(MobileNumber), Email, now); _receptionist = new Receptionist(); try { _receptionist.registerNewPatient(_patient); _medicalCard = new MedicalCard(_patient.getPatientIDFromDb()); _receptionist.createMedicalCard(_medicalCard); _receptionist.updatePatientMedicalCard(_patient, _medicalCard); CloseAction.Invoke(); } catch (MySqlException ex) { ErrorMessage = "Problem with writing data(MySQLException)"; } }
public void createMedicalCard(MedicalCard medicalCardObj) { String query = String.Format("INSERT INTO Medical_cards (patientID) VALUES('{0}')", medicalCardObj.patientID); _database.executeQuery(query); }
public void printMedicalCardCopy(MedicalCard medCard) { }
public void updatePatientMedicalCard(Patient patient, MedicalCard medicalCardObj) { String query = String.Format("UPDATE Patients SET medicalCardID={0} WHERE patientID={1}", medicalCardObj.getMedicalCardIDFromDb(), patient.getPatientIDFromDb()); _database.executeQuery(query); }