public ActionResult DeleteConfirmed(int id) { Cloths cloths = db.cloths.Find(id); db.cloths.Remove(cloths); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,cloth_Type,clothCode,cloth_image")] Cloths cloths) { if (ModelState.IsValid) { db.Entry(cloths).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cloths)); }
// GET: Cloths/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cloths cloths = db.cloths.Find(id); if (cloths == null) { return(HttpNotFound()); } return(View(cloths)); }
public ActionResult Create([Bind(Include = "ID,cloth_Type,clothCode,cloth_image")] Cloths cloths, HttpPostedFileBase filelist) { if (ModelState.IsValid) { if (filelist != null && filelist.ContentLength > 0) { cloths.cloth_image = ConvertToBytes(filelist); } db.cloths.Add(cloths); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cloths)); }