Exemplo n.º 1
0
        public void ShowEditClinic()
        {
            ClinicListViewModel selectedClinic = View.GetSelectedClinic();

            try
            {
                ClinicViewModel rawClinic;

                using (var proxy = _clinicianService.CreateChannel())
                {
                    int id = selectedClinic.Identifier;
                    rawClinic = proxy.GetClinician(id);
                }

                if (rawClinic != null)
                {
                    EditClinicViewModel clinic = new EditClinicViewModel()
                    {
                        Identifier = rawClinic.Identifier
                    };

                    View.ShowEditClinicForm(clinic);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> All(int id = 1)
        {
            if (id <= 0)
            {
                return(this.NotFound());
            }

            const int itemPerPage = 6;

            var user = await this.userManager.GetUserAsync(this.User);

            var viewModel = new ClinicListViewModel
            {
                Clinics     = this.clinicService.GetAll(id, user.Id, itemPerPage),
                ItemPerPage = itemPerPage,
                PageNumber  = id,
                ItemsCount  = this.clinicService.GetCount(),
            };

            return(this.View(viewModel));
        }