public ActionResult Edit([Bind(Include = "UserId,UserName,UserEmail,UserPhone,UserAddress,UserPassword,UserImage,RoleId")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RoleId = new SelectList(db.Roles, "RoleId", "RoleName", user.RoleId);
     return(View(user));
 }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "AdjustmentId,AdjustmentReason,ProductId,AdjustedQuantity,AdjustedDateTime")] Adjustment adjustment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(adjustment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductId = new SelectList(db.Products, "ProductId", "ProductCode", adjustment.ProductId);
     return(View(adjustment));
 }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "CategoryId,CategoryName")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(db.Categories, "CategoryId", "CategoryName", category.CategoryId);
     ViewBag.CategoryId = new SelectList(db.Categories, "CategoryId", "CategoryName", category.CategoryId);
     return(View(category));
 }
 public ActionResult Edit([Bind(Include = "ProductId,ProductCode,ProductName,CategoryId,ColorId,SizeId,ProductQuantity,AlertQuantity,SellingPrice,Image,ManufactureId,ProductDate")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId    = new SelectList(db.Categories, "CategoryId", "CategoryName", product.CategoryId);
     ViewBag.ColorId       = new SelectList(db.Colors, "ColorId", "ColorName", product.ColorId);
     ViewBag.ManufactureId = new SelectList(db.Manufactures, "ManufactureId", "LotNumber", product.ManufactureId);
     ViewBag.SizeId        = new SelectList(db.Sizes, "SizeId", "SizeName", product.SizeId);
     return(View(product));
 }