public ActionResult PropertyInfo(BorrowerViewModel viewModel) { if (ModelState.IsValid) { db.Borrowers.Add(viewModel.Borrower); db.Properties.Add(viewModel.Property); db.SaveChanges(); Transaction transaction = new Transaction(); transaction.UserProfileId = WebMatrix.WebData.WebSecurity.CurrentUserId; transaction.Borrower = viewModel.Borrower; transaction.Property = viewModel.Property; db.Transactions.Add(transaction); db.SaveChanges(); return RedirectToAction("TransactionInfo", new { transactionId = transaction.Id }); } return View(viewModel); }
public ActionResult PropertyInfo() { BorrowerViewModel viewModel = new BorrowerViewModel(); viewModel.PropertyTypes = db.PropertyTypes.ToList(); return View("PropertyInfo", viewModel); }