Exemplo n.º 1
0
        public IActionResult Delete(int id)
        {
            var dto = Service.GetDTO(id);

            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = "Удалить карточку";

            return(PartialView(dto));
        }
Exemplo n.º 2
0
        public IActionResult Edit(int id)
        {
            var dto = Service.GetDTO(id);

            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = "Редактировать карточку";

            return(PartialView(nameof(Create), dto));
        }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            var dtos = Service.GetDTOs();

            ViewData["Title"]        = "Список карт посещений";
            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();

            return(View(dtos));
        }
Exemplo n.º 4
0
        public IActionResult Create()
        {
            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = "Создать карточку";

            return(PartialView(nameof(Create), new VisitViewModel()
            {
                VisitDate = DateTime.Now
            }));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> EditPost(VisitViewModel dto)
        {
            if (ModelState.IsValid)
            {
                await Service.SaveAsync(dto);
            }
            ViewData["doctors"]      = DoctorService.GetDTOs();
            ViewData["pacients"]     = PacientService.GetDTOs();
            ViewData["doctor_types"] = DoctorTypeService.GetDTOs();
            ViewData["Title"]        = dto.Id > 0 ? "Редактировать карточку" : "Создать карточку";

            return(PartialView(nameof(Create), dto));
        }