コード例 #1
0
        public async Task <IActionResult> Index(DoctorSearchViewModel viewModel)
        {
            viewModel.Branches = await _doctorService.GetBranches().Select(x => x.Name).ToListAsync();

            viewModel.Specialities = await _doctorService.GetSpecialities().Select(x => x.Name).ToListAsync();

            viewModel.Doctors = await _doctorService.GetDoctors(viewModel.Name, viewModel.Speciality, viewModel.Branch).ToListAsync();

            return(View(viewModel));
        }
コード例 #2
0
        public IActionResult Index(DoctorSearchViewModel viewModel)
        {
            DoctorListViewModel res = new DoctorListViewModel()
            {
                Doctors = _userService.SearchDoctors(viewModel.name1, viewModel.name2, viewModel.name3,
                                                     viewModel.Branch, viewModel.Speciality)
            };

            return(View("Index", res));
        }
コード例 #3
0
        // GET: DoctorSearch
        public ActionResult Index()
        {
            this.SetDepartmentItems();

            // Send Enpty ViewModel
            ViewBag.ddlDepartment = new SelectList(db.Departments.Select(d => new { Id = d.Id, DepartmentName = d.DepartmentName }), "Id", "DepartmentName");
            var model = new DoctorSearchViewModel();

            return(View(model));
        }
コード例 #4
0
        public async Task <IActionResult> Index()
        {
            var vm = new DoctorSearchViewModel();

            vm.Branches = await _doctorService.GetBranches().Select(x => x.Name).ToListAsync();

            vm.Specialities = await _doctorService.GetSpecialities().Select(x => x.Name).ToListAsync();

            vm.Doctors = await _doctorService.GetDoctors().ToListAsync();

            return(View(vm));
        }
コード例 #5
0
        protected override async void OnNavigatedTo(NavigationEventArgs e1)
        {
            viewModel = new DoctorSearchViewModel();
            var args = e1.Parameter as navargs;

            address  = args.name;
            mainPage = args.mp;
            DeptListbox.SelectedIndex = args.index;
            if (args.doc)
            {
                myFrame.Navigate(typeof(DoctorSearchFrame), new DocSendEventArgs()
                {
                    view = this, add = address, mp = mainPage
                },
                                 new SuppressNavigationTransitionInfo());
                ExpStack.Visibility = Visibility.Visible;
            }
            else
            {
                myFrame.Navigate(typeof(HospitalSearchFrame), new DocSendEventArgs()
                {
                    view = this, add = address, mp = mainPage
                },
                                 new SuppressNavigationTransitionInfo());
                ExpStack.Visibility = Visibility.Collapsed;
            }
            //MainTabs.SelectedIndex = 1;
            mainPage.AutoSuggestChanged    += this.onAutoSuggestChanged;
            mainPage.LocationButtonClicked += this.onLocationButtonClicked;
            //viewModel.DoctorsSuccess+=this.onDoctorsSuccess;
            //viewModel.InsertFail += this.onInsertFail;
            //viewModel.InsertSuccess += this.onInsertSuccess;
            //viewModel.AppointmentRead += this.onAppointmentRead;
            //viewModel.DoctorRatingUpdateSuccess += this.onDoctorRatingUpdateSucess;
            //viewModel.TestimonialAddedSuccess += this.onTestAddedSuccess;
            //viewModel.HospitalRatingUpdateSuccess += this.onHospitalUpdateSuccess;
            //viewModel.AppointmentCheckSuccess += this.onAppCheckSuccess;
            OrderCombo.ComboSelectionChanged += this.onComboChanged;
            //await viewModel.GetDepartments();
            //await viewModel.GetDoctorsByDept("Chennai", 0);

            //Bindings.Update();
        }
コード例 #6
0
        protected override async void OnNavigatedTo(NavigationEventArgs e1)
        {
            viewModel = new DoctorSearchViewModel();
            var args = e1.Parameter as DocSendEventArgs;

            view     = args.view;
            address  = args.add;
            mainPage = args.mp;
            mainPage.AutoSuggestChanged    += this.onAutoSuggestChanged;
            mainPage.LocationButtonClicked += this.onLocationButtonClicked;
            view.OrderComboChanged         += this.onComboChanged;
            FilterButton.DeptListChanged   += this.onDeptListChanged;

            FilterButton.RatingChanged += this.onRatingChanged;
            FilterButton.RatingCleared += this.onRatingCleared;
            viewModel.HospsSuccess     += this.onHospsSuccess;
            viewModel.DeptRead         += this.onDeptRead;

            await viewModel.GetDepartments();
        }
コード例 #7
0
        public IActionResult Index(int departmentId, string name)
        {
            ViewBag.Departments = _context.Doctors.Include(d => d.Department).ToList();
            DoctorSearchViewModel model = new DoctorSearchViewModel();

            BannerViewModel bannerView = new BannerViewModel
            {
                Title = "Doctors Search"
            };

            model.BannerViewModel = bannerView;


            if (departmentId != 0)
            {
                model.Doctors = _context.Doctors.Include(d => d.Department).Where(d => d.DepartmentId == departmentId).ToList();

                return(View(model));
            }
            if (departmentId != 0 && name != null)
            {
                model.Doctors = _context.Doctors.Include(d => d.Department)
                                .Where(d => d.DepartmentId == departmentId && d.FullName.ToLower().Contains(name.ToLower())).ToList();

                return(View(model));
            }
            if (name != null)
            {
                model.Doctors = _context.Doctors.Include(d => d.Department).Where(d => d.FullName.ToLower().Contains(name.ToLower())).ToList();

                return(View(model));
            }
            else
            {
                model.Doctors = _context.Doctors.Include(d => d.Department).ToList();

                return(View(model));
            }
        }
コード例 #8
0
        public ActionResult DoctorsTable(string search, int?pageNumber)
        {
            DoctorSearchViewModel model = new DoctorSearchViewModel();

            model.WordToBeSearched = search;

            pageNumber = pageNumber.HasValue ? pageNumber.Value > 0 ? pageNumber.Value : 1 : 1;

            var totalDoctors = DoctorServices.ClassObject.GetDoctorsCounter(search);

            model.Doctors = DoctorServices.ClassObject.GetDoctors(search, pageNumber.Value);

            if (model.Doctors != null)
            {
                model.Pagination = new Pagination(totalDoctors, pageNumber, 10);

                return(PartialView("DoctorsTable", model));
            }
            else
            {
                return(HttpNotFound());
            }
        }
コード例 #9
0
        protected override async void OnNavigatedTo(NavigationEventArgs e1)
        {
            viewModel = new DoctorSearchViewModel();
            var args = e1.Parameter as DocSendEventArgs;

            view     = args.view;
            address  = args.add;
            mainPage = args.mp;
            mainPage.AutoSuggestChanged      += this.onAutoSuggestChanged;
            mainPage.LocationButtonClicked   += this.onLocationButtonClicked;
            OrderCombo.ComboSelectionChanged += this.onComboChanged;
            //view.OrderComboChanged += this.onComboChanged;
            FilterButton.DeptListChanged += this.onDeptListChanged;
            FilterButton.ExpChanged      += this.onExpListChanged;
            FilterButton.ExpCleared      += this.onExpCleared;
            FilterButton.RatingChanged   += this.onRatingChanged;
            FilterButton.RatingCleared   += this.onRatingCleared;
            viewModel.DeptRead           += this.onDeptRead;
            viewModel.DoctorsSuccess     += this.onDoctorsSuccess;
            mySplitView.Focus(FocusState.Programmatic);
            //myListView.SelectedIndex = 0;
            await viewModel.GetDepartments();
        }
コード例 #10
0
        public ActionResult Index([Bind(Include = "Gender, DepartmentId")] DoctorSearchViewModel model, string DepartmentName, string FirstName, string LastName, string Gender, string Language)
        {
            if (ModelState.IsValid)
            {
                int dId = Convert.ToInt32(DepartmentName);

                /*var list = db.doctors_tbl.Where(Id =>
                 *  (string.IsNullOrEmpty(model.gender) || Id.first_name.Contains(model.gender))).ToList();
                 * model.Doctors = list;
                 */
                ViewBag.ddlDepartment = new SelectList(db.Departments.Select(d => new { Id = d.Id, DepartmentName = d.DepartmentName }), "Id", "DepartmentName");

                var list = db.Doctors.Where(item =>
                                            (string.IsNullOrEmpty(FirstName) || item.FirstName.Contains(FirstName)) &&
                                            (string.IsNullOrEmpty(LastName) || item.LastName.Contains(LastName)) &&
                                            (string.IsNullOrEmpty(Gender) || item.Gender.Contains(Gender)) &&
                                            (string.IsNullOrEmpty(Language) || item.Language.Contains(Language)) &&
                                            item.DepartmentId == dId).ToList();
                model.Doctors = list;
            }
            this.SetDepartmentItems();
            return(View(model));
        }
コード例 #11
0
 public IActionResult Search(DoctorSearchViewModel viewModel)
 {
     return(Index(viewModel));
 }