private void button3_Click(object sender, EventArgs e) { try { using (Form2 f2 = new Form2((classBindingSource.DataSource as List <Class>), string.Format("{0}", total), // string.Format("{0}", txtCash.Text), // string.Format("{0}", Convert.ToInt16(txtCash.Text) - total), DateTime.Now.ToString("{0:d/M/yyyy HH:mm:ss}") )) { f2.ShowDialog(); } dataGridView2.Rows.Clear(); this.Close(); //txtTotal.Text = string.Empty; //txtDisc.Text = string.Empty; //txtCash.Text = string.Empty; Order a = new Order(); a.Show(); } catch (Exception) { MessageBox.Show("Cant print untill all data is inserted", "Printing Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button14_Click(object sender, EventArgs e) { Order Order1 = new Order(); Order1.Show(); }