Ejemplo n.º 1
0
        public ActionResult PromoDetalhes(int idPromo, int idEmpresa)
        {
            var view          = new ViewModel.Empresa.EmpresaPromoDetralhes();
            var RN            = new ZRN.Promocoes.Promocoes(Configuracoes.ServidorElastic, Configuracoes.IndexElastic);
            var dadosPromocao = RN.RetornaPromocaoDetalhe(idPromo, idEmpresa);

            view.promocao = dadosPromocao;

            var emppresa = new ZRN.Empresas.Empresas();
            var dadosEmp = emppresa.RetornaPerfilEmpresa(idEmpresa);

            view.idEmpresa   = dadosEmp.idempresa;
            view.NomeEmpresa = dadosEmp.nome;

            if (dadosPromocao != null && dadosPromocao.empresas != null)
            {
                List <string> listaEmpresas = new List <string>();
                foreach (var emp in dadosPromocao.empresas)
                {
                    listaEmpresas.Add(emp.nome);
                }
                view.empresas = String.Join(", ", listaEmpresas);
            }

            if (dadosPromocao == null)
            {
                view = null;
            }

            return(View(view));
        }
Ejemplo n.º 2
0
        // GET: Empresa/RedesSociais/5
        public ActionResult RedesSociais(int id)
        {
            int idcliente = ((Usuario)Session["usuario"]).idCliente;

            var RNCliente = new ZRN.Clientes.Clientes();

            var verificarAcesso = RNCliente.VerificaAcessoEmpresaVertente(ZRN.Vertentes.enumVertentes.RedesSociais, id, idcliente);

            if (verificarAcesso)
            {
                var RN = new ZRN.Empresas.Empresas();

                var RNSocial          = new ZRN.RedesSociais.Facebook.Facebook();
                var RNSocialTw        = new ZRN.RedesSociais.Twitter.Twitter();
                var RNSocialInsta     = new ZRN.RedesSociais.Instagram.Instagram();
                var RNSocialYoutube   = new ZRN.RedesSociais.Youtube.Youtube();
                var RNtemRedesSociais = new ZRN.RedesSociais.RedesSociais();

                var empresaView = new ViewModel.Empresa.EmpresaSocial();
                empresaView.Empresa                = RN.RetornaPerfilEmpresa(id);
                empresaView.TotalSeguidoresFace    = RNSocial.RetornaSeguidores(id);
                empresaView.TotalSeguidoresTw      = RNSocialTw.RetornaSeguidores(id);
                empresaView.TotalSeguidoresInsta   = RNSocialInsta.RetornaSeguidoresInsta(id);
                empresaView.TotalSeguidoresYoutube = RNSocialYoutube.RetornaSeguidoresYoutube(id);

                empresaView.temRedesSocias = RNtemRedesSociais.VerificaRedesSociaisEmpresas(id);

                return(View(empresaView));
            }
            else
            {
                return(RedirectToAction("redessociais_semAcesso", "Empresa"));
            }
        }
Ejemplo n.º 3
0
        public ActionResult PresencaOnline(int id)
        {
            ViewBag.idEmpresa = id;
            var rn         = new ZRN.Empresas.Noticias();
            var rnempresas = new ZRN.Empresas.Empresas();

            int idcliente = ((Usuario)Session["usuario"]).idCliente;
            var RNCliente = new ZRN.Clientes.Clientes();

            var verificarAcesso = RNCliente.VerificaAcessoEmpresaVertente(ZRN.Vertentes.enumVertentes.PresencaOnline, id, idcliente);

            if (verificarAcesso)
            {
                var noticiaView = new ViewModel.Empresa.EmpresaNoticias();

                noticiaView.noticiafonteempresa = rn.RetornaFonteNotciasEmpresa(id);
                noticiaView.empresa             = rnempresas.RetornaDescricaoEmpresa(id);

                return(View(noticiaView));
            }

            else
            {
                return(RedirectToAction("PresencaOnline_semAcesso", "Empresa"));
            }
        }
Ejemplo n.º 4
0
        public ActionResult Noticia_Detalhe(int id, string textoPesquisado = "")
        {
            var rn         = new ZRN.NoticiasElastic.NoticiasElastic(Configuracoes.ServidorElastic, Configuracoes.IndexElastic);
            var rnempresas = new ZRN.Empresas.Empresas();

            var view = new ViewModel.Empresa.EmpresaNoticiaDetalhe();

            view.noticia = rn.RetornaNoticiaEmpresa(id, textoPesquisado);

            var idEmpresa = (from e in view.noticia.empresas
                             where e.idnoticiaempresa == id
                             select e.idempresa).FirstOrDefault();

            view.empresa = rnempresas.RetornaDescricaoEmpresa(idEmpresa);

            ViewBag.idEmpresa = idEmpresa;

            ViewBag.LayoutTopo = "EmpresaNoticiaDetalhe";

            //ViewBag.NomeEmpresa = view.noticia.empresas.FirstOrDefault().nomeempresa;
            //ViewBag.IdEmpresa = view.noticia.empresas.FirstOrDefault().idempresa;
            ViewBag.NomeEmpresa = view.noticia.empresas.Where(x => x.idempresa == idEmpresa).Select(x => x.nomeempresa).FirstOrDefault();
            ViewBag.IdEmpresa   = idEmpresa;
            return(View(view));
        }
