Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            myTicket myTicket = db.myTickets.Find(id);

            db.myTickets.Remove(myTicket);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,Code,Date,Title,Theater,Actors,Seats,Site,Price")] myTicket myTicket)
 {
     if (ModelState.IsValid)
     {
         db.Entry(myTicket).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(myTicket));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "Id,Code,Date,Title,Theater,Actors,Seats,Site,Price")] myTicket myTicket)
        {
            if (ModelState.IsValid)
            {
                db.myTickets.Add(myTicket);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(myTicket));
        }
Esempio n. 4
0
        public void ShowTickets()
        {
            int i;

            for (i = 0; i < dt.Rows.Count; i++)
            {
                myTicket ticket = new myTicket();
                ticket.id    = Convert.ToInt32(dt.Rows[i]["ticket_id"]);
                ticket.title = Convert.ToString(dt.Rows[i]["ticket_title"]);

                listBox1.Items.Add(ticket);
            }
        }
Esempio n. 5
0
        // GET: myTickets/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            myTicket myTicket = db.myTickets.Find(id);

            if (myTicket == null)
            {
                return(HttpNotFound());
            }
            return(View(myTicket));
        }