예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MailOrderCustomer mailOrderCustomer = db.MailOrderCustomers.Find(id);

            db.MailOrderCustomers.Remove(mailOrderCustomer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        // 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));
        }
예제 #4
0
        // 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));
        }