예제 #1
0
        internal override async Task Action()
        {
            // = new IHospitalCallback();
            //hospitals = new List<Hospital>();
            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 (doc != null)
            {
                System.Diagnostics.Debug.WriteLine("get doctor by name use case success");

                useCaseCallback.DataReadSuccess(doc);
            }
            else
            {
                useCaseCallback.DataReadFail();
                System.Diagnostics.Debug.WriteLine("get doctor by name use case fail");
            }


            // + hospitals.Count());
        }
예제 #2
0
        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());
        }