-
-
+
+
+
+
+
+ @foreach (var tipo in documentTypes)
+ {
+
+ }
+
+
+
+
+
+
+
+
+
+
+ @if (customer.PhSCustomerDocuments?.Any() == true)
+ {
+
+
+
+ | Tipo |
+ Número |
+ |
+
+
+
+ @foreach (var doc in customer.PhSCustomerDocuments)
+ {
+
+ | @documentTypes.FirstOrDefault(t => t.Id == doc.DocumenttypesId)?.Name |
+ @doc.DocumentNumber |
+
+
+ |
+
+ }
+
+
+ }
@code {
@@ -78,6 +119,8 @@
private ECustomer customer { get; set; } = new();
private List
accountTypes = new();
private List taxConditions = new();
+ private List documentTypes = new();
+ private ECustomerDocument documentFormModel = new();
private string returnUrl = "/sales/customers";
@@ -96,11 +139,28 @@
{
accountTypes = await accountTypeService.GetAllAsync();
}
-
private async Task LoadTaxConditions()
{
taxConditions = await taxConditionService.GetAllAsync();
}
+ private async Task LoadDocumentTypes()
+ {
+ var result = await _httpClient.GetFromJsonAsync>("/api/DocumentType/GetAll");
+ documentTypes = result ?? new();
+ }
+
+ private void AddCustomerDocument()
+ {
+ if (!string.IsNullOrWhiteSpace(documentFormModel.DocumentNumber))
+ {
+ customer.PhSCustomerDocuments.Add(documentFormModel);
+ documentFormModel = new();
+ }
+ }
+ private void RemoveCustomerDocument(ECustomerDocument document)
+ {
+ customer.PhSCustomerDocuments.Remove(document);
+ }
private async Task HandleValidSubmit()
{