public ActionResult DeleteConfirmed(int id) { Customer_coupon customer_coupon = db.Customer_coupon.Find(id); db.Customer_coupon.Remove(customer_coupon); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Cust_id,Coupon_id,End_day,Start_day")] Customer_coupon customer_coupon) { if (ModelState.IsValid) { db.Entry(customer_coupon).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Coupon_id = new SelectList(db.Coupon, "Coupon_id", "Coupon_name", customer_coupon.Coupon_id); ViewBag.Cust_id = new SelectList(db.Customer, "Cust_id", "Account", customer_coupon.Cust_id); return(View(customer_coupon)); }
// GET: Customer_coupon/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Customer_coupon customer_coupon = db.Customer_coupon.Find(id); if (customer_coupon == null) { return(HttpNotFound()); } return(View(customer_coupon)); }
// GET: Customer_coupon/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Customer_coupon customer_coupon = db.Customer_coupon.Find(id); if (customer_coupon == null) { return(HttpNotFound()); } ViewBag.Coupon_id = new SelectList(db.Coupon, "Coupon_id", "Coupon_name", customer_coupon.Coupon_id); ViewBag.Cust_id = new SelectList(db.Customer, "Cust_id", "Account", customer_coupon.Cust_id); return(View(customer_coupon)); }