示例#1
0
 public ActionResult Edit([Bind(Include = "username,orderId,gameId,orderDate,shipDate,status")] order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.gameId   = new SelectList(db.games, "id", "name", order.gameId);
     ViewBag.status   = new SelectList(db.orderStatus, "status", "status", order.status);
     ViewBag.username = new SelectList(db.users, "username", "firstName", order.username);
     return(View(order));
 }
        public ActionResult Edit([Bind(Include = "cardNumber,cardHolder,cardType,username,expiryDate,securityCode")] creditInformation creditInformation)
        {
            string user = Session["User"].ToString();

            creditInformation.username = user;
            if (ModelState.IsValid)
            {
                db.Entry(creditInformation).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.cardType = new SelectList(db.cardTypes, "type", "type", creditInformation.cardType);
            ViewBag.username = new SelectList(db.users, "username", "firstName", creditInformation.username);
            return(View(creditInformation));
        }
示例#3
0
 public ActionResult Edit([Bind(Include = "username,firstName,lastName,email,mailAddress,shipAddress," +
                                          "age,employee,promoEmails,publicWishList,favPlatform, favPlatform2, favGenre,favGenre2")] user user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.username     = new SelectList(db.logins, "username", "password", user.username);
     ViewBag.favPlatform  = new SelectList(db.platforms, "platformId", "platformName", user.favPlatform);
     ViewBag.favGenre     = new SelectList(db.genres, "genreKey", "name", user.favGenre);
     ViewBag.favPlatform2 = new SelectList(db.platforms, "platformId", "platformName", user.favPlatform2);
     ViewBag.favGenre2    = new SelectList(db.genres, "genreKey", "name", user.favGenre2);
     return(View(user));
 }