示例#1
0
        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";
            //}
        }
示例#3
0
 public void addCase(Case caseObj)
 {
     this.cases.Add(caseObj);
 }
示例#4
0
 public void removeCase(Case caseObj)
 {
     String query = String.Format("DELETE FROM Cases WHERE case_id={0}", caseObj.caseID);
     _database.executeQuery(query);
 }
示例#5
0
 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();
 }
示例#6
0
 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);
 }