public ActionResult Edit([Bind(Include = "CompanyId,CompanyName")] Companies companies)
 {
     if (ModelState.IsValid)
     {
         db.Entry(companies).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("ViewCompany"));
     }
     return(View(companies));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "DrawingId,WoodId,StyleId,Height,Width,Quantity,Price,Details,Name,Image")] DrawingOrders orders)
 {
     if (ModelState.IsValid)
     {
         orders.Status          = "Confirmed";
         db.Entry(orders).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("TakeDrawingOrder"));
     }
     ViewBag.WoodId  = new SelectList(db.Woods, "WoodId", "WoodName", orders.WoodId);
     ViewBag.StyleId = new SelectList(db.FStyles, "StyleId", "StyleName", orders.StyleId);
     return(View(orders));
 }
 public ActionResult Edit([Bind(Include = "ProductId,CompanyId,CategoryId,ProductName,Price,Quantity,ProductDetails,ProductImage")] Products products, HttpPostedFileBase ProductImage)
 {
     if (ModelState.IsValid)
     {
         string path = uploadImage(ProductImage);
         if (path.Equals("-1"))
         {
             db.Entry(products).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         else
         {
             products.ProductImage    = path;
             db.Entry(products).State = EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     ViewBag.CategoryId = new SelectList(db.Categories, "CategoryId", "CategoryName", products.CategoryId);
     ViewBag.CompanyId  = new SelectList(db.Companies, "CompanyId", "CompanyName", products.CompanyId);
     return(View(products));
 }