This commit is contained in:
mmrbnjd
2024-07-01 22:59:01 +03:30
parent 06496f8442
commit e2cc7f61ee
3 changed files with 11 additions and 11 deletions

View File

@@ -332,7 +332,7 @@
حذف
</Button>
<Button class="mt-3" Color="ButtonColor.Primary" @onclick="ShowReport" Type="ButtonType.Button">
چاپ
pdf
</Button>
}
@@ -476,19 +476,20 @@
}
private async Task ShowReport()
{
PreloadService.Show(SpinnerColor.Dark);
var rsp = await hc.Get($"Invoice/GetReport/{InvoiceID}");
if (rsp.IsSuccessStatusCode)
{
var str = await rsp.Content.ReadFromJsonAsync<string>();
var str = await rsp.Content.ReadAsStringAsync();
if (string.IsNullOrEmpty(str))
ShowDangerAlert("خطایی در ساخت فاکتور");
ShowDangerAlert("مشکلی در ساخت فایل رخ داده لطفا مجدد تلاش کنید");
else
await DownloadFileFromStream(str, $"{InvoiceID}.pdf");
await DownloadFileFromStream(str, $"{invoice.ID}.pdf");
}
else
{
ShowDangerAlert("خطایی در ساخت فاکتور");
}
ShowDangerAlert("خطایی در چاپ فاکتور");
PreloadService.Hide();
}
private async Task LoadData()
{
@@ -779,4 +780,3 @@
URL.revokeObjectURL(url);
}
</script>
}

View File

@@ -34,10 +34,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
}) ;
// Server
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
//Home
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
//farzan
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });