Beispiel #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     Models.TicketModel ticket = db.Tickets.Find(id);
     db.Tickets.Remove(ticket);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public void add(int ShowID, int Row, int Seat)
 {
     ServicesLayer.Models.TicketModel model = new Models.TicketModel()
     {
         ShowID = ShowID, Row = Row, Seat = Seat, ID = 0
     };
     bool rez = repository.create(mapper.map(model));
 }
        public void update(int ID, int ShowID, int Row, int Seat)
        {
            ServicesLayer.Models.TicketModel model = new Models.TicketModel()
            {
                ShowID = ShowID, Row = Row, Seat = Seat, ID = ID
            };
            bool res;//for testing

            res = repository.update(mapper.map(model));
        }
Beispiel #4
0
 public ActionResult Edit([Bind(Include = "TicketID,Topic,Description,TicketStatus,EtaTime")] Models.TicketModel ticket)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ticket).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(ticket));
 }
Beispiel #5
0
        public ActionResult Add([Bind(Include = "TicketID,Topic,Description,EmailFrom")] Models.TicketModel ticket)
        {
            if (ModelState.IsValid)
            {
                db.Tickets.Add(ticket);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ticket));
        }
Beispiel #6
0
 // GET: Tickets/Edit/5
 public ActionResult Edit(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Models.TicketModel ticket = db.Tickets.Find(id);
     if (ticket == null)
     {
         return(HttpNotFound());
     }
     return(View(ticket));
 }
 public void insertTicket()
 {
     Models.TicketModel tm = new Models.TicketModel();
     tm.insert();
 }
 public ActionResult Grant()
 {
     Models.TicketModel tm = new Models.TicketModel();
     ViewBag.tickets = tm.selectAll();
     return View();
 }