Beispiel #1
0
        public ActionResult Add()
        {
            var allRegions = _regionRepository.GetAll().Select(a => new SelectListItem
            {
                Text  = a.Name,
                Value = a.Id.ToString()
            }).ToList();

            var allWorkModes = _workModeRepository.GetAll().Select(a => new SelectListItem
            {
                Text  = a.Name,
                Value = a.Id.ToString()
            }).ToList();
            var allClinics = _clinicRepository.GetAll()
                             .Select(a => new SelectListItem
            {
                Text = a.Name, Value = a.Id.ToString()
            }
                                     ).ToList();
            var model = new AddViewModel {
                Clinics = allClinics, Regions = allRegions, WorkdModes = allWorkModes
            };

            if (User.IsInRole(Models.User.DOCTOR_ROLE))
            {
                var doctorId = User.FindFirstValue(ClaimTypes.NameIdentifier);

                var clinicId = _clinicRepository.GetDoctorsClinics(doctorId).FirstOrDefault().Id;

                model.ClinicId = clinicId;
            }
            return(View("Add", model));
        }
        // GET: Appointments
        public IActionResult Index()
        {
            _db.GetAll();

            var appointments = context.Appointments.Include(p => p.Patient).Include(d => d.Doctor).ToList();

            return(View(appointments));
        }
Beispiel #3
0
        // GET: DoctorController/Create
        public ActionResult Add()
        {
            var allClinics = _clinicRepository.GetAll()
                             .Select(a => new SelectListItem
            {
                Text = a.Name, Value = a.Id.ToString()
            }
                                     ).ToList();

            return(View(new AddEditViewModel {
                Clinics = allClinics
            }));
        }
Beispiel #4
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 private void Initialize()
 {
     this.cboClinic.DataSource    = _clinicRepo.GetAll();
     this.cboClinic.SelectedValue = AppContext.CurrentClinic.Id;
     cboDate.Value = DateTime.Today;
     // cboStatus.DataSource = new List<Item>(new Item[] {new Item(2, "Đã phát thuốc")});
 }
Beispiel #5
0
 // GET: AppliedDiagnos/Create
 public IActionResult Create()
 {
     //ViewData["AppointmentId"] = _appdb.GetAll().ToList(); /*new SelectList(_context.Appointments, "Id", "Id");*/
     //ViewData["DiagnosId"] = _diagdb.GetAll().ToList();
     ViewData["AppointmentId"] = new SelectList(_appdb.GetAll(), "Id", "Id");
     ViewData["DiagnosId"]     = new SelectList(_context.Diagnoses, "Id", "Name");
     return(View());
 }
        public IActionResult Register(string returnUrl = null)
        {
            var clinics = new List <SelectListItem>();

            clinics = _clinicRepository.GetAll()
                      .Select(a => new SelectListItem
            {
                Text = a.Name, Value = a.Id.ToString()
            }
                              ).ToList();

            var model = new RegisterViewModel
            {
                Clinics = clinics
            };

            ViewData["ReturnUrl"] = returnUrl;
            return(View(model));
        }
        private ClinicMasterViewModel GetClinicsModel()
        {
            var clinics = clinicRepository.GetAll();

            var data = (from clinic in clinics
                        select new ClinicMasterInfoDto {
                ClinicId = clinic.Id,
                ClinicName = clinic.Caption,
                DoctorsCount = clinic.Doctors.Count
            }).ToList();

            return(new ClinicMasterViewModel {
                Clinics = data
            });
        }
Beispiel #8
0
        /// <summary>
        /// Gets all clinics
        /// </summary>
        /// <returns>List of all clinics</returns>
        //Get: api/clinic
        public IHttpActionResult Get()
        {
            var clinics    = new List <Clinic>();
            var clinicsDAL = _clinicRepository.GetAll();

            if (clinicsDAL.Any())
            {
                foreach (var clinic in clinicsDAL)
                {
                    clinics.Add(BuildClinic(clinic));
                }
                return(Ok(clinics));
            }
            return(NotFound());
        }
Beispiel #9
0
        private void DisplayAllClinics()
        {
            IClinicRepository clinicRepository = unitOfWork.ClinicRepository;

            List <Clinic> clinics = clinicRepository.GetAll();

            if (clinics == null || clinics.Count == 0)
            {
                CustomConsole.WriteLineError("No clinics exist in the database.");
            }
            else
            {
                DisplayClinicList(clinics);
            }
        }
Beispiel #10
0
        // GET: Clinics
        public ActionResult Index()
        {
            try
            {
                // return View(db.Clinics.ToList());
                var data = repository.GetAll();
                return(View(data));
            }
            catch (Exception ex)
            {
                //If an exception is thrown, log the error and return null.

                log.Error(string.Format("Failed to load list of clinics {0}", ex));
                return(null);
            }
        }
Beispiel #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientRegister"/> class.
        /// </summary>
        public UserRegister()
        {
            InitializeComponent();

            if (AppContext.LoggedInUser.Role > MedicineRoles.SupperManager)
            {
                cboClinic.DataSource = new List <Medical.Data.Entities.Clinic> {
                    AppContext.CurrentClinic
                };
            }
            else
            {
                cboClinic.DataSource = _clinicRepo.GetAll();
            }
            this.User = new User();
            this.bdsUser.DataSource = User;
            this._isAddNew          = true;
            this._userRepository    = new UserRepository();
        }
Beispiel #12
0
 // GET: Diagnos
 public IActionResult Index()
 {
     return(View(_db.GetAll()));
 }
Beispiel #13
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 private void Initialize()
 {
     cboClinic.DataSource = _clinicRepo.GetAll();
     cboDate.Value = DateTime.Today;
     cboStatus.DataSource = new List<Item>(new Item[] {new Item(2, "Đã phát thuốc")});
 }
Beispiel #14
0
        // GET: ClinicController
        public ActionResult List()
        {
            var clinics = _repository.GetAll();

            return(View(clinics));
        }