internal override async Task Action() { // = new IHospitalCallback(); //hospitals = new List<Hospital>(); IHospitalList HospitalList = new HospitalListDAO(); try { System.Diagnostics.Debug.WriteLine("In use case"); await HospitalList.GetHospitalByNameAsync(name, location, this); //System.Diagnostics.Debug.WriteLine("hosp val="+hospital.Number_Of_Rating); } catch (Exception e) { //System.Diagnostics.Debug.WriteLine(Windows.Storage.ApplicationData.Current.LocalFolder.Path); System.Diagnostics.Debug.WriteLine("Get Hospital by name use case DB EXCEPTION" + e.Message); } if (hospital != null) { useCaseCallback.DataReadSuccess(hospital); //System.Diagnostics.Debug.WriteLine(hospital.Location); } else { useCaseCallback.DataReadFail(); } // + hospitals.Count()); }
internal override async Task Action() { // = new IHospitalCallback(); //hospitals = new List<Hospital>(); this.hospitals = new List <Hospital>(); IHospitalList HospitalList = new HospitalListDAO(); try { System.Diagnostics.Debug.WriteLine("In use case"); await HospitalList.GetHospitalsAsync(this); System.Diagnostics.Debug.WriteLine(hospitals.Count()); } catch (Exception e) { //System.Diagnostics.Debug.WriteLine(Windows.Storage.ApplicationData.Current.LocalFolder.Path); System.Diagnostics.Debug.WriteLine("Get hospital list DB EXCEPTION" + e.Message); } if (hospitals != null && hospitals.Count > 0) { useCaseCallback.DataReadSuccess(hospitals); } else { useCaseCallback.DataReadFail(); } // + hospitals.Count()); }
internal override async Task Action() { IDoctorList DoctorList = new DoctorListDAO(); try { System.Diagnostics.Debug.WriteLine("In use case"); await DoctorList.GetDoctorByNameAsync(name, location, this); } catch (Exception e) { //System.Diagnostics.Debug.WriteLine(Windows.Storage.ApplicationData.Current.LocalFolder.Path); System.Diagnostics.Debug.WriteLine("get doctor by name use case DB EXCEPTION" + e.Message); } if (data.doctors != null && data.doctors.Count > 0) { System.Diagnostics.Debug.WriteLine("get doctor by name use case success"); viewCallback.SearchReadSuccess(data); } else { viewCallback.SearchReadFail(); System.Diagnostics.Debug.WriteLine("get doctor by name use case fail"); } IHospitalList HospitalList = new HospitalListDAO(); try { System.Diagnostics.Debug.WriteLine("In use case"); await HospitalList.GetHospitalByNameAsync(name, location, this); //System.Diagnostics.Debug.WriteLine("hosp val="+hospital.Number_Of_Rating); } catch (Exception e) { //System.Diagnostics.Debug.WriteLine(Windows.Storage.ApplicationData.Current.LocalFolder.Path); System.Diagnostics.Debug.WriteLine("Get Hospital by name use case DB EXCEPTION" + e.Message); } if (data.hospitals != null && data.hospitals.Count > 0) { viewCallback.SearchReadSuccess(data); //System.Diagnostics.Debug.WriteLine(hospital.Location); } else { viewCallback.SearchReadFail(); } // + hospitals.Count()); }
internal override async Task Action() { IHospitalList hospitalList = new HospitalListDAO(); await hospitalList.GetHospitalbyIdAsync(id, this); if (hosp != null) { callback.DataReadSuccess(hosp); } else { callback.DataReadFail(); } }
internal override async Task Action() { IHospitalList hospitalList = new HospitalListDAO(); await hospitalList.GetLastHospital(p_id, doc_id, this); if (h != null) { viewCallback.LastHospitalViewSuccess(h); } else { viewCallback.LastHospitalViewFail(); } }
internal override async Task Action() { IHospitalList hospitalList = new HospitalListDAO(); await hospitalList.UpdateHospitalRating(id, rating, this); if (hospital != null) { viewCallBack.HospitalUpdateSuccess(hospital); } else { viewCallBack.HospitalUpdateFail(); } }
internal override async Task Action() { IHospitalList hospitalList = new HospitalListDAO(); await hospitalList.GetHospitalByDept(location, dept_id, this); if (hosps != null) { viewCallback.ReadViewSuccess(hosps); } else { viewCallback.ReadViewFail(); } ; }