Exemplo n.º 1
0
 public ActionResult Manage([Bind(Include = "UserNameID,UserName,Password,Role,FullName,Birthday,Email,Address,Phone")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Store"));
     }
     return(View(user));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "BranchID,BranchName")] Branch branch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(branch).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(branch));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ProducTypeID,ProductTypeName")] ProductType producttype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(producttype).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(producttype));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "OrderID,UserNameID,OrderDate,Total,DeliveryAddress,PhoneContact")] Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserNameID = new SelectList(db.Users, "UserNameID", "UserName", order.UserNameID);
     return(View(order));
 }
 public ActionResult Edit([Bind(Include = "CategoryID,CategoryName,ProductTypeID")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductTypeID = new SelectList(db.ProductTypes, "ProducTypeID", "ProductTypeName", category.ProductTypeID);
     return(View(category));
 }
Exemplo n.º 6
0
 public ActionResult Edit([Bind(Include = "OrderDetailID,OrderID,ProductID,Quantity,UnitPrice")] OrderDetail orderdetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(orderdetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OrderID   = new SelectList(db.Orders, "OrderID", "UserNameID", orderdetail.OrderID);
     ViewBag.ProductID = new SelectList(db.Products, "ProductID", "CategoryID", orderdetail.ProductID);
     return(View(orderdetail));
 }
Exemplo n.º 7
0
 public ActionResult Edit([Bind(Include = "ProductID,CategoryID,ProductName,BranchID,Description,Price,Quantity,images")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BranchID   = new SelectList(db.Branches, "BranchID", "BranchName", product.BranchID);
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "CategoryName", product.CategoryID);
     return(View(product));
 }