Power Builder - URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

 
Vista:

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por ruth (5 intervenciones) el 09/11/2011 17:20:04
BUEN DIA A TODOS PLISSSSS.

TENGO MI BOLETA CREADA, NECESITO AGREGAR EL PROCEDIMIENTO DE REGISTRAR, CONSULTAR E IMPRIMIR BOLETA, EN POWER BUILDER 11.5.

ESTARE AGRADECIDA INFINITAMENTE.
SLDOS.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por hector (15 intervenciones) el 11/11/2011 16:59:18
Hola especificamente necesitas hacer un mantenimiento a una tabla maestro detalle? tienes algo avanzado (codigo) para ayudarte

saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por ruth (5 intervenciones) el 11/11/2011 17:06:54
Buenos dias gracias por la ayuda,


bueno te explico tengo una base de datos del mismo power builder 11.5 creado en el odbc.

tengo mi pantalla boleta, con dos datawindows q es dw_cabecera, y dw_detalle, todos los datos de cabecera y detalle ya la tengo validada. lo unico q necesito es el procedimiento de los tres botones: imprimir, registrar y consultar.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por hector (15 intervenciones) el 11/11/2011 17:20:46
if this.enabled = false then return

String ls_c_operacion, ls_c_local, ls_orden_compra
Long ll_fila, ll_contador

//tab_doc.selectedtab = 1
dw_det.accepttext()
dw_dat.accepttext()

if trigger event ue_validaciones() = 1 then

ll_fila = dw_dat.getrow()
ls_c_operacion = dw_dat.getitemstring(ll_fila, 'c_operacion')
ls_c_local = dw_dat.getitemstring(ll_fila, 'c_local')
ls_orden_compra = dw_dat.getitemstring(ll_fila, 'orden_compra')


for ll_contador = 1 to dw_det.rowcount()
dw_det.setitem(ll_contador, 'c_operacion', ls_c_operacion)
dw_det.setitem(ll_contador, 'linea', ll_contador)
next
dw_dat.setitem(ll_fila,'num_version', dw_dat.getitemnumber(ll_fila, 'num_version') + 1)
dw_dat.setitem(ll_fila,'c_usuario_v1', gst_usuario_compras.usuario)
dw_dat.setitem(ll_fila,'cod_modulo_v1', gst_usuario_compras.modulo)

if dw_dat.update() = -1 then
rollback;
messagebox('Mensaje del Sistema','Ha ocurrido un error al Grabar la Orden de Compra !!!', stopsign!)
pb_cancelar.postevent(clicked!)
return
elseif dw_det.update() = -1 then
rollback;
messagebox('Mensaje del Sistema','Ha ocurrido un error al Grabar los Items de la Orden de Comora !!!', stopsign!)
pb_cancelar.postevent(clicked!)
return
else
commit;
end if

trigger event ue_botones_menu(2)

dw_dat.retrieve(ls_c_operacion)
dw_det.retrieve(ls_c_operacion)
dw_dat.setfocus()

end if

/***********************************************************/
podrias adpatarlo eso a tu codigo una vez q los pruebes o haya alguna duda me comentas y te respondo para continuar con la opcion consultar

saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por hector (15 intervenciones) el 11/11/2011 17:23:02
ese era el codigo para tu boton abrir

saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por ruth (5 intervenciones) el 11/11/2011 17:38:18
MIRA ESTE ES EL CODIGO PARA MI BOTON GRABAR Q ME FUNCIONA CORRECTAMENTE,

Decimal ln_cod_clie, ln_i, ln_cod_boleta
Int l_count, l_counts
String ls_emision_bol, ls_numero_bol
Date LD_fecha_emision_bol

dw_cabecera.AcceptText()
dw_detalle.AcceptText()

ln_cod_clie = dw_cabecera.Object.boleta_cod_clie[1]
ls_emision_bol = dw_cabecera.Object.boleta_emision_boleta[1]
ls_numero_bol = dw_cabecera.Object.boleta_numero_boleta[1]
LD_fecha_emision_bol = dw_cabecera.Object.boleta_fecha_emision_boleta[1]

If IsNull(ln_cod_clie) or ln_cod_clie = 0 Then
MessageBox("Error", "EL CODIGO DEL CLIENTE ES NULO")
dw_cabecera.setColumn("boleta_cod_clie")
dw_cabecera.setfocus()
Return
End If

If IsNull(ls_emision_bol) or trim(ls_emision_bol) = '' Then
MessageBox("Error", "LA EMISION ES NULO")
dw_cabecera.setColumn("boleta_emision_boleta")
dw_cabecera.setfocus()
Return
End If

If IsNull(ls_numero_bol) or trim(ls_numero_bol) = '' Then
MessageBox("Error", "EL NUMERO DE LA BOLETA ES NULO")
dw_cabecera.setColumn("boleta_numero_boleta")
dw_cabecera.setfocus()
Return
End If


If IsNull(LD_fecha_emision_bol) Then
MessageBox("Error", "LA FECHA ES NULO")
dw_cabecera.setColumn("boleta_fecha_emision_boleta")
dw_cabecera.setfocus()
Return
End If

If dw_detalle.RowCount() <= 0 Then
MessageBox("Error", "FALTA DETALLES")
Return
End If

select max(cod_boleta) into :ln_cod_boleta
from boleta using sqlca;

If IsNull(ln_cod_boleta) Then ln_cod_boleta = 0
ln_cod_boleta = ln_cod_boleta + 1

dw_cabecera.Object.boleta_cod_boleta[1] = ln_cod_boleta
dw_cabecera.Object.boleta_total[1] = dw_detalle.Object.c_sub_total[1]

For ln_i = 1 to dw_detalle.RowCount()
dw_detalle.Object.cod_boleta[ln_i] = dw_cabecera.Object.boleta_cod_boleta[1]
dw_detalle.Object.cod_detalle_bol[ln_i] = ln_i
Next

l_count = integer (dw_cabecera.Object.boleta_emision_boleta[1])
select count(*) into :l_count
from boleta
where emision_boleta = :l_count
using sqlca;

if l_count >0 then
messagebox("Error","El # de emision ya esta registrado")
Return
end if


l_counts = integer (dw_cabecera.Object.boleta_numero_boleta[1])
select count(*) into :l_counts
from boleta
where numero_boleta = :l_counts
using sqlca;

if l_counts > 0 then
messagebox("Error","El # de boleta ya esta registrado")
Return
end if

If dw_cabecera.Update() <> 1 Then
MessageBox("Error", "NO SE PUEDE GRABAR LA CABECERA ")
Rollback Using Sqlca;//cuando no graba bien
Return
End If


If dw_detalle.Update() <> 1 Then
MessageBox("Error", "NO SE PUDO GRABAR EL DETALLE ")
Rollback Using Sqlca; //cuando no graba bien
Return
End If

Commit using sqlca;//cuando todo grabo OK!!

Messagebox("Mensaje", "SE GRABO CORRECTAMENTE")


ES Q TU ME ENVIASTE ES PARA EL BOTON CONSULTAR.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por hector (15 intervenciones) el 11/11/2011 17:41:38
si tienes razon el code que te mande no era ni para abrir ni para consultar era para registar jejeje error de tipeo tons tu registrar ya esta bien si deseas te dejo mi email [email protected] toy en linea en el msn para ayudarte mejor.

saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por ruth (5 intervenciones) el 11/11/2011 17:57:17
ya te agregue pero no estas en linea.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

URGENTE ALGUIEN ME PODRIA AYUDAR PLISSSSSSSSSSSS.

Publicado por hector (15 intervenciones) el 11/11/2011 18:01:34
que raro agregare el tuyo entonces a ver me aceptas!

mi email te lo escribo nuevamente: [email protected]
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar