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));
            }
示例#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;
            }
        }