public async Task <PartialViewResult> CreateOrUpdateResourcesModal(long?invoiceId = null, bool?reloadPartial = null) { PartialViewResult partialViewResult; IInvoiceAppService invoiceAppService = this._invoiceAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = invoiceId }; GetInvoiceResourceForEditOutput invoiceResourcesForEdit = await invoiceAppService.GetInvoiceResourcesForEdit(nullableIdInput); CreateOrUpdateInvoiceResourcesModalViewModel createOrUpdateInvoiceResourcesModalViewModel = new CreateOrUpdateInvoiceResourcesModalViewModel(invoiceResourcesForEdit) { InvoiceId = invoiceId.Value }; Invoice invoice = await this._invoiceAppService.GetInvoice(invoiceId.Value); ((dynamic)this.ViewBag).InvoiceName = invoice.Label; partialViewResult = (!reloadPartial.HasValue || !bool.Parse(reloadPartial.ToString()) ? this.PartialView("_CreateOrUpdateResourcesModal", createOrUpdateInvoiceResourcesModalViewModel) : this.PartialView("_ListResourcesView", createOrUpdateInvoiceResourcesModalViewModel)); return(partialViewResult); }
public CreateOrUpdateInvoiceResourcesModalViewModel(GetInvoiceResourceForEditOutput output) { output.MapTo <GetInvoiceResourceForEditOutput, CreateOrUpdateInvoiceResourcesModalViewModel>(this); }