Example #1
0
        public async Task <IActionResult> DeleteConfirmed(int childId)
        {
            var child = await _childrenService.GetAsync(childId);

            await _childrenService.DeleteAsync(child);

            return(RedirectToAction(nameof(Index)));
        }
        public async Task <IActionResult> Delete([Required] string id)
        {
            var result = await _services.DeleteAsync(id);

            if (result.IsValid)
            {
                await _systemAuditService.AuditAsync(User.GetEmail(), _accessor.GetIp(), Operations.Delete, Tables.Children);
            }
            return(Ok(result));
        }
Example #3
0
        public async Task <IActionResult> DeleteConfirmed([Required] string hashId, [Required] string hashIdEmployee)
        {
            var result = await _services.DeleteAsync(hashId);

            if (result.IsValid)
            {
                await _systemAuditService.AuditAsync(User.GetEmail(), _accessor.GetIp(), Operations.Delete, Tables.Children);

                return(RedirectToAction("Index", new { id = hashIdEmployee }));
            }
            TempData["ErrorsList"] = result.ErrorsList;
            return(View());
        }