示例#1
0
 public ActionResult Edit([Bind(Include = "ID,Product_id,NickName,Quality,Comment")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(review));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "ID,Name,Phone,Email,Address,Content,CreatedDate,Status")] Feedback feedback)
 {
     if (ModelState.IsValid)
     {
         db.Entry(feedback).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(feedback));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "Material_id,Material_name")] Materials materials)
 {
     if (ModelState.IsValid)
     {
         db.Entry(materials).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(materials));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "Size_id,Size_name")] Sizes sizes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sizes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sizes));
 }
示例#5
0
 public ActionResult Edit([Bind(Include = "Color_id,Color_name")] Colors colors)
 {
     if (ModelState.IsValid)
     {
         db.Entry(colors).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(colors));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "ID,Name,MetaTitle,ParentID,DisplayOrder,CreatedDate,Status")] Categories categories)
 {
     if (ModelState.IsValid)
     {
         categories.CreatedDate     = DateTime.Now;
         db.Entry(categories).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(categories));
 }
示例#7
0
 public ActionResult Edit([Bind(Include = "ID,Category_id,Size_id,Color_id,Contry_id,Material_id,Name,MetaTitle,CreatedDate,Quantity,Price,Image,Warranty,Description,TopHot,Status")] Products products)
 {
     if (ModelState.IsValid)
     {
         db.Entry(products).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Category_id = new SelectList(db.Categories, "ID", "Name", products.Category_id);
     ViewBag.Color_id    = new SelectList(db.Colors, "Color_id", "Color_name", products.Color_id);
     ViewBag.Contry_id   = new SelectList(db.Contries, "Country_id", "Country_name", products.Contry_id);
     ViewBag.Material_id = new SelectList(db.Materials, "Material_id", "Material_name", products.Material_id);
     ViewBag.Size_id     = new SelectList(db.Sizes, "Size_id", "Size_name", products.Size_id);
     return(View(products));
 }