private void button2_Click(object sender, EventArgs e) { Cashier currentCashier = BusinessCashier.GetCurrentCashier(); if (currentCashier != null) { CurrentCashier cashier = new CurrentCashier { MdiParent = this.MdiParent }; cashier.Show(); } else { MessageBox.Show("Debe abrir una nueva caja"); } }
// Método para crear una nueva caja private void nuevaCajaToolStripMenuItem_Click(object sender, EventArgs e) { try { Cashier cashier = BusinessCashier.OpenCashier(); if (cashier == null) { MessageBox.Show("Error abriendo la caja, inténtelo de nuevo"); } else { CurrentCashier currentCashier = new CurrentCashier { MdiParent = this.MdiParent }; currentCashier.Show(); } } catch (ArgumentException ex) { MessageBox.Show(ex.Message); } }