private void NewVentaExecuted(object sender, EventArgs e) { DataTable empresa = CEmpresa.Mostrar(); if (empresa.Rows.Count == 0) { MessageBox.Show("No existe Empresa Registrada, Primero registre una empresa"); return; } DataTable cla = CCodigo.ultimo(); if (cla.Rows.Count == 0) { MessageBox.Show("Ingrese una llave de dosificacion"); return; } Debug.Assert(venta == null); _Commands.VentaCommands.New.Enabled = false; // Disable new client command to prevent re-entrancy venta = new VVentas(Datos); venta.Commands = _Commands; this.ShowModalPanel(venta, DevComponents.DotNetBar.Controls.eSlideSide.Top); if (!_StartControl.Visible) { _StartControl.SlideOutButtonVisible = false; } }
private void CloseVentaDialog() { if (!_StartControl.Visible) { _StartControl.SlideOutButtonVisible = true; } _Commands.VentaCommands.New.Enabled = true; // Enable new client command this.CloseModalPanel(venta, DevComponents.DotNetBar.Controls.eSlideSide.Bottom); venta.Commands = null; venta.Dispose(); venta = null; }