public IActionResult Create() { if (HttpContext.Session.GetString("SafeMode") == "true") { if (HttpContext.Session.GetString("UserIsAuthorized") == "false") { HttpContext.Session.SetString("SafeModeAction", "BankAccountsCreate"); return(RedirectToAction(nameof(SafeMode), "BankAccounts")); } } var newBankAccount = new StringBuilder(10); var random = new Random(); do { newBankAccount.Append(random.Next(1, 9).ToString()); for (int i = 0; i < 9; i++) { newBankAccount.Append(random.Next(0, 9).ToString()); } } while (!service_.CheckBankAccount(newBankAccount.ToString())); ViewData["CreateNewBankAccount"] = newBankAccount.ToString(); return(View()); }
public IActionResult Register() { var newBankAccount = new StringBuilder(10); var random = new Random(); do { newBankAccount.Append(random.Next(1, 9).ToString()); for (int i = 0; i < 9; i++) { newBankAccount.Append(random.Next(0, 9).ToString()); } } while (!service_.CheckBankAccount(newBankAccount.ToString())); ViewData["NewBankAccount"] = newBankAccount.ToString(); return(View()); }