コード例 #1
0
ファイル: HomeController.cs プロジェクト: tematek/Projeto
        public ActionResult Contato()
        {
            ContactModel contModel = new ContactModel();

            Usuario User = new Usuario();

            //Verificar se usuário está logado.

            bool Resp = User.getUsuarioLogado();

            //Método retornou false => usuário não está logado.
            if (Resp == false)
            {
                Login log = new Login();
                log.Result = "É necessário logar para entrar em contato conosco.";
                return View("Entrar", log);
            }

            return View(contModel);
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: tematek/Projeto
        public ActionResult Encontrei()
        {
            Usuario User = new Usuario();

            //Verificar se usuário está logado.

            bool Resp = User.getUsuarioLogado();

            //Método retornou false => usuário não está logado.
            if (Resp == false)
            {
                Login log = new Login();
                log.Result = "É necessário logar para cadastrar um item.";
                return View("Entrar", log);
            }
            //Método retornou true => usuário está logado.
            else
            {
                //Busca ESTADOS
                ViewBag.idUF = new SelectList
                (
                    new CascataEncontreiPerdi().ListaUF(),
                    "idUF",
                    "UF"
                );
                //Busca CATEGORIAS
                ViewBag.idCategoria = new SelectList
                (
                    new CascataEncontreiPerdi().ListaCategoria(),
                    "idCategoria",
                    "Cat"
                );

                return View();
            }
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: tematek/Projeto
 public ActionResult Entrar(Login logon)
 {
     return View(logon);
 }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: tematek/Projeto
        public ActionResult ValidaLogon(string EmailID, string SenhaID)
        {
            Usuario User = new Usuario();

            string Retorn;

            User.DetalhaUsuario(EmailID, SenhaID, out Retorn);

            if (Retorn.Contains("ERRO") == true)
            {

                Login log = new Login();

                log.Result = Retorn;

                return View("Entrar", log);

            }
            else
            {
                return View("Index");

            }
        }
コード例 #5
0
ファイル: HomeController.cs プロジェクト: tematek/Projeto
        public ActionResult ValidaCadastro(string Nome, string SobreNome, 
            string Cpf, string Tel, string Cel,
            string Email, string Senha, string ConfirmSenha)
        {
            CamposCadastro CCadastro = new CamposCadastro();
            ParametrosCadastro PC = new ParametrosCadastro();

            string Retorn;

            Retorn = PC.ValidaCamposCadastros(Nome,SobreNome,Cpf,
                Tel.Replace("-",""),Cel.Replace("-",""),Email,Senha,ConfirmSenha);

            if (Retorn.Contains("ERRO") == true)
            {

                CCadastro.ResultadoCadastro = Retorn;

                return View("Cadastro", CCadastro);

            }
            else
            {

                Retorn = PC.InsereCadastro(Nome, SobreNome, Cpf.Replace(".","").Replace("-",""),
                    Tel.Replace("-", ""), Cel.Replace("-", ""), Email, Senha, ConfirmSenha);

                if (Retorn.Contains("ERRO") == true)
                {

                    CCadastro.ResultadoCadastro = Retorn;

                    return View("Cadastro", CCadastro);

                }

                Login log = new Login();

                log.Result = Retorn;

                return View("Entrar", log);

            }
        }
コード例 #6
0
ファイル: HomeController.cs プロジェクト: tematek/Projeto
        public ActionResult MapaPerdi()
        {
            Usuario User = new Usuario();

            //Verificar se usuário está logado.

            bool Resp = User.getUsuarioLogado();

            //Método retornou false => usuário não está logado.
            if (Resp == false)
            {
                Login log = new Login();
                log.Result = "É necessário logar para cadastrar um item.";
                return View("Entrar", log);
            }
            else
            {
                return View();
            }
        }