public ActionResult Edit([Bind(Include = "CategoryId,CategoryName")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(PartialView(category)); }
public ActionResult Edit([Bind(Include = "AddressId,AddressDoorNo,AddressLine1,AddressLine2,LandMark,PinCode,UserId,Name,City,State")] Address address) { if (ModelState.IsValid) { db.Entry(address).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(address)); }
public ActionResult Edit([Bind(Include = "orderid,orderdate,orderstatus,userid,addressid,paymenttype,paymentstatus,totalamount,orderPlacedId,totalItems")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.orderPlacedId = new SelectList(db.orderPlacedProducts, "orderPlacedId", "orderPlacedHealthProducts", order.orderPlacedId); return(View(order)); }
public ActionResult Edit([Bind(Include = "SubClassificationId,SubClassificationName,SubCat_Id", Exclude = "SubClassificationImage")] SubClassification subClassification, HttpPostedFileBase SubClassificationImage) { if (ModelState.IsValid) { if (SubClassificationImage != null) { if (SubClassificationImage.ContentLength > 0) { byte[] imgBinaryData = new byte[SubClassificationImage.ContentLength]; int readresult = SubClassificationImage.InputStream.Read(imgBinaryData, 0, SubClassificationImage.ContentLength); subClassification.SubClassificationImage = imgBinaryData; } } db.Entry(subClassification).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SubCat_Id = new SelectList(db.SubCategories, "SubCat_Id", "SubCatName", subClassification.SubCat_Id); return(PartialView(subClassification)); }
public ActionResult Edit([Bind(Include = "Product_Id,Product_Name,Product_Price,Product_Details,SubClassificationId,ExpiryDate,Quantity", Exclude = "Product_Image")] Product product, HttpPostedFileBase Product_Image) { if (ModelState.IsValid) { if (Product_Image != null) { if (Product_Image.ContentLength > 0) { byte[] imgBinaryData = new byte[Product_Image.ContentLength]; int readresult = Product_Image.InputStream.Read(imgBinaryData, 0, Product_Image.ContentLength); product.Product_Image = imgBinaryData; } } db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SubClassificationId = new SelectList(db.SubClassifications, "SubClassificationId", "SubClassificationName", product.SubClassificationId); return(PartialView(product)); }
public ActionResult Edit([Bind(Include = "PharmacySubCatId,PharmacySubCatName,PharmacyCategoryId", Exclude = "PharmacySubCatImage")] PharmacySubCategory pharmacySubCategory, HttpPostedFileBase PharmacySubCatImage) { if (ModelState.IsValid) { if (PharmacySubCatImage != null) { if (PharmacySubCatImage.ContentLength > 0) { byte[] imgBinaryData = new byte[PharmacySubCatImage.ContentLength]; int readresult = PharmacySubCatImage.InputStream.Read(imgBinaryData, 0, PharmacySubCatImage.ContentLength); pharmacySubCategory.PharmacySubCatImage = imgBinaryData; } } db.Entry(pharmacySubCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PharmacyCategoryId = new SelectList(db.PharmacyCategories, "PharmacyCategoryId", "PharmacyCategoryName", pharmacySubCategory.PharmacyCategoryId); return(PartialView(pharmacySubCategory)); }
public ActionResult Edit([Bind(Include = "ProductId,ProductName,ProductPrice,ProductDetails,PharmacySubCatId,ExpiryDate,Quantity,ProductType,Manufacturer", Exclude = "ProductImage")] PharmacyProduct pharmacyProduct, HttpPostedFileBase ProductImage) { if (ModelState.IsValid) { if (ProductImage != null) { if (ProductImage.ContentLength > 0) { byte[] imgBinaryData = new byte[ProductImage.ContentLength]; int readresult = ProductImage.InputStream.Read(imgBinaryData, 0, ProductImage.ContentLength); pharmacyProduct.ProductImage = imgBinaryData; } } db.Entry(pharmacyProduct).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PharmacySubCatId = new SelectList(db.PharmacySubCategories, "PharmacySubCatId", "PharmacySubCatName", pharmacyProduct.PharmacySubCatId); return(PartialView(pharmacyProduct)); }