public ActionResult Edit([Bind(Include = "CategoryID,CategoryName,Desc")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ProductTypeID,TypeName")] ProductType productType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(productType));
 }
 public ActionResult Edit([Bind(Include = "ProductID,ProductName,OrderID,AppxWeight,ActualWeight,Description,IsActive,CreatedDate,CreatedBy,UpdatedDate,Updatedby")] CustomerProduct customerProduct)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customerProduct).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customerProduct));
 }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "CustCode,CustmerName,Address")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Exemple #5
0
 public ActionResult Edit([Bind(Include = "VendorCode,VendorName,Address,MobileNo")] Vendor vendor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vendor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(vendor));
 }
 public ActionResult Edit([Bind(Include = "BulkBuyID,CustomerName,Address,TakenAmount,Rate,GWeight,SWeight,Status")] BulkBuy bulkBuy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bulkBuy).State = EntityState.Modified;
         db.SaveChanges();
         TempData["Message"] = "Bulk updated Successfully !";
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductTypeID = new SelectList(db.ProductTypes, "TypeName", "TypeName");
     return(View(bulkBuy));
 }
 public ActionResult Edit([Bind(Include = "ProductID,ProductName,ProdDesc,IsActive,CategoryID")] Product product, HttpPostedFileBase file)
 {
     if (ModelState.IsValid)
     {
         if (file != null)
         {
             MemoryStream target = new MemoryStream();
             file.InputStream.CopyTo(target);
             product.Image = target.ToArray();
         }
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "CategoryName", product.CategoryID);
     return(View(product));
 }