UI blokkolás, feloldás
This commit is contained in:
@@ -167,6 +167,92 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#tbCheckListHeadersPage').on('click', '.block-btn', function ()
|
||||||
|
{
|
||||||
|
const row = table.row($(this).closest('tr')).data();
|
||||||
|
const url = `@Url.Page("./CheckListHeaderPage")?handler=Block&id=${row.id}`
|
||||||
|
|
||||||
|
showConfirmModal({
|
||||||
|
title: 'Blokkolás megerősítése',
|
||||||
|
message: 'Biztosan blokkolod a folyamatot?',
|
||||||
|
okText: 'Blokkolás',
|
||||||
|
cancelText: 'Mégsem'
|
||||||
|
}).then(function(result){
|
||||||
|
if(result === 'ok'){
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: 'GET',
|
||||||
|
success: function(data) {
|
||||||
|
if (data) {
|
||||||
|
showMessageModal({
|
||||||
|
title: 'Információ',
|
||||||
|
message: 'A blokkolás sikerült!',
|
||||||
|
okText: 'Értettem'
|
||||||
|
});
|
||||||
|
table.ajax.reload();
|
||||||
|
} else {
|
||||||
|
showMessageModal({
|
||||||
|
title: 'Hiba!',
|
||||||
|
message: 'A blokkolás NEM sikerült!',
|
||||||
|
okText: 'Értettem'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
showMessageModal({
|
||||||
|
title: 'Hiba!',
|
||||||
|
message: 'A blokkolás NEM sikerült!',
|
||||||
|
okText: 'Értettem'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#tbCheckListHeadersPage').on('click', '.unblock-btn', function ()
|
||||||
|
{
|
||||||
|
const row = table.row($(this).closest('tr')).data();
|
||||||
|
const url = `@Url.Page("./CheckListHeaderPage")?handler=Unblock&id=${row.id}`
|
||||||
|
|
||||||
|
showConfirmModal({
|
||||||
|
title: 'Blokkolás feloldás megerősítése',
|
||||||
|
message: 'Biztosan feloldod a blokkolást?',
|
||||||
|
okText: 'Blokkolás feloldás',
|
||||||
|
cancelText: 'Mégsem'
|
||||||
|
}).then(function(result){
|
||||||
|
if(result === 'ok'){
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: 'GET',
|
||||||
|
success: function(data) {
|
||||||
|
if (data) {
|
||||||
|
showMessageModal({
|
||||||
|
title: 'Információ',
|
||||||
|
message: 'A blokkolás feloldása sikerült!',
|
||||||
|
okText: 'Értettem'
|
||||||
|
});
|
||||||
|
table.ajax.reload();
|
||||||
|
} else {
|
||||||
|
showMessageModal({
|
||||||
|
title: 'Hiba!',
|
||||||
|
message: 'A blokkolás feloldása NEM sikerült!',
|
||||||
|
okText: 'Értettem'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
showMessageModal({
|
||||||
|
title: 'Hiba!',
|
||||||
|
message: 'A blokkolás feloldása NEM sikerült!',
|
||||||
|
okText: 'Értettem'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$('#tbCheckListHeadersPage').on('click', '.delete-btn', function ()
|
$('#tbCheckListHeadersPage').on('click', '.delete-btn', function ()
|
||||||
{
|
{
|
||||||
const row = table.row($(this).closest('tr')).data();
|
const row = table.row($(this).closest('tr')).data();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
|||||||
public async Task<IActionResult> OnGetBlock(int id)
|
public async Task<IActionResult> OnGetBlock(int id)
|
||||||
{
|
{
|
||||||
var userid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
var userid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||||
var response = await _checkListService.AcceptCheckListHeader(id, int.Parse(userid));
|
var response = await _checkListService.BlockCheckListHeader(id, int.Parse(userid));
|
||||||
|
|
||||||
if (response.IsSuccess)
|
if (response.IsSuccess)
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ namespace WorkFlowCheck.Web.Pages.CheckList.CheckListHeader
|
|||||||
public async Task<IActionResult> OnGetUnBlock(int id)
|
public async Task<IActionResult> OnGetUnBlock(int id)
|
||||||
{
|
{
|
||||||
var userid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
var userid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||||
var response = await _checkListService.AcceptCheckListHeader(id, int.Parse(userid));
|
var response = await _checkListService.UnBlockCheckListHeader(id, int.Parse(userid));
|
||||||
|
|
||||||
if (response.IsSuccess)
|
if (response.IsSuccess)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user