示例#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.GetDoctorByIdAsync(id, this);

                System.Diagnostics.Debug.WriteLine("doc val=" + doc.ID);
            }
            catch (Exception e)
            {
                //System.Diagnostics.Debug.WriteLine(Windows.Storage.ApplicationData.Current.LocalFolder.Path);
                System.Diagnostics.Debug.WriteLine(" get doctor list DB EXCEPTION" + e.Message);
            }


            if (doc != null)
            {
                doctorUseCaseCallback.DataReadSuccess(doc);
            }
            else
            {
                doctorUseCaseCallback.DataReadFail();
            }
            // + 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());
        }
示例#3
0
        internal override async Task Action()
        {
            IDoctorList doctorList = new DoctorListDAO();

            try
            {
                await doctorList.GetDoctorByDeptLocationAsync(location.ToUpper(), dept, this, lexp, uexp, rating);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("doc dept usercase exception " + e.Message);
            }
            if (docs != null)
            {
                viewCallback.DeptLocationViewSuccess(docs);
            }
            else
            {
                viewCallback.DeptLocationViewFail();
            }
        }
        internal override async Task Action()
        {
            IDoctorList doctorList = new DoctorListDAO();

            try
            {
                await doctorList.GetMostBookedDoctor(id, this);

                if (doctors != null)
                {
                    viewCallback.MostBookedDocViewSuccess(doctors);
                }
                else
                {
                    viewCallback.MostBookedDocViewFail();
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("most booked doc usecase fail " + e.Message);
            }
        }
        internal override async Task Action()
        {
            IDoctorList doctorList = new DoctorListDAO();

            try
            {
                await doctorList.UpdateDoctorRating(id, rating, this);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("DB UPDATE EXCEPTION" + e.Message);
            }
            if (doctor != null)
            {
                doctorDetailViewCallBack.DoctorUpdateSuccess(doctor);
            }
            else
            {
                doctorDetailViewCallBack.DoctorUpdateFail();
            }
            ;
        }
        internal override async Task Action()
        {
            IDoctorList doctorList = new DoctorListDAO();

            try
            {
                await doctorList.GetRecentDoctor(id, this);

                if (doctors != null)
                {
                    //doctors.Reverse();
                    viewCallback.SearchDocViewSuccess(doctors);
                }

                else
                {
                    viewCallback.SearchDocViewFail();
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
        }