Example #1
0
 public ActionResult Edit([Bind(Include = "CustomerID,Name,Address")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
 public ActionResult Edit([Bind(Include = "TransactionID,TransactionType,Amount,transactionDate,AccountID")] Transcations transcations)
 {
     if (ModelState.IsValid)
     {
         db.Entry(transcations).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AccountID = new SelectList(db.Accounts, "AccountID", "AccountName", transcations.AccountID);
     return(View(transcations));
 }
Example #3
0
 public ActionResult Edit([Bind(Include = "AccountID,AccountName,InceptionDate,CustomerID,CurrentBalance,AccountTypeID")] Account account)
 {
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AccountTypeID = new SelectList(db.AccountTypes, "AccountTypeID", "TypeName", account.AccountTypeID);
     ViewBag.CustomerID    = new SelectList(db.Customers, "CustomerID", "Name", account.CustomerID);
     return(View(account));
 }