Refactor MassDataGrid editing and validation logic
- Switch to custom edit model (MassDataEditModel) for popup editing, enabling granular field validation and UI control - Replace default editors with explicit DxTextBox/DxCheckBox bindings - Add AmountText field for string input and validation; validate and convert in OnEditModelSaving - Implement duplicate customer check via new GetByCustomerNameAsync API method - Show ValidationSummary in popup; manage validation state with ValidationMessageStore and EditContext - Make popup header and width dynamic; show procedure ComboBox only for existing records - Restore "New" button in grid command column - Refactor CatalogsGrid to handle validation clearing in OnEditFieldChanged instead of OnTitleChanged - General improvements to real-time validation feedback
This commit is contained in:
@@ -32,4 +32,21 @@ public class MassDataApiClient
|
||||
var payload = await response.Content.ReadFromJsonAsync<MassDataReadDto>();
|
||||
return payload ?? new MassDataReadDto();
|
||||
}
|
||||
|
||||
public async Task<MassDataReadDto?> GetByCustomerNameAsync(string customerName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(customerName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var response = await _httpClient.GetAsync($"{Endpoint}/{Uri.EscapeDataString(customerName)}");
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<MassDataReadDto>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user