private void txt_SearchCst_TextChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_SearchCst.Text)) { FormControls.BindData(dgv_Customers, command: defaultCustomersCommand); } }
private void txt_Search_TextChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_Search.Text)) { FormControls.BindData(dgv_Products, command: defaultProductsCommand); } }
private void txt_Search_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && !string.IsNullOrEmpty(txt_Search.Text)) { SqlCommand command = new SqlCommand("select * from product where product_id = '" + txt_Search.Text + "' OR name LIKE '" + txt_Search.Text + "%' OR brand = '" + txt_Search.Text + "' OR type = '" + txt_Search.Text + "' OR subtype = '" + txt_Search.Text + "'", FormControls.DbConnection); FormControls.BindData(dgv_Products, command: command); } }
private void txt_SearchCst_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && !string.IsNullOrEmpty(txt_Search.Text)) { SqlCommand command = new SqlCommand("select * from customer where name LIKE '" + txt_SearchCst.Text + "%' OR surname LIKE '" + txt_SearchCst.Text + "%' OR address LIKE '" + txt_SearchCst.Text + "%' OR phone_number = '" + txt_SearchCst.Text + "' OR email = '" + txt_SearchCst.Text + "' OR type = '" + txt_SearchCst.Text + "'", FormControls.DbConnection); FormControls.BindData(dgv_Customers, command: command); } }
private void NewOrder_Load(object sender, EventArgs e) { order = new Order(DateTime.Now); gb_NewCst.Enabled = false; FormControls.HideDGVColumns(dgv_Customers.Columns[0], dgv_Customers.Columns[7], dgv_Products.Columns[2]); FormControls.SetComboboxDefaultValue(cBoxType); FormControls.BindData(dgv_Customers, command: defaultCustomersCommand); FormControls.BindData(dgv_Products, command: defaultProductsCommand); }