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()); }