Example #1
0
        public async Task <ActionResult> ExcluirConfirmacaoPartial(int id)
        {
            TicketAnexo ticketAnexo = await _db.TicketAnexoes.FindAsync(id);

            _db.TicketAnexoes.Remove(ticketAnexo);
            await _db.SaveChangesAsync();

            return(await IndicePartial(new TicketAnexosPartialViewModel()
            {
                TicketId = ticketAnexo.TicketId
            }));
        }
Example #2
0
        public async Task <ActionResult> EditarPartial([Bind(Include = "")] TicketAnexo ticketAnexo)
        {
            if (ModelState.IsValid)
            {
                _db.Entry(ticketAnexo).State = EntityState.Modified;
                await _db.SaveChangesAsync();

                return(await IndicePartial(new TicketAnexosPartialViewModel()
                {
                    TicketId = ticketAnexo.TicketId
                }));
            }

            return(PartialView("_Editar", ticketAnexo));
        }
Example #3
0
        //
        // GET: /TicketAnexos/EditarPartial/5
        public async Task <ActionResult> EditarPartial(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TicketAnexo ticketAnexo = await _db.TicketAnexoes.FindAsync(id);

            if (ticketAnexo == null)
            {
                return(HttpNotFound());
            }

            return(PartialView("_Editar", ticketAnexo));
        }
Example #4
0
        public async Task <ActionResult> CriarPartial([Bind(Include = "")] TicketAnexo ticketAnexo)
        {
            if (ModelState.IsValid)
            {
                _db.TicketAnexoes.Add(ticketAnexo);
                await _db.SaveChangesAsync();

                return(await IndicePartial(new TicketAnexosPartialViewModel()
                {
                    TicketId = ticketAnexo.TicketId
                }));
            }

            return(PartialView("_Criar", ticketAnexo));
        }