示例#1
0
        private void Cuelectrodomestico_DoubleClick(object sender, EventArgs e)
        {
            Variables.idProd = byte.Parse(dtELE.CurrentRow.Cells[3].Value.ToString());


            Form A = new FormComprar();

            A.Show();
        }
示例#2
0
        private void dtJu_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Variables.idProd = byte.Parse(dtJu.CurrentRow.Cells[3].Value.ToString());


            Form A = new FormComprar();

            A.Show();
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (cantidad.Value > 1)
            {
                string            message = "Desea Salir Sin Guardar?";
                string            caption = "Salir";
                MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                DialogResult      result;

                // Displays the MessageBox.

                result = MessageBox.Show(message, caption, buttons);

                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    Form A = new FormComprar();
                    this.Hide();
                }
            }
            else
            {
                string            message = "Desea Salir?";
                string            caption = "Salir";
                MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                DialogResult      result;

                // Displays the MessageBox.

                result = MessageBox.Show(message, caption, buttons);

                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    Form A = new FormComprar();
                    this.Hide();
                }
            }
        }
示例#4
0
        private void FormComprar_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                if (cantidad.Value > 1)
                {
                    string            message = "Desea Salir Sin Guardar?";
                    string            caption = "Salir";
                    MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                    DialogResult      result;

                    // Displays the MessageBox.

                    result = MessageBox.Show(message, caption, buttons);

                    if (result == System.Windows.Forms.DialogResult.Yes)
                    {
                        Form A = new FormComprar();
                        this.Hide();
                    }
                }
                else
                {
                    string            message = "Desea Salir?";
                    string            caption = "Salir";
                    MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                    DialogResult      result;

                    // Displays the MessageBox.

                    result = MessageBox.Show(message, caption, buttons);

                    if (result == System.Windows.Forms.DialogResult.Yes)
                    {
                        Form A = new FormComprar();
                        this.Hide();
                    }
                }
            }

            if (e.KeyCode == Keys.Enter)
            {
                string            message = "Desea Confirmar Su Compra?";
                string            caption = "Comprar";
                MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                DialogResult      result;

                // Displays the MessageBox.

                result = MessageBox.Show(message, caption, buttons);

                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    dcTiendaDataContext dc = new dcTiendaDataContext();
                    dc.ConsultarCompras(
                        txtNombre.Text,
                        txtDescripcion.Text,
                        int.Parse(txtnp.Text.ToString()),
                        int.Parse(cantidad.Value.ToString()),
                        int.Parse(txtTo.Text.ToString()),
                        txtCliente.Text


                        );

                    MessageBox.Show("Producto Agregado al Carrito");
                }
            }
        }