Example #1
0
        public Repository getRepository(Object id)
        {
            int mensagemId = (int)id;

            using (db = new PinheiroSereniContext())
            {
                Rpt03Repository r = (from p in db.Prospects
                                     join m in db.Mensagems on p equals m.Prospect
                                     join c in db.CorretorOnlines on m.CorretorOnline equals c
                                     where m.mensagemId == mensagemId
                                     select new Rpt03Repository
                {
                    mensagem = new Validate()
                    {
                        Code = 0
                    },
                    sessionId = System.Web.HttpContext.Current.Session.SessionID,
                    id = m.mensagemId,
                    mensagemEmail = m.mensagem,
                    email = p.email,
                    empreendimentoId = p.empreendimentoId,
                    nome = p.nome,
                    telefone = p.telefone,
                    dt_cadastro = m.dt_cadastro.Value,
                    nome_corretor = c.nome,
                    corretorId = m.corretorId,
                    tipo = "Atendimento por e-mail"
                }).FirstOrDefault();
                return(r);
            }
        }
        public ActionResult Rpt03DetailMens(int?index, string id, string pageSize)
        {
            if (AccessDenied(System.Web.HttpContext.Current.Session.SessionID))
            {
                return(RedirectToActionPermanent("Index", "Home"));
            }

            ControllerFactory <Rpt03Model> factory = new ControllerFactory <Rpt03Model>();
            Rpt03Repository r = (Rpt03Repository)factory.getRepository(int.Parse(id));

            return(View(r));
        }
        public ActionResult Rpt03DetailSms(int?index, string id, string pageSize)
        {
            if (AccessDenied(System.Web.HttpContext.Current.Session.SessionID))
            {
                return(RedirectToActionPermanent("Index", "Home"));
            }

            Rpt03Repository r = new Rpt03Repository()
            {
                mensagem = new Validate()
                {
                    Code        = 40,
                    Message     = "Esta funcionalidade não possuir detalhamento",
                    MessageBase = "Somente os itens Chat e Atendimento por E-Mail têm detalhes para exibir"
                }
            };

            return(View(r));
        }