Exemple #1
0
        public async Task OnGet(int?pageIndex)
        {
            var tmp = await _context.Doctor.Include(u => u.User).Include(p => p.Picture).AsNoTracking().ToListAsync();

            var docList = new List <DoctorListViewModel>();

            foreach (var item in tmp)
            {
                var dct = new DoctorListViewModel
                {
                    Id             = item.Id,
                    Email          = item.User.Email,
                    FirstName      = item.User.FirstName,
                    LastName       = item.User.LastName,
                    Specialization = item.Specializaiton,
                    Phone          = item.User.PhoneNumber,
                };
                if (item.Picture.ImageData != null)
                {
                    dct.Picture = Convert.ToBase64String(item.Picture.ImageData);
                }
                docList.Add(dct);
            }

            int pageSize = 4;

            doctors = PaginatedList <DoctorListViewModel> .CreateAsync(docList, pageIndex ?? 1, pageSize);
        }
        private String _BasicString = "Doctor"; //a global string needs to be created

        public DoctorListView()
        {
            InitializeComponent();
            // DoctorList.On<Android>().SetIsFastScrollEnable(true);

            BindingContext = viewmodel = new DoctorListViewModel();
        }
        public IActionResult Index()
        {
            var doctors = this.doctorService.GetAll <DoctorViewModel>();
            var model   = new DoctorListViewModel {
                Doctors = doctors
            };

            return(this.View(model));
        }
Exemple #4
0
        private void LoadDoctorScreen(DoctorListViewModel doctorListViewModel)
        {
            var doctorView = new DoctorListView();

            doctorListViewModel.CloseViewAction += () => { doctorView.Close(); };
            doctorView.DataContext = doctorListViewModel;

            doctorView.ShowDialog();
        }
        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));
        }
        public IActionResult List()
        {
            //ViewBag.CurrentCategory = "BestDoctor";
            //return View(_doctorRepository.GetAllDoctor);

            var doctorListViewModel = new DoctorListViewModel();

            doctorListViewModel.Doctors         = _doctorRepository.GetAllDoctor;
            doctorListViewModel.CurrentCategory = "BestDoctor";
            return(View(doctorListViewModel));
        }
Exemple #7
0
        public ActionResult Doctors()
        {
            var doctors     = _context.DoctorDepartments.Include(d => d.DoctorUser).ToList();
            var departments = _context.Departments.ToList();
            var viewModel   = new DoctorListViewModel
            {
                Doctors     = doctors,
                Departments = departments
            };

            return(View(viewModel));
        }
        public ActionResult Index(string sort, string searchByName, string searchByPosition, int?page)
        {
            int pageSize   = 3;
            int pageNumber = (page ?? 1);

            DoctorListViewModel viewModel = new DoctorListViewModel();

            IQueryable <Doctor> doctorsQuery = db.Doctors;

            if (!string.IsNullOrEmpty(searchByName))
            {
                doctorsQuery = doctorsQuery
                               .Where(d => d.FirstName.Contains(searchByName) || d.LastName.Contains(searchByName));
            }
            if (!string.IsNullOrEmpty(searchByPosition))
            {
                doctorsQuery = doctorsQuery.Where(d => d.Position.Contains(searchByPosition));
            }

            switch (sort)
            {
            case "name_desc":
                doctorsQuery = doctorsQuery.OrderByDescending(d => d.LastName).ThenByDescending(d => d.FirstName);
                break;

            case "position":
                doctorsQuery = doctorsQuery.OrderBy(d => d.Position);
                break;

            case "position_desc":
                doctorsQuery = doctorsQuery.OrderByDescending(d => d.Position);
                break;

            default:
                doctorsQuery = doctorsQuery.OrderBy(d => d.LastName).ThenBy(d => d.FirstName);
                break;
            }
            var doctorTranslator = new DoctorTranslator();

            viewModel.Doctors = doctorsQuery
                                .Select(doctorTranslator.ToViewModel)
                                .ToPagedList(pageNumber, pageSize);

            viewModel.CurrentSort    = sort;
            viewModel.SortByName     = string.IsNullOrEmpty(sort) ? "name_desc" : "";
            viewModel.SortByPosition = sort == "position" ? "position_desc" : "position";

            viewModel.NameFilter     = searchByName;
            viewModel.PositionFilter = searchByPosition;

            return(View(viewModel));
        }
        public PartialViewResult EmployeeList(DoctorListViewModel obj)
        {
            MyId = Convert.ToInt32(User.Identity.GetUserId());
            var model = new DoctorListViewModel(10);

            model.paging.CurrentPage = obj.CurrentPage;

            // obj идет в предикат. Параметры в obj получаем из основного вью.
            obj.assignedinsts   = AssignedInstitutionRep.FindBy(i => i.cuser_id == MyId);
            obj.assignedregions = AssignedRegionRep.FindBy(i => i.cuser_id == MyId);

            if (obj.call_state_id == 1)
            {
                obj.call_employeeset = CallEmployeeSetRep.FindBy(i => i.call_template_id == obj.calltemplate_id && (i.is_done == false || i.is_done == null));
            }
            else if (obj.call_state_id == 2)
            {
                obj.call_employeeset = CallEmployeeSetRep.FindBy(i => i.call_template_id == obj.calltemplate_id && i.is_done == true);
            }
            else
            {
                obj.call_employeeset = CallEmployeeSetRep.FindBy(i => i.call_template_id == obj.calltemplate_id);
            }


            obj.AllEmployees = User.IsInRole("admin") || User.IsInRole("DD");
            obj.AllEmployeesInUserCountry = User.IsInRole("HES");
            obj.AssignedRegionsOnly       = User.IsInRole("RM") || User.IsInRole("MP");
            obj.UserCountry = IdentityUserRep.FindBy(i => i.id == MyId).First().Region.country_code;


            // model идет во вью


            model.InstId          = obj.InstId;
            model.ShowInstName    = obj.ShowInstName;
            model.ShowInstAddress = obj.ShowInstAddress;

            model.Doctors = EmployeeRep.FindBy(obj.predicate).OrderBy(i => i.last_name).ThenBy(i => i.first_name);

            ViewBag.SIPServerPath = CurrentVarsRep.GetAll().First().SIPServerPath;

            return(PartialView(model));
        }
        public IActionResult GetDoctors(string specialization)
        {
            IEnumerable <DoctorProfile> doctors = null;
            string doctorSpecialization         = "";

            if (string.IsNullOrEmpty(specialization))
            {
                doctors = _doctors.GetDoctors.OrderBy(i => i.Id);
            }
            else
            {
                doctors = _doctors.GetDoctors.Where(x => x.Specializations.Type.ToLower() == specialization.ToLower());

                doctorSpecialization = specialization;
            }
            var doctorObj = new DoctorListViewModel
            {
                GetDoctors           = doctors,
                DoctorSpecialization = specialization
            };

            ViewBag.Title = "All Doctors";
            return(View(doctorObj));
        }
Exemple #11
0
 public PatientAppointmentController(IUnitOfWork _unitOfWork)
 {
     unitOfWork          = _unitOfWork;
     DoctorListViewModel = new DoctorListViewModel(unitOfWork);
 }
Exemple #12
0
        public ActionResult Search(DoctorListViewModel viewModel)

        {
            return(RedirectToAction("Index", "Doctors", new { @query = viewModel.SearchTerm }));
        }
Exemple #13
0
        public ActionResult Index(string sortOrder, DoctorFilter filter = null, string query = null)
        {
            IEnumerable <Doctor> doctors = doctors = _doctorRepository.GetAllDoctors();

            ViewBag.NameSortParm   = sortOrder == "Name" ? "name_desc" : "Name";
            ViewBag.DegreeSortParm = sortOrder == "Degree" ? "degree_desc" : "Degree";
            ViewBag.IdSortParm     = sortOrder == "Id" ? "id_desc" : "Id";


            if (!String.IsNullOrWhiteSpace(query))
            {
                doctors = doctors.Where(g => g.FullName.Contains(query));
            }

            if (filter.Speciality.HasValue)
            {
                doctors = _doctorRepository.FilterDoctorsBySpeciality(filter.Speciality);
            }

            if (filter.Degree != null)
            {
                doctors = doctors.Where(d => d.Degree == filter.Degree);
            }
            switch (sortOrder)
            {
            case "name_desc":
                doctors = doctors.OrderByDescending(d => d.FullName);
                break;

            case "Name":
                doctors = doctors.OrderBy(d => d.FullName);
                break;

            case "degree_desc":
                doctors = doctors.OrderByDescending(d => d.Degree);
                break;

            case "Degree":
                doctors = doctors.OrderBy(d => d.Degree);;
                break;

            case "id_desc":
                doctors = doctors.OrderByDescending(d => d.DoctorId);
                break;

            case "Id":
                doctors = doctors.OrderBy(d => d.DoctorId);
                break;

            default:
                break;
            }

            var viewModel = new DoctorListViewModel
            {
                Doctors      = doctors,
                Specialities = _specialityRepository.GetSpecialities(),
                Degree       = _doctorRepository.SelectDegrees(),
                SearchTerm   = query
            };

            return(View(viewModel));
        }