Esempio 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));
 }
Esempio 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));
 }
Esempio 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));
 }
Esempio 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));
 }
 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));
 }