//This is the Find button private void findButton_Click(object sender, EventArgs e) { if (!IsLockedMode) { if (!String.IsNullOrEmpty(queryBox.Text)) { this.QueryString = queryBox.Text; RunQuery?.Invoke(this, EventArgs.Empty); } } else { this.QueryString = CreateQueryString(); //MessageBox.Show(QueryString); RunQuery?.Invoke(this, EventArgs.Empty); } }
public IEnumerable <Product> GetAll() { SqlDataReader reader; using (SqlCommand command = new SqlCommand()) { command.CommandText = "select id from product"; reader = new RunQuery(command).RetrieveRows(); } while (reader.Read()) { Product product = BuildProduct(reader); Items.Add(product); } return(Items); }
public IEnumerable <ProductOption> GetAll(Guid productId) { SqlDataReader reader; using (SqlCommand command = new SqlCommand()) { command.CommandText = "select id from productoption where productid = @productId"; command.Parameters.AddWithValue("productId", productId); reader = new RunQuery(command).RetrieveRows(); } while (reader.Read()) { ProductOption productOption = buildProductOption(reader); Items.Add(productOption); } return(Items); }
public IEnumerable <Product> GetProduct(String name) { SqlDataReader reader; using (SqlCommand command = new SqlCommand()) { command.CommandText = "select id from product where lower(name) like '%@name%'"; command.Parameters.AddWithValue("name", name.ToLower()); reader = new RunQuery(command).RetrieveRows(); } while (reader.Read()) { Product product = BuildProduct(reader); Items.Add(product); } return(Items); }
public ProductOption GetOption(Guid id) { SqlDataReader reader; using (SqlCommand command = new SqlCommand()) { command.CommandText = "select * from productoption where id = @id"; command.Parameters.AddWithValue("id", id); reader = new RunQuery(command).RetrieveRows(); } if (!reader.Read()) { return(null); } ProductOption option = buildProductOption(reader); return(option); }
/// <summary> /// Invokes the RunQuery event if it has subscribers /// </summary> private void OnRunClicked(object sender, EventArgs e) { RunQuery?.Invoke(this, EventArgs.Empty); }
public List <Hashtable> ReturnQueryResults(PagingData pagData, bool refresh, string baseclass, Hashtable attributeList) { return(RunQuery.ReturnResults(pagData, refresh, baseclass, attributeList)); }
public long[] ExecuteQueryResults(OMQuery omQuery) { return(RunQuery.ExecuteQuery(omQuery)); }
public static List <Hashtable> ExecuteQueryResults(OMQuery omQuery, PagingData pgData, bool refresh, Hashtable attributeList) { RunQuery.ExecuteQuery(omQuery); return(ReturnQueryResults(pgData, refresh, omQuery.BaseClass, attributeList)); }