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)); }
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)); }
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)); }
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)); }