public ScheduleAppointmentWindowViewModel(CaseViewModel caseVM)
 {
     this._caseViewModel = caseVM;
     this._database = new Database();
     this._doctorsVM = new DoctorsViewModel();
     this._allDoctors = _doctorsVM.AllDoctors;
     _patientName = caseVM.PatientName + " " + caseVM.PatientSurname;
     _receptionist = new Receptionist();
     List<String> appointmentTimes = this.getListOfAppointmentTimes();
     _appointmentTimes = this.createObservableCollectionOfAppointmentTimes(appointmentTimes);
 }
 public void CloseCase(CaseViewModel caseVM)
 {
     //try
     //{
     this._receptionist.closePatientCase(caseVM.CaseObj, DateTime.Now);
     caseVM.EndDate = DateTime.Now;
     //}
     //catch (MySql.Data.MySqlClient.MySqlException)
     //{
     // FilterMessage = "Problem with SQL query";
     //}
 }
 public void RemoveCase(CaseViewModel caseVM)
 {
     try
     {
         _receptionist.removeCase(caseVM.CaseObj);
         _cases.Remove(caseVM);
         this.refreshCasesForDisplay();
     }
     catch (MySql.Data.MySqlClient.MySqlException)
     {
         FilterMessage = "Problem with SQL query";
     }
 }
        public bool CloseCaseCanExecute(CaseViewModel caseVM)
        {
            try{
                if (caseVM.EndDate == null)
                {
                    return(true);
                }
            }
            catch (NullReferenceException ex)
            {
            }

            return(false);
        }
 public void RemoveCase(CaseViewModel caseVM)
 {
     try
     {
         _receptionist.removeCase(caseVM.CaseObj);
         _cases.Remove(caseVM);
         this.refreshCasesForDisplay();
     }
     catch (MySql.Data.MySqlClient.MySqlException)
     {
         FilterMessage = "Problem with SQL query";
     }
 }
        public bool CloseCaseCanExecute(CaseViewModel caseVM)
        {
            try{
                if (caseVM.EndDate == null)
                {
                return true;
                }
            }
            catch (NullReferenceException ex)
            {

            }

            return false;
        }
 public void CloseCase(CaseViewModel caseVM)
 {
     //try
     //{
         this._receptionist.closePatientCase(caseVM.CaseObj, DateTime.Now);
         caseVM.EndDate = DateTime.Now;
     //}
     //catch (MySql.Data.MySqlClient.MySqlException)
     //{
        // FilterMessage = "Problem with SQL query";
     //}
 }