private void button1_Click_1(object sender, EventArgs e) { Cashier cForm = new Cashier(); cForm.Tag = this; cForm.Show(this); Hide(); }
private void button1_Click(object sender, EventArgs e) { string mystr; addCustomerBTN.Visible = true; try { using (var obj = new Cashier()) { if (myDataView.RowFilter == "") { mystr = "[" + filterCB.Text + "]"; mystr += " = '" + filterTB.Text + "'"; myDataView.RowFilter = mystr; } else { mystr = myDataView.RowFilter + " and "; mystr += "[" + dataGridView1.CurrentCell.OwningColumn.HeaderText.ToString() + "]"; mystr += " = '" + dataGridView1.CurrentCell.Value.ToString() + "'"; myDataView.RowFilter = mystr; } } } catch (Exception ex) { string message = "Error!"; MessageBox.Show(message + ex.ToString()); } xyz.Close(); }