Beispiel #1
0
        public ActionResult ListaRecibosDoDia()
        {
            ViewBag.Usuario = GetUsuarioSession().Item1;
            ValidaAutorizaoAcessoUsuario(Constants.ConstPermissoes.gerenciamento);

            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            try
            {
                var resultService = _fluxoCaixaProxy.ListRecibosDoDia();

                var list = resultService.Value;

                msgExibicao = resultService.Message;
                msgAnalise  = !resultService.Status ? "Falha!" : string.Empty;

                return(PartialView("_GridRecibos", list));
            }
            catch (Exception ex)
            {
                var msgsRetornos = ErrosService.GetMensagemService(ex, HttpContext.Response);
                msgExibicao = msgsRetornos.Item1;
                msgAnalise  = !string.IsNullOrEmpty(msgsRetornos.Item2) ? msgsRetornos.Item2 : Constants.Constants.msgFalhaAoListar;
            }

            var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);

            return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public ActionResult Listagem()
        {
            var userInfo = GetUsuarioSession();

            if (!userInfo.Item2)
            {
                return(RedirectToAction("Login", "Login", new { area = "" }));
            }

            ViewBag.Usuario = userInfo.Item1;

            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            try
            {
                var resultService = _agendaContatoBusiness.ListContatosUsuario(userInfo.Item1.Id);
                var list          = resultService.Value;

                msgExibicao = resultService.Message;
                msgAnalise  = !resultService.Status ? "Falha!" : string.Empty;

                return(PartialView("_Listagem", list));
            }
            catch (Exception ex)
            {
                msgExibicao = Model.Common.Constants.msgFalhaAoCarregar;
                msgAnalise  = ex.ToString();
            }

            var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);

            return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult Salvar(TelefoneModel model)
        {
            var userInfo = GetUsuarioSession();

            if (!userInfo.Item2)
            {
                return(RedirectToAction("Login", "Login", new { area = "" }));
            }

            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            try
            {
                var resultService = _agendaContatoBusiness.SalvarTelefone(model);

                msgExibicao = resultService.Message;
                msgAnalise  = !resultService.Status ? "Falha!" : string.Empty;
            }
            catch (Exception ex)
            {
                msgExibicao = Model.Common.Constants.msgFalhaAoSalvar;
                msgAnalise  = ex.ToString();
            }

            var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);

            return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
        public ActionResult ListaAgendaDoDia()
        {
            ViewBag.Usuario = GetUsuarioSession().Item1;

            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            try
            {
                var resultService = _agendaProxy.ListAgendaDoDia();

                var list = FiltraListaPorPerfil(resultService.Value);

                msgExibicao = resultService.Message;
                msgAnalise  = !resultService.Status ? "Falha!" : string.Empty;

                return(PartialView("_GridConsultas", list));
            }
            catch (Exception ex)
            {
                var msgsRetornos = ErrosService.GetMensagemService(ex, HttpContext.Response);
                msgExibicao = msgsRetornos.Item1;
                msgAnalise  = !string.IsNullOrEmpty(msgsRetornos.Item2) ? msgsRetornos.Item2 : Constants.Constants.msgFalhaAoListar;
            }

            var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);

            return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Cadastrar(UsuarioModel model)
        {
            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            if (ModelState.IsValid) //verifica se é válido
            {
                try
                {
                    var resultService = _usuarioBusiness.Salvar(model);

                    msgExibicao = resultService.Message;
                    msgAnalise  = !resultService.Status ? "Falha" : string.Empty;
                }
                catch (Exception ex)
                {
                    //var msgsRetornos = ErrosService.GetMensagemService(ex, HttpContext.Response);
                    msgExibicao = Model.Common.Constants.msgFalhaAoSalvar;
                    msgAnalise  = ex.ToString();
                }

                var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);
                return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(PartialView("_NovoUsuario", model));
            }
        }
Beispiel #6
0
        public ActionResult Autenticar(UsuarioModel model)
        {
            var mensagens = new Mensagens();

            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            var resultService = new ResultModel <UsuarioModel>();

            resultService.Status = false;

            try
            {
                resultService = _usuarioBusiness.Autenticar(model);
                model         = resultService.Value;

                if (resultService.Status)
                {
                    session.AddModelToSession(model, sessionName);
                }

                msgExibicao = resultService.Message;
                msgAnalise  = !resultService.Status ? "Falha" : string.Empty;
            }
            catch (Exception ex)
            {
                msgExibicao = "Falha ao autenticar!";
                msgAnalise  = ex.ToString();
            }

            var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);

            return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Listagem()
        {
            ValidaAutorizaoAcessoUsuario(Constants.ConstPermissoes.administracao);

            var userInfo = GetUsuarioSession();

            if (!userInfo.Item2)
            {
                return(RedirectToAction("Login", "Login", new { area = "" }));
            }

            ViewBag.Usuario = userInfo.Item1;

            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            try
            {
                var list = new List <FuncionarioModel>();

                var resultService = _cadastroProxy.ListFuncionario();
                list = resultService.Value;

                msgExibicao = resultService.Message;
                msgAnalise  = !resultService.Status ? "Falha!" : string.Empty;

                list = ConfiguraListaExibicao(list);

                return(PartialView("_Listagem", list));
            }
            catch (Exception ex)
            {
                var msgsRetornos = ErrosService.GetMensagemService(ex, HttpContext.Response);
                msgExibicao = msgsRetornos.Item1;
                msgAnalise  = !string.IsNullOrEmpty(msgsRetornos.Item2) ? msgsRetornos.Item2 : Constants.Constants.msgFalhaAoListar;
            }

            var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);

            return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
        }
Beispiel #8
0
        public ActionResult Autenticar(UsuarioModel model)
        {
            var mensagens      = new Mensagens();
            var constPermissao = new Constants.ConstPermissoes();

            string msgExibicao = string.Empty;
            string msgAnalise  = string.Empty;

            var resultService = new Result <UsuarioModel>();

            resultService.Status = false;

            try
            {
                resultService = _UsuarioModelProxy.AutenticaUsuario(model);
                model         = resultService.Value;

                if (resultService.Status)
                {
                    session.AddModelToSession(model, sessionName);
                }

                msgExibicao = resultService.Message;
                msgAnalise  = !resultService.Status ? "Falha" : string.Empty;
            }
            catch (Exception ex)
            {
                var msgsRetornos = ErrosService.GetMensagemService(ex, HttpContext.Response);
                msgExibicao = msgsRetornos.Item1;
                msgAnalise  = !string.IsNullOrEmpty(msgsRetornos.Item2) ? msgsRetornos.Item2 : Constants.Constants.msgFalhaPadrao;
            }

            var mensagensRetorno = mensagens.ConfiguraMensagemRetorno(msgExibicao, msgAnalise);

            return(Json(new { mensagensRetorno }, JsonRequestBehavior.AllowGet));
        }