Exemplo n.º 1
0
        public ActionResult EditSpecialties(int id)
        {
            var doctor    = _doctorRepository.Get(id);
            var viewModel = new DoctorSpecialtiesViewModel()
            {
                DoctorId    = doctor.Id,
                FullName    = doctor.FullName,
                Specialties = doctor.Specialties
            };

            // Extend the Specialties to a total of 6 for data entry
            while (viewModel.Specialties.Count < 6)
            {
                viewModel.Specialties.Add(new DoctorSpecialty());
            }

            if (Session["SpecialtyItems"] == null)
            {
                var items = _specialtyRepository.Search("")
                            .Select(s => new
                {
                    Text  = s.SpecialtyName,
                    Value = s.Id
                })
                            .ToList();
                Session["SpecialtyItems"] = items;
            }
            ViewBag.SpecialtyItems = Session["SpecialtyItems"];

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public ActionResult Edit(string item)
        {
            var itemList = new List <LookupCode>();

            switch (item.ToUpper())
            {
            case "SPEC":
                ViewBag.Title      = "Specialties";
                ViewBag.ItemName   = "Specialty";
                ViewBag.Icon       = "fa-stethoscope";
                ViewBag.Controller = "specialties";
                itemList           = _specialtyRepository.Search("*").Select(i => new LookupCode
                {
                    Id             = i.Id,
                    Description    = i.SpecialtyName,
                    AdditionalText = i.NumberOfDoctors.ToString()
                }).ToList();
                break;

            case "DIAG":
                ViewBag.Title      = "Diagnoses";
                ViewBag.ItemName   = "Diagnosis";
                ViewBag.Icon       = "fa-list";
                ViewBag.Controller = "diagnosis";
                itemList           = _diagnosisController.Search("").Select(i => new LookupCode
                {
                    Id             = i.Id,
                    Description    = i.DiagnosisName,
                    AdditionalText = i.NumberInUse.ToString()
                }).ToList();
                break;

            case "DEPT":
                ViewBag.Title      = "Departments";
                ViewBag.ItemName   = "Department";
                ViewBag.Icon       = "fa-list";
                ViewBag.Controller = "departments";
                itemList           = _departmentsRepository.Search("").Select(i => new LookupCode
                {
                    Id             = i.Id,
                    Description    = i.DepartmentName,
                    AdditionalText = i.NumberInUse.ToString()
                }).ToList();
                break;
            }

            return(View(itemList));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Home page search for Specialties.  Accessed by the Search box or clicking a Rolodex button
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public PartialViewResult Search(string search)
        {
            var model = _specialtyRepository.Search(search);

            return(PartialView(model));
        }