Example #1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            string Mensaje;

            if (txtCosto.Text != "" && txtPed.Text != "" && txtTotal.Text != "" && txtVenta.Text != "")
            {
                Ven.setCosto(float.Parse(txtCosto.Text.ToString()));
                Ven.setEstado(true);
                Ven.setIdPed(int.Parse(txtPed.Text.ToString()));
                Ven.setPrecioV(float.Parse(txtTotal.Text.ToString()));
                Ven.setGanancia(Ven.getPrecioV() - Ven.getCosto());

                nv.datosVen(Ven);
                btnAceptar.Enabled = false;
                this.Close();
            }
            else
            {
                Mensaje = ConstruirMensaje();
                MessageBox.Show("Faltan Cargar: " + Mensaje, "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }