Ver Mensaje Individual
  #1  
Antiguo 15-11-2017
Avatar de The Cid James
The Cid James The Cid James is offline
Miembro
NULL
 
Registrado: jun 2013
Posts: 129
Reputación: 11
The Cid James Va por buen camino
Enviar resultado de operaciones a base de datos

Buenas gente, estoy tratando de calcular unos valor de unas operaciones a la base de datos pero el post "se hace en blanco"
Este es el código del botón que debería hacer el post a la base de datos pero al precionarlo no pasa nada ni siquiera sale un error.

Código Delphi [-]
procedure Tfcantidad.BCokClick(Sender: TObject);
var
a: integer; // Cantidad de Articulos
d: integer; // N° de venta anterior
e: integer; // N° de venta actual
f: integer; // Precio Unitario
g: integer; // Precio total por prdoducto

begin
  fmodulo.tVentadetalle.Active := true;
  fmodulo.tProductos.Active := true;
  fmodulo.tVentadetalle.Insert;
  if (strtoint(Ecantidad.Text)<=0)
    then
      begin
        Application.MessageBox('El valor ingresado debe ser mayor a O', 'Drugstore',mb_yesno+mb_iconquestion);
      end
  else
    if Ecantidad.Text = not null
      then
        begin
        a := fmodulo.tVentadetalle.Fields.FieldByName('cantidad').AsInteger;
        d := fmodulo.qnumventa.Fields.FieldByName('id_venta').AsInteger;
        e := (d + 1);
        fmodulo.tVentadetalle ['id_ventas'] := IntToStr(e);
        fmodulo.tVentadetalle ['id_producto'] := fmodulo.tProductos ['id_producto'];
        f := fmodulo.tProductos.Fields.FieldByName('precio_vent').AsInteger;
        g := (a * f);
        fmodulo.tVentadetalle ['Precio_v'] := IntToStr(g);
        fmodulo.tVentadetalle ['cantidad'] := IntToStr(a);
        fmodulo.tVentadetalle.Post;
        fmodulo.tVentadetalle.Refresh;
        end;
  self.Close;
end;

Como siempre muchas gracias
__________________
We are told to remember the idea, not the man, because a man can fail. He can be caught, he can be killed and forgotten, but 400 years later, an idea can still change the world.
Responder Con Cita