Beispiel #1
0
        public Boolean userValidate(CEuser oCEUser)
        {
            bool result = false;
            String procedure = "spGetUser";
            try
            {
                SqlConnection oSqlConnection = new SqlConnection();
                CDConnection oCDConnection = new CDConnection();
                oSqlConnection= oCDConnection.openDB();
                SqlCommand oSqlCommand = oSqlConnection.CreateCommand();
                oSqlCommand.CommandText = procedure;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.Add("@id",SqlDbType.VarChar,25).Value=oCEUser.id_usuario;
                oSqlCommand.Parameters.Add("@clave", SqlDbType.VarChar, 25).Value = oCEUser.clave;
                SqlDataReader oSqlDataReader= oSqlCommand.ExecuteReader();
                if (oSqlDataReader.HasRows)
                {
                   result = true;
                }

                return result;
            }
            catch(Exception e)
            {
                e.ToString();
                return result;
            }
        }
Beispiel #2
0
 public bool validateUSer(string email , string clave)
 {
     CEuser oCEuser = new CEuser();
     oCEuser.id_usuario = email.Trim();
     oCEuser.clave = clave.Trim();
     oCEuser.id_Rol = "";
     return oCDUser.userValidate(oCEuser);
 }