Пример #1
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Patronymic,Email,Address,Phone,ProbabilityOfInsolvency,TypeOfUser")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,TypeOfLoanRate,Percent")] TypeOfLoan typeOfLoan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(typeOfLoan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(typeOfLoan));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("Id,Login,Password")] Account account)
        {
            if (ModelState.IsValid)
            {
                _context.Add(account);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Id"] = new SelectList(_context.Users, "Id", "Address", account.Id);
            return(View(account));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("Id,Date,PaymentAmount,UserId")] DebtPayment debtPayment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(debtPayment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.Users, "Id", "Address", debtPayment.UserId);
            return(View(debtPayment));
        }