예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            TicketVersion ticketVersion = await db.TicketVersions.FindAsync(id);

            db.TicketVersions.Remove(ticketVersion);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        // GET: TicketVersions/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TicketVersion ticketVersion = await db.TicketVersions.FindAsync(id);

            if (ticketVersion == null)
            {
                return(HttpNotFound());
            }
            return(View(ticketVersion));
        }
예제 #3
0
        public async Task <ActionResult> Edit([Bind(Include = "ID,Version,TicketId,ModifiedBy,ModificationDate,Status,AssignedTo,Comment")] TicketVersion ticketVersion)
        {
            if (ModelState.IsValid)
            {
                db.Entry(ticketVersion).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Status     = new SelectList(db.Status, "Id", "Name", ticketVersion.Status);
            ViewBag.TicketId   = new SelectList(db.Tickets, "TicketId", "TicketName", ticketVersion.TicketId);
            ViewBag.AssignedTo = new SelectList(db.Users, "UserId", "Name", ticketVersion.AssignedTo);
            ViewBag.ModifiedBy = new SelectList(db.Users, "UserId", "Name", ticketVersion.ModifiedBy);
            return(View(ticketVersion));
        }
예제 #4
0
        // GET: TicketVersions/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TicketVersion ticketVersion = await db.TicketVersions.FindAsync(id);

            if (ticketVersion == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Status     = new SelectList(db.Status, "Id", "Name", ticketVersion.Status);
            ViewBag.TicketId   = new SelectList(db.Tickets, "TicketId", "TicketName", ticketVersion.TicketId);
            ViewBag.AssignedTo = new SelectList(db.Users, "UserId", "Name", ticketVersion.AssignedTo);
            ViewBag.ModifiedBy = new SelectList(db.Users, "UserId", "Name", ticketVersion.ModifiedBy);
            return(View(ticketVersion));
        }