DisplayNameHelper kifejlesztése
This commit is contained in:
@@ -48,6 +48,16 @@
|
||||
<input asp-for="UserDTO.LastName" class="form-control" />
|
||||
<span asp-validation-for="UserDTO.LastName" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="UserDTO.Active"></label>
|
||||
<input type="checkbox" asp-for="UserDTO.Active" class="form-check-input" />
|
||||
<span asp-validation-for="UserDTO.Active" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label asp-for="UserDTO.NFCActive"></label>
|
||||
<input type="checkbox" asp-for="UserDTO.NFCActive" class="form-check-input" />
|
||||
<span asp-validation-for="UserDTO.NFCActive" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="mb-3 d-flex justify-content-between">
|
||||
<button type="button" id="saveUser" class="btn btn-primary">Mentés</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="history.back()">Mégsem</button>
|
||||
@@ -102,35 +112,13 @@
|
||||
var formData = getFormAsNestedObject('#UserForm');
|
||||
const $form = $('#UserForm');
|
||||
|
||||
formData.User.RoleDTO=[];
|
||||
formData.UserDTO.RoleDTO=[];
|
||||
formData.UserDTO.Active = $('#UserForm input[name="UserDTO.Active"]').is(':checked');
|
||||
formData.UserDTO.NFCActive = $('#UserForm input[name="UserDTO.NFCActive"]').is(':checked');
|
||||
|
||||
if ($form.valid())
|
||||
{
|
||||
$.ajax({
|
||||
url: $('#UserEditPostUrl').val(),
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': csrfToken,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: JSON.stringify(formData.User),
|
||||
success: function (response) {
|
||||
showMessageModal({
|
||||
title: 'Figyelmem!',
|
||||
message: 'Sikeres mentés.',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Hiba esetén
|
||||
console.error("Hiba: ", error);
|
||||
showMessageModal({
|
||||
title: 'Hiba!',
|
||||
message: 'A mentés NEM sikerült!',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
}
|
||||
});
|
||||
saveEntity(csrfToken, formData.UserDTO, $('#UserEditPostUrl').val());
|
||||
} else
|
||||
{
|
||||
$form[0].reportValidity();
|
||||
|
||||
Reference in New Issue
Block a user