public ActionResult DeleteConfirmed(int id) { discount_code discount_code = db.discount_code.Find(id); db.discount_code.Remove(discount_code); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,c_time,c_id,u_time,u_id,name,amount,deduction,start_time,end_time,level,remark")] discount_code discount_code) { if (ModelState.IsValid) { db.Entry(discount_code).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(discount_code)); }
public ActionResult _Create([Bind(Include = "id,c_time,c_id,u_time,u_id,name,amount,deduction,start_time,end_time,level,remark")] discount_code discount_code) { if (ModelState.IsValid) { db.discount_code.Add(discount_code); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(discount_code)); }
// GET: discount_code/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } discount_code discount_code = db.discount_code.Find(id); if (discount_code == null) { return(HttpNotFound()); } return(View(discount_code)); }