public ActionResult DeleteConfirmed(int id) { MailOrderCustomer mailOrderCustomer = db.MailOrderCustomers.Find(id); db.MailOrderCustomers.Remove(mailOrderCustomer); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "customer_id,post_address,time_order")] MailOrderCustomer mailOrderCustomer) { if (ModelState.IsValid) { db.Entry(mailOrderCustomer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.customer_id = new SelectList(db.Customers, "customer_id", "name", mailOrderCustomer.customer_id); return(View(mailOrderCustomer)); }
// GET: MailOrderCustomers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MailOrderCustomer mailOrderCustomer = db.MailOrderCustomers.Find(id); if (mailOrderCustomer == null) { return(HttpNotFound()); } return(View(mailOrderCustomer)); }
// GET: MailOrderCustomers/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MailOrderCustomer mailOrderCustomer = db.MailOrderCustomers.Find(id); if (mailOrderCustomer == null) { return(HttpNotFound()); } ViewBag.customer_id = new SelectList(db.Customers, "customer_id", "name", mailOrderCustomer.customer_id); return(View(mailOrderCustomer)); }