Exemple #1
0
 public ActionResult Edit([Bind(Include = "FeedbackID,FeedbackCode,FirstName,Address,Phone,Email,Content,Status,CreateDate")] Feedback feedback)
 {
     if (ModelState.IsValid)
     {
         db.Entry(feedback).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(feedback));
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "CategoryID,Name,Description,ParentID,CreateDate,CreateBy,ModifiedDate,ModifiedBy,Status,ShowOnHome")] ProductCategory productCategory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productCategory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(productCategory));
 }
 public ActionResult Edit([Bind(Include = "NewsCategoryID,Name,NCCode,Description,CreateDate,CreateBy,ModifiedDate,ModifiedBy,Status,TopHot")] NewsCategory newsCategory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(newsCategory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(newsCategory));
 }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "InvoiceID,InvoiceCode,CreateDate,Email,LastName,FirstName,Phone,Address,ghichu,Payment,UserID,UserCode")] Invoice invoice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(invoice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(invoice));
 }
 public ActionResult Edit([Bind(Include = "ProductID,ProductCode,ProductName,Description,ProductImage,Price,PromotionPrice,Quantity,CategoryID,Detail,Warranty,CreateDate,CreateBy,ModifiedDate,ModifiedBy,Status,TopHot,ViewCounts")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.ProductCategories, "CategoryID", "Name", product.CategoryID);
     return(View(product));
 }
 public ActionResult Edit([Bind(Include = "NewsID,Title,MetaTitle,Description,NewsImage,NewsCategoryID,Details,CreateDate,CreateBy,ModifiedDate,ModifiedBy,Status,TopHot,ViewCount")] News news)
 {
     if (ModelState.IsValid)
     {
         db.Entry(news).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.NewsCategoryID = new SelectList(db.NewsCategories, "NewsCategoryID", "Name", news.NewsCategoryID);
     return(View(news));
 }
 public ActionResult Edit([Bind(Include = "UserID,UserCode,LastName,FirstName,Address,Phone,Email,Username,Password,ConfirmPassword,IsStaff,Position,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));
 }
Exemple #8
0
 public ActionResult Edit([Bind(Include = "InvoiceDetailsID,InvoiceID,ProductID,ProductName,UserCode,Price,PromotionPrice,Quantity")] InvoiceDetails invoiceDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(invoiceDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.InvoiceID = new SelectList(db.Invoices, "InvoiceID", "InvoiceCode", invoiceDetails.InvoiceID);
     ViewBag.ProductID = new SelectList(db.Products, "ProductID", "ProductCode", invoiceDetails.ProductID);
     return(View(invoiceDetails));
 }
 public ActionResult Edit([Bind(Include = "CartID,UserID,ProductID,DateOfPurchase,Quantity")] Cart cart)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cart).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductID = new SelectList(db.Products, "ProductID", "ProductCode", cart.ProductID);
     ViewBag.UserID    = new SelectList(db.Users, "UserID", "UserCode", cart.UserID);
     return(View(cart));
 }