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); }
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)); }
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)); }
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)); }
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)); }