Esempio n. 1
0
        public async Task <IActionResult> UnBlockWallet(string pass, string jmbg)
        {
            if (!AdminRoleHelper.IsAdmin(pass))
            {
                TempData["Error"] = "U are not admin!";
                return(RedirectToAction("Index", "Home"));
            }

            try
            {
                var wallet = await WalletService.UnBlockWallet(jmbg);

                TempData["Success"] = "Wallet is successfully unblocked!";
                return(RedirectToAction("AdminPanel", new { pass = pass }));
            }
            catch (Exception ex)
            {
                Logger.LogError(ex, ex.Message);
                if (ex is EstimationPracticeException e)
                {
                    TempData["Error"] = e.EstimationPracticeExceptionMessage;
                }
                else
                {
                    TempData["Error"] = BasicErrorMessage;
                }

                return(View());
            }
        }
Esempio n. 2
0
        public IActionResult AdminPanel(string pass)
        {
            if (!AdminRoleHelper.IsAdmin(pass))
            {
                TempData["Error"] = "U are not admin!";
                return(RedirectToAction("Index", "Home"));
            }

            return(View());
        }