Exemple #1
0
        public int Delete(AcoesViewModel entity)
        {
            var acoes = m_AcoesService.GetById(entity.Id);

            if (acoes != null)
            {
                m_AcoesService.Delete(acoes);
            }

            return(m_AcoesService.Commit());
        }
Exemple #2
0
        public int Add(AcoesViewModel entity)
        {
            m_AcoesService.Add(new AD_ACOES {
                ACOES    = entity.Acoes,
                ICONE    = entity.Icone,
                LINK     = entity.Link,
                MODULOID = entity.Moduloid,
                ORDEM    = entity.Ordem,
            });

            return(m_AcoesService.Commit());
        }
        // GET: Acoes
        public async Task <ActionResult> Index(AcoesViewModel viewModel)
        {
            var query = db.Acoes.Include(a => a.Empresa).AsQueryable();

            if (!String.IsNullOrWhiteSpace(viewModel.CodigoNegociacao))
            {
                query = query.Where(a => a.CodigoNegociacao.Contains(viewModel.CodigoNegociacao));
            }

            viewModel.Resultados = await query.OrderBy(a => a.CodigoNegociacao).ToPagedListAsync(viewModel.Pagina, viewModel.TamanhoPagina);

            return(View(viewModel));
        }
Exemple #4
0
        public int Update(AcoesViewModel entity)
        {
            var item = m_AcoesService.GetById(entity.Id);

            if (item != null)
            {
                item.ACOES    = entity.Acoes;
                item.ICONE    = entity.Icone;
                item.LINK     = entity.Link;
                item.MODULOID = entity.Moduloid;
                item.ORDEM    = entity.Ordem;

                m_AcoesService.Update(item);
            }

            return(m_AcoesService.Commit());
        }