public ActionResult DeleteConfirmed(string id) { DONGSANPHAM dONGSANPHAM = db.DONGSANPHAMs.Find(id); db.DONGSANPHAMs.Remove(dONGSANPHAM); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DSP_ID,DSP_TEN,DSP_MOTA")] DONGSANPHAM dONGSANPHAM) { if (ModelState.IsValid) { db.Entry(dONGSANPHAM).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dONGSANPHAM)); }
public ActionResult Create([Bind(Include = "DSP_ID,DSP_TEN,DSP_MOTA")] DONGSANPHAM dONGSANPHAM) { if (ModelState.IsValid) { dONGSANPHAM.DSP_ID = db.autottang("DongSanPham", "DSP_ID", db.DONGSANPHAMs.Count()).ToString(); db.DONGSANPHAMs.Add(dONGSANPHAM); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dONGSANPHAM)); }
// GET: DONGSANPHAMs/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DONGSANPHAM dONGSANPHAM = db.DONGSANPHAMs.Find(id); if (dONGSANPHAM == null) { return(HttpNotFound()); } return(View(dONGSANPHAM)); }