private void btn_canjear_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txt_nro_doc.Text))
               error=error+"El campo DNI no puede estar incompleto.\n";
            else
                if (!Information.IsNumeric(txt_nro_doc.Text.Trim()))
                 error=error+"Debe Ingresar un valor numerico.\n";

            if(cb_productos.SelectedItem == null){
                error = error + "Debe seleccionar el producto a canjear.\n";
            }

            if (error != "")
            {
                MessageBox.Show(error);
                error = "";
                return;
            }

            Producto producto = (Producto)cb_productos.SelectedItem;
            if (producto.Cantidad < Convert.ToInt32(num_cantidad.Value))
            {
               MessageBox.Show("No hay suficiente stock.\n" + "El stock disponible para " + producto.Nombre + " es de " + producto.Cantidad);
               return;
            }

            int millas = new MillaDAO().Calcular_Millas(Convert.ToInt32(txt_nro_doc.Text));
            int millas_necesarias = producto.Cantidad_millas;
            if (millas < millas_necesarias)
            {
                MessageBox.Show("No tiene suficientes millas");
                return;
            }

            Cliente cliente = new ClienteDAO().Cliente_FindByDni(Convert.ToInt32(txt_nro_doc.Text));

            new ProductoDAO().RestarCantidad(Convert.ToInt32(num_cantidad.Value), cb_productos.Text,cliente.Id);
            MessageBox.Show("Canje realizado con exito");

            Main form = new Main();
            this.Hide();
            form.Show();
        }
 private void btn_calcular_total_millas_Click(object sender, EventArgs e)
 {
     int resultado=new MillaDAO().Calcular_Millas(Convert.ToInt32(txt_documento.Text));
     txt_total_millas.Text = resultado.ToString();
 }