コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TICKETCANDY tICKETCANDY = db.TICKETCANDies.Find(id);

            db.TICKETCANDies.Remove(tICKETCANDY);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID_TIKET_CANDY,ID_CANDY,PAY")] TICKETCANDY tICKETCANDY)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tICKETCANDY).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID_CANDY = new SelectList(db.CANDies, "ID_CANDY", "NAME", tICKETCANDY.ID_CANDY);
     return(View(tICKETCANDY));
 }
コード例 #3
0
 public ActionResult Create([Bind(Include = "ID_TIKET_CANDY,ID_CANDY,PAY")] TICKETCANDY tICKETCANDY)
 {
     ViewBag.ID_CANDY = new SelectList(db.CANDies, "ID_CANDY", "NAME", tICKETCANDY.ID_CANDY);
     if (ModelState.IsValid)
     {
         db.TICKETCANDies.Add(tICKETCANDY);
         db.SaveChanges();
         ViewBag.total    = db.CANDies.Find(tICKETCANDY.ID_CANDY).PRICE *tICKETCANDY.PAY;
         ViewBag.empleado = db.USUARIO.ToList().First().USERNAME;
         return(View());
     }
     return(View(tICKETCANDY));
 }
コード例 #4
0
        // GET: TICKETCANDies/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TICKETCANDY tICKETCANDY = db.TICKETCANDies.Find(id);

            if (tICKETCANDY == null)
            {
                return(HttpNotFound());
            }
            return(View(tICKETCANDY));
        }
コード例 #5
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TICKETCANDY tICKETCANDY = db.TICKETCANDies.Find(id);

            if (tICKETCANDY == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID_CANDY = new SelectList(db.CANDies, "ID_CANDY", "NAME", tICKETCANDY.ID_CANDY);
            return(View(tICKETCANDY));
        }