Exemplo n.º 1
0
        //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);
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Invokes the RunQuery event if it has subscribers
 /// </summary>
 private void OnRunClicked(object sender, EventArgs e)
 {
     RunQuery?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 7
0
 public List <Hashtable> ReturnQueryResults(PagingData pagData, bool refresh, string baseclass, Hashtable attributeList)
 {
     return(RunQuery.ReturnResults(pagData, refresh, baseclass, attributeList));
 }
Exemplo n.º 8
0
 public long[] ExecuteQueryResults(OMQuery omQuery)
 {
     return(RunQuery.ExecuteQuery(omQuery));
 }
Exemplo n.º 9
0
 public static List <Hashtable> ExecuteQueryResults(OMQuery omQuery, PagingData pgData, bool refresh, Hashtable attributeList)
 {
     RunQuery.ExecuteQuery(omQuery);
     return(ReturnQueryResults(pgData, refresh, omQuery.BaseClass, attributeList));
 }