Пример #1
0
        public List <uporabnik> emailuporabnika(int idu)
        {
            List <uporabnik> uporabnik = new List <uporabnik>();

            using (NpgsqlConnection con = new NpgsqlConnection(connect))
            {
                con.Open();

                NpgsqlCommand    com    = new NpgsqlCommand("SELECT * FROM emailselect(" + idu + ") ", con);
                NpgsqlDataReader reader = com.ExecuteReader();

                while (reader.Read())
                {
                    string Email = reader.GetString(0);

                    uporabnik nova = new uporabnik(Email);
                    uporabnik.Add(nova);
                }
                con.Close();
                return(uporabnik);
            }
        }
Пример #2
0
        public List <uporabnik> iduporabnika(string email, string geslo)
        {
            List <uporabnik> uporabnik = new List <uporabnik>();

            using (NpgsqlConnection con = new NpgsqlConnection(connect))
            {
                con.Open();

                NpgsqlCommand    com    = new NpgsqlCommand("SELECT iduporabnika('" + email + "','" + geslo + "') ", con);
                NpgsqlDataReader reader = com.ExecuteReader();

                while (reader.Read())
                {
                    int Id = reader.GetInt32(0);

                    uporabnik nova = new uporabnik(Id);
                    uporabnik.Add(nova);
                }
                con.Close();
                return(uporabnik);
            }
        }