Ejemplo n.º 5
0
        public ActionResult NoticiaDetalhesPromo(int idNoticia, int idPromo, int idEmpresa)
        {
            var rn         = new ZRN.NoticiasElastic.NoticiasElastic(Configuracoes.ServidorElastic, Configuracoes.IndexElastic);
            var view       = new ViewModel.Empresa.EmpresaNoticiaDetalhe();
            var rnempresas = new ZRN.Empresas.Empresas();

            view.noticia = rn.GetNoticiaPromocao(idNoticia);
            view.empresa = rnempresas.RetornaDescricaoEmpresa(idEmpresa);

            ViewBag.idEmpresa = idEmpresa;

            ViewBag.LayoutTopo  = "PromoNoticiaDetalhe";
            ViewBag.NomeEmpresa = view.empresa.nome;
            ViewBag.IdEmpresa   = idEmpresa;
            ViewBag.IdPromocao  = idPromo;

            return(View("Noticia_Detalhe", view));
        }
Ejemplo n.º 6
0
        // GET: Empresa/Perfil/5
        public ActionResult Perfil(int id)
        {
            int idcliente = ((Usuario)Session["usuario"]).idCliente;

            var RN         = new ZRN.Empresas.Empresas();
            var RNclientes = new ZRN.Clientes.Clientes();

            if (RNclientes.VerificaAcessoEmpresa(id, idcliente) == true)
            {
                var empresaPerfil = new ViewModel.Empresa.EmpresaPerfil();
                empresaPerfil.Empresa          = RN.RetornaPerfilEmpresa(id);
                empresaPerfil.VertentesCliente = RNclientes.RetornaVertentesAssociada(idcliente);

                return(View(empresaPerfil));
            }
            else
            {
                return(RedirectToAction("SemcessoPerfil", "Empresa"));
            }
        }
Ejemplo n.º 7
0
        // GET: Empresa/Perfil/5
        public ActionResult LancamentoProduto(int id)
        {
            int idcliente = ((Usuario)Session["usuario"]).idCliente;

            var RNCliente = new ZRN.Clientes.Clientes();

            var verificarAcesso = RNCliente.VerificaAcessoEmpresaVertente(ZRN.Vertentes.enumVertentes.Produtos, id, idcliente);

            if (verificarAcesso)
            {
                var RN          = new ZRN.Empresas.Empresas();
                var empresaView = new ViewModel.Empresa.EmpresaLancamento();
                empresaView.Empresa = RN.RetornaPerfilEmpresa(id);

                return(View(empresaView));
            }
            else
            {
                return(RedirectToAction("produtos_semAcesso", "Empresa"));
            }
        }
Ejemplo n.º 8
0
        public ActionResult Promo(int id)
        {
            int idcliente = ((Usuario)Session["usuario"]).idCliente;

            var RNCliente = new ZRN.Clientes.Clientes();

            var verificarAcesso = RNCliente.VerificaAcessoEmpresaVertente(ZRN.Vertentes.enumVertentes.Promocoes, id, idcliente);

            if (verificarAcesso)
            {
                var RNEmpresa = new ZRN.Empresas.Empresas();

                ViewBag.idEmpresa = id;

                var empPromoView = new ViewModel.Empresa.EmpresaPromocoes();
                empPromoView.Empresa = RNEmpresa.RetornaPerfilEmpresa(id);
                return(View(empPromoView));
            }
            else
            {
                return(RedirectToAction("Promo_semAcesso", "Empresa"));
            }
        }
Ejemplo n.º 9
0
        public ActionResult NoticiaDetalhes(int id, int idPromo)
        {
            var rn         = new ZRN.NoticiasElastic.NoticiasElastic(Configuracoes.ServidorElastic, Configuracoes.IndexElastic);
            var rnempresas = new ZRN.Empresas.Empresas();

            var view = new ViewModel.Empresa.EmpresaNoticiaDetalhe();

            view.noticia = rn.RetornaNoticiaEmpresa(id);

            var idEmpresa = (from e in view.noticia.empresas
                             where e.idnoticiaempresa == id
                             select e.idempresa).FirstOrDefault();

            view.empresa = rnempresas.RetornaDescricaoEmpresa(idEmpresa);

            ViewBag.idEmpresa = idEmpresa;

            ViewBag.LayoutTopo  = "PromoNoticiaDetalhe";
            ViewBag.NomeEmpresa = view.noticia.empresas.FirstOrDefault().nomeempresa;
            ViewBag.IdEmpresa   = view.noticia.empresas.FirstOrDefault().idempresa;
            ViewBag.IdPromocao  = idPromo;

            return(View("Noticia_Detalhe", view));
        }