public ActionResult DeleteConfirmed(int id) { UsersTransaction usersTransaction = db.UsersTransactions.Find(id); db.UsersTransactions.Remove(usersTransaction); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TransactionsId,FromAccount,ToAccount,Amount,CurrencyRate,TransactionData")] UsersTransaction usersTransaction) { if (ModelState.IsValid) { db.Entry(usersTransaction).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FromAccount = new SelectList(db.UsersBankAccounts, "AccountId", "AccountId", usersTransaction.FromAccount); ViewBag.ToAccount = new SelectList(db.UsersBankAccounts, "AccountId", "AccountId", usersTransaction.ToAccount); return(View(usersTransaction)); }
// GET: UsersTransactions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UsersTransaction usersTransaction = db.UsersTransactions.Find(id); if (usersTransaction == null) { return(HttpNotFound()); } return(View(usersTransaction)); }
// GET: UsersTransactions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UsersTransaction usersTransaction = db.UsersTransactions.Find(id); if (usersTransaction == null) { return(HttpNotFound()); } ViewBag.FromAccount = new SelectList(db.UsersBankAccounts, "AccountId", "AccountId", usersTransaction.FromAccount); ViewBag.ToAccount = new SelectList(db.UsersBankAccounts, "AccountId", "AccountId", usersTransaction.ToAccount); return(View(usersTransaction)); }