Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "idrole,name")] role role)
 {
     if (ModelState.IsValid)
     {
         db.Entry(role).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(role));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "iditem,name,minprice,price,category_idcategory,buy_now, image")] item item)
 {
     if (ModelState.IsValid)
     {
         db.Entry(item).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.category_idcategory = new SelectList(db.category, "idcategory", "name", item.category_idcategory);
     return(View(item));
 }
Exemplo n.º 3
0
 public ActionResult profile([Bind(Include = "idAccount,name,surname,password,nick,icon,promo,age")] account account)
 {
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idAccount = new SelectList(db.ban, "account_idAccount", "date", account.idAccount);
     return(View(account));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "account_idAccount,item_iditem,date")] sell sell)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sell).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.account_idAccount = new SelectList(db.account, "idAccount", "name", sell.account_idAccount);
     ViewBag.item_iditem       = new SelectList(db.item, "iditem", "name", sell.item_iditem);
     return(View(sell));
 }
Exemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "item_iditem,account_idAccount,content,score")] comment comment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.account_idAccount = new SelectList(db.account, "idAccount", "name", comment.account_idAccount);
     ViewBag.item_iditem       = new SelectList(db.item, "iditem", "name", comment.item_iditem);
     return(View(comment));
 }