コード例 #1
0
ファイル: Broker.cs プロジェクト: lazarmiric/AvioKompanija
        public bool izmeniSa(IDomenskiObjekat objekat)
        {
            SqlCommand command = new SqlCommand("", connection, transaction);

            command.CommandText = $"UPDATE {objekat.Table} SET {objekat.Uslov()} {objekat.SearchWhere()}";
            return(command.ExecuteNonQuery() == 1);
        }
コード例 #2
0
        public List <IDomenskiObjekat> VratiSvePoKriterijumu(IDomenskiObjekat objekat, Automobil automobil)
        {
            SqlCommand command = new SqlCommand("", connection);

            command.CommandText = $"{objekat.Get} {objekat.FullTable} {objekat.SearchWhere(automobil.AutomobilID.ToString())}";
            SqlDataReader reader = command.ExecuteReader();

            return(objekat.GetReaderResult(reader));
        }
コード例 #3
0
ファイル: Broker.cs プロジェクト: tatjana252/Vezbe13
        public List <IDomenskiObjekat> Search(string criteria, IDomenskiObjekat objekat)
        {
            SqlCommand command = new SqlCommand();

            command.Transaction = transaction;
            command.Connection  = connection;
            command.CommandText = $"select * from {objekat.Table} {objekat.Join} {objekat.SearchWhere(criteria)}";
            SqlDataReader reader = command.ExecuteReader();

            return(objekat.GetReaderResult(reader));
        }
コード例 #4
0
        public List <IDomenskiObjekat> Login(IDomenskiObjekat objekat)
        {
            Radnik     radnik  = (Radnik)objekat;
            SqlCommand command = new SqlCommand("", connection);

            command.CommandText = $"{objekat.Get} {objekat.Table} " +
                                  $"{objekat.SearchWhere(radnik.KorisnickoIme, radnik.Sifra)} ";
            SqlDataReader reader = command.ExecuteReader();

            return(objekat.GetReaderResult(reader));
        }
コード例 #5
0
        public List <IDomenskiObjekat> Pretrazi(IDomenskiObjekat objekat)
        {
            SqlCommand command = new SqlCommand("", connection, transaction);

            command.CommandText = $"{objekat.Get} {objekat.FullTable} {objekat.Join} {objekat.SearchWhere(objekat.Kriterijum)} {objekat.GroupBy}";
            SqlDataReader reader = command.ExecuteReader();

            return(objekat.GetReaderResult(reader));
        }