public CaseViewModel(Case obj) { obj.setPatientNameFromDb(); obj.setPatientSurnameFromDb(); this.caseObj = new Case(); CaseID = obj.caseID; PatientID = obj.patientID; StartDate = obj.startDate; EndDate = obj.endDate; Description = obj.description; PatientName = obj.patientName; PatientSurname = obj.patientSurname; }
public void CreateNewCase() { Case caseObj = new Case(_patient.PatientID, Now, Description); // try //{ _receptionist.openNewCase(caseObj, _patient.PatientObj); // } //catch (MySqlException ex) //{ ErrorMessage = "There was a problem with a database"; //} }
public void addCase(Case caseObj) { this.cases.Add(caseObj); }
public void removeCase(Case caseObj) { String query = String.Format("DELETE FROM Cases WHERE case_id={0}", caseObj.caseID); _database.executeQuery(query); }
public void openNewCase(Case caseObj, Patient patient) { String query = String.Format("INSERT INTO Cases (patientID, start_date, description) VALUES('{0}', '{1}', '{2}')", caseObj.patientID, caseObj.startDate.ToString("yyyy-MM-dd HH:mm:ss"), caseObj.description); _database.executeQuery(query); // patient.startTreatment(); }
public void closePatientCase(Case caseObj, DateTime date) { String query = String.Format("UPDATE Cases SET end_date='{0}' WHERE case_id={1}", date.ToString("yyyy-MM-dd HH:mm:ss"), caseObj.getCaseIDFromDb()); this._database.executeQuery(query); }