Esempio n. 1
0
        private tbBannerBusca CastBannerBusca(BannerBuscaEntity banner)
        {
            tbBannerBusca tb = new tbBannerBusca();

            tb.Ativo       = banner.Ativo;
            tb.dataAte     = banner.dataAte;
            tb.dataDe      = banner.dataDe;
            tb.estado      = banner.estado;
            tb.idCliente   = banner.idCliente;
            tb.idCategoria = banner.idCategoria;
            tb.responsavelUltimaAlteracao = banner.responsavelUltimaAlteracao;
            tb.DataUltimaAlteracao        = banner.DataUltimaAlteracao;

            return(tb);
        }
Esempio n. 2
0
 public void AtualizaFilePathImagemBannerBusca(int idBannerBusca, string filePath)
 {
     try
     {
         using (var context = new CirculoNegocioEntities())
         {
             tbBannerBusca banner = (from p in context.tbBannerBuscas where p.id == idBannerBusca select p).First();
             banner.imagemFilePath = filePath;
             context.SaveChanges();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
        public bool DeletaBannerBusca(int id)
        {
            try
            {
                using (var context = new CirculoNegocioEntities())
                {
                    tbBannerBusca delete = (from p in context.tbBannerBuscas where p.id == id select p).First();
                    context.tbBannerBuscas.DeleteObject(delete);
                    context.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 4
0
        public int InsereBannerBusca(BannerBuscaEntity banner)
        {
            int idBannerBusca = 0;

            try
            {
                using (var context = new CirculoNegocioEntities())
                {
                    tbBannerBusca tb = CastBannerBusca(banner);
                    context.tbBannerBuscas.AddObject(tb);
                    context.SaveChanges();

                    idBannerBusca = tb.id;
                }


                return(idBannerBusca);
            }
            catch (Exception)
            {
                return(0);
            }
        }