public ActionResult DeleteConfirmed(int id) { TICKETCANDY tICKETCANDY = db.TICKETCANDies.Find(id); db.TICKETCANDies.Remove(tICKETCANDY); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
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)); }