public static void EmployeeLogin()
        {
            Console.WriteLine("Enter Employee Id");
            int EmpId = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter Username:"******"Enter Password:"******"Employee Login Successful!");


                    EmployeeMenu.DisplayMenu();
                }
                else
                {
                    throw (new LoginException("Invalid Username or Password!"));
                }
            }
            catch (LoginException le)
            {
                Console.WriteLine(le.Message);
            }
        }
        public static void AdminLogin()
        {
            // write code to enable admin login and validate in business layer
            Console.WriteLine("Enter Username:"******"Enter Password:"******"Admin Login Successful!");
                    AdminMenu.DisplayMenu();
                }
                else
                {
                    throw (new LoginException("Invalid Username or Password!"));
                }
            }
            catch (LoginException le)
            {
                Console.WriteLine(le.Message);
            }
        }
Exemple #3
0
 public static bool VerificarVoto(Eleitor_DTO obj)
 {
     try
     {
         return(Login_DAL.VerificarVoto(obj));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #4
0
 public static string ValidarLogin(Login_DTO obj)
 {
     if (string.IsNullOrWhiteSpace(obj.Usuario))
     {
         return("CAMPO USUÁRIO VAZIO!");
     }
     if (string.IsNullOrWhiteSpace(obj.Senha))
     {
         return("CAMPO SENHA VAZIO!");
     }
     return(Login_DAL.ValidarLogin(obj));
 }
Exemple #5
0
        public static string ValidarLogin(Login_DTO obj)
        {
            if (string.IsNullOrWhiteSpace(obj.Usuario))
            {
                return("Campo usuário vazio!");
            }
            if (string.IsNullOrWhiteSpace(obj.Senha))
            {
                return("Campo senha vazio!");
            }

            return(Login_DAL.ValidarLogin(obj));
        }
Exemple #6
0
        public static string Login(Login_DTO obj)
        {
            if (string.IsNullOrWhiteSpace(obj.user))
            {
                throw new Exception("User Empty");
            }
            if (string.IsNullOrWhiteSpace(obj.senha))
            {
                throw new Exception("Password Empty");
            }
            string msg = Login_DAL.login(obj);

            return(msg);
        }
Exemple #7
0
 public static Eleitor_DTO ValidarEleitor(string cpf)
 {
     if (string.IsNullOrWhiteSpace(cpf))
     {
         throw new Exception("Campo CPF vazio!");
     }
     try
     {
         return(Login_DAL.ValidarEleitor(cpf));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #8
0
        public static pessoaDTO vldLogin(loginDTO obj)
        {
            if (string.IsNullOrWhiteSpace(obj.prpUsuario))
            //verifica se esta vazio, ou com espaço e se estiver da erro
            {
                throw new Exception("Informe seu nome de Usuário ou E-mail");
                //retorna uma excessao se der erro
            }
            if (string.IsNullOrWhiteSpace(obj.prpSenha))
            {
                throw new Exception("Informe sua Senha");
            }

            return(Login_DAL.vldLogin(obj));
        }
        public static string ValidarLogin(Login_DTO obj)
        {
            if (string.IsNullOrWhiteSpace(obj.Usuario))
            {
                return("Campo usuário Vazio");
            }
            if (string.IsNullOrWhiteSpace(obj.Senha))
            {
                return("Campo senha Vazio");
            }
            return(Login_DAL.Validar_Login(obj));
            //return "Sucesso!!";

            /*if (obj.Senha != confsenha)
             * {
             *  throw new Exception("Senhas Diferentes!!");
             * }*/
        }
Exemple #10
0
 public static bool ValidarLogin(Login_DTO obj)
 {
     try
     {
         if (string.IsNullOrWhiteSpace(obj.Usuario))
         {
             throw new Exception("Campo Usuário é obrigatório.");
         }
         if (string.IsNullOrWhiteSpace(obj.Senha))
         {
             throw new Exception("Campo Senha é obrigatório.");
         }
         return(Login_DAL.ValidarLogin(obj));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #11
0
        public static Login_DTO ValidarLogin(Login_DTO obj)
        {
            if (string.IsNullOrWhiteSpace(obj.Login) || obj.Login == "Digite seu usuário")
            {
                throw new Exception("Campo Usuário é obrigatório!");
            }
            if (string.IsNullOrWhiteSpace(obj.Senha) || obj.Senha == "Digite sua senha")
            {
                throw new Exception("Campo Senha é obrigatório!");
            }
            if (string.IsNullOrWhiteSpace(obj.ConfSenha) || obj.ConfSenha == "Confirme sua senha")
            {
                throw new Exception("Campo Confirmar Senha é obrigatório!");
            }

            if (obj.Senha == obj.ConfSenha)
            {
                return(Login_DAL.Login(obj));
            }
            else
            {
                throw new Exception("As senhas não conferem!");
            }
        }
Exemple #12
0
        public Login_BAL()
        {
            Login_DAL = new Login_DAL();

            JWT_Provider = new JWT_Provider();
        }