Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DepartmentTicket departmentTicket = db.DepartmentTickets.Find(id);

            db.DepartmentTickets.Remove(departmentTicket);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "DeparmentTrickId,RegisterTicketId,Approved")] DepartmentTicket departmentTicket)
 {
     if (ModelState.IsValid)
     {
         db.Entry(departmentTicket).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RegisterTicketId = new SelectList(db.RegisterTickets, "Id", "Id", departmentTicket.RegisterTicketId);
     return(View(departmentTicket));
 }
Exemple #3
0
        // GET: DepartmentTickets/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DepartmentTicket departmentTicket = db.DepartmentTickets.Find(id);

            if (departmentTicket == null)
            {
                return(HttpNotFound());
            }
            return(View(departmentTicket));
        }
Exemple #4
0
        // GET: DepartmentTickets/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DepartmentTicket departmentTicket = db.DepartmentTickets.Find(id);

            if (departmentTicket == null)
            {
                return(HttpNotFound());
            }
            ViewBag.RegisterTicketId = new SelectList(db.RegisterTickets, "Id", "Id", departmentTicket.RegisterTicketId);
            return(View(departmentTicket));
        }