public async Task <PartialViewResult> CreateOrViewPaymentModal(long invoiceId, long?id = null, bool c = false) { int?impersonatorTenantId; int value; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; value = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; value = impersonatorTenantId.Value; } IInvoiceAppService invoiceAppService = this._invoiceAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrViewPaymentModalViewModel createOrViewPaymentModalViewModel = new CreateOrViewPaymentModalViewModel(await invoiceAppService.GetInvoicePaymentForCreateOrView(nullableIdInput)); if (createOrViewPaymentModalViewModel.InvoicePayment.InvoiceId <= (long)0) { createOrViewPaymentModalViewModel.InvoicePayment.InvoiceId = invoiceId; } IInvoiceAppService invoiceAppService1 = this._invoiceAppService; long num = createOrViewPaymentModalViewModel.InvoicePayment.InvoiceId; Invoice invoice = await invoiceAppService1.GetInvoice(long.Parse(num.ToString())); Invoice invoice1 = invoice; createOrViewPaymentModalViewModel.InvoicePayment.Invoice = invoice1; Customer customerById = await this._customerAppServer.GetCustomerById(invoice1.CustomerId); createOrViewPaymentModalViewModel.InvoicePayment.Customer = customerById.MapTo <Customer>(); if (c) { ((dynamic)this.ViewBag).IsCustomer = true; } return(this.PartialView("_CreateOrViewPaymentModal", createOrViewPaymentModalViewModel)); }