Ejemplo n.º 1
0
            public async Task <ActionResult> DeleteTransaction(long userId, long transactionId)
            {
                if (!_customAuth.IsUserAllowedAccess(userId, HttpContext))
                {
                    return(StatusCode(401));
                }

                var response = await _tranService.DeleteTransaction(transactionId, _customAuth.IsUserAdmin(HttpContext));

                return(StatusCode(response.Status, response));
            }
Ejemplo n.º 2
0
        public IActionResult DeleteManageTransaction(int id)
        {
            try
            {
                if (_transactionServices.DeleteTransaction(id))
                {
                    Alert("Delete Transaction Successfully .", NotificationType.success);
                    return(RedirectToAction("ManageTransactions"));
                }
                else
                {
                    Alert("Delete Transaction error, cannot find this User!!!", NotificationType.error);
                    return(RedirectToAction("ManageTransactions"));
                }
            }
            catch (Exception e)
            {
                Alert(e.Message, NotificationType.error);
                return(RedirectToAction("ManageTransactions"));

                throw;
            }
        }