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)); }
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)); }