Exemplo n.º 1
0
        public async Task <PartialViewResult> CreateOrEditModal(int?id)
        {
            GetPersonForEditOutput getPersonForEditOutput;

            if (id.HasValue)
            {
                getPersonForEditOutput = await _personsAppService.GetPersonForEdit(new EntityDto { Id = (int)id });

                getPersonForEditOutput.Person.Attachments = await _attachmentFilesAppService.GetAttacments(id + "", AttachmentTypeConsts.IDCardImageID);
            }
            else
            {
                getPersonForEditOutput = new GetPersonForEditOutput
                {
                    Person = new CreateOrEditPersonDto()
                };
            }

            var viewModel = new CreateOrEditPersonModalViewModel()
            {
                Person         = getPersonForEditOutput.Person,
                AttachmentType = await _attachmentTypesAppService.GetAttachmentTypeById(AttachmentTypeConsts.IDCardImageID)
            };

            return(PartialView("_CreateOrEditModal", viewModel));
        }
Exemplo n.º 2
0
        public async Task <PartialViewResult> CreateOrEditModal(int?id)
        {
            GetKkkkForEditOutput getKkkkForEditOutput;

            if (id.HasValue)
            {
                getKkkkForEditOutput = await _kkkksAppService.GetKkkkForEdit(new EntityDto { Id = (int)id });

                getKkkkForEditOutput.Kkkk.Attachments = await _attachmentFilesAppService.GetAttacments(id + "", AttachmentTypeConsts.IDCardImageID);
            }
            else
            {
                getKkkkForEditOutput = new GetKkkkForEditOutput
                {
                    Kkkk = new CreateOrEditKkkkDto()
                };
            }

            var viewModel = new CreateOrEditKkkkModalViewModel()
            {
                Kkkk           = getKkkkForEditOutput.Kkkk,
                Personname     = getKkkkForEditOutput.Personname,
                KkkkPersonList = await _kkkksAppService.GetAllPersonForTableDropdown(),
            };

            return(PartialView("_CreateOrEditModal", viewModel));
        }
        public async Task <PartialViewResult> CreateOrEditModal(int?id)
        {
            GetDiseaseForEditOutput getDiseaseForEditOutput;

            if (id.HasValue)
            {
                getDiseaseForEditOutput = await _diseasesAppService.GetDiseaseForEdit(new EntityDto { Id = (int)id });

                getDiseaseForEditOutput.Disease.Attachments = await _attachmentFilesAppService.GetAttacments(getDiseaseForEditOutput.Disease.PersonId + "." + id, AttachmentTypeConsts.DiagnoseTheDisease);
            }
            else
            {
                getDiseaseForEditOutput = new GetDiseaseForEditOutput
                {
                    Disease = new CreateOrEditDiseaseDto()
                };
            }

            var viewModel = new CreateOrEditDiseaseModalViewModel()
            {
                Disease           = getDiseaseForEditOutput.Disease,
                Personname        = getDiseaseForEditOutput.Personname,
                DiseasePersonList = await _diseasesAppService.GetAllPersonForTableDropdown(),
                AttachmentType    = await _attachmentTypesAppService.GetAttachmentTypeById(AttachmentTypeConsts.DiagnoseTheDisease)
            };

            return(PartialView("_CreateOrEditModal", viewModel));
        }