コード例 #1
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            ConsultaProducto consP = new ConsultaProducto();

            consP.Show();
        }
コード例 #2
0
        public void EvaluarTecla(object sender, KeyEventArgs e)
        {
            if (Key.F6 == e.Key)
            {
                ConsultaProducto cp = new ConsultaProducto();
                cp.Show();
            }
            if (Key.A == e.Key)
            {
                this.Close();
            }
            if (Key.F == e.Key)
            {
                RealizarVenta();
            }

            if (Key.F4 == e.Key)
            {
                AgregarProducto();
            }
            if (Key.D == e.Key)
            {
                if (dataGrid.Items.Count > 0)
                {
                    Mensaje.MensajeCaptura M = new Mensaje.MensajeCaptura("Eliminar producto", "Capture el # registro del producto a eliminar:", "S=Eliminar", "N=Cancelar", true, "int");
                    M.ShowDialog();
                    if (M.Opc)
                    {
                        if (M.valor != 0 && Vm.ListaProducto.Exists(c => c.Registro == M.valor))
                        {
                            Vm.valor = M.valor;   //registro a eliminar
                            Eliminar();
                        }
                        else
                        {
                            MessageBox.Show("No existe el # registro:" + M.valor.ToString(), "Mensaje");
                            Mensaje.MensajeCaptura Mm = new CapaPresentacion.Mensaje.MensajeCaptura("Eliminar producto", "Capture el # registro del producto a eliminar:", "S=Elimnar", "N=Cancelar", true, "int");
                            Mm.ShowDialog();
                        }
                    }
                }
            }
            if (Key.C == e.Key && dataGrid.Items.Count > 0)
            {
                CancelarVenta();
            }
        }