Guidance
指路人
g.yi.org
software / rapidq / Examples / Database / qmysql & qlistview.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'From:"edamian919"<edamian919@yahoo.com.ar> Wed, 14 Aug 2002 12:20:08 -0000

'This is an example how to use qlistview with qmysql and another
'components. Perhaps it could help someone.
'If you have some comment please let me know. Thanks.

'Sistema que reemplazar?al sistema dgi
     $INCLUDE "rapidq.inc"
     $INCLUDE "qodbc.bas"
     $INCLUDE "mysql.inc"
     DECLARE FUNCTION setFocus LIB "user32" ALIAS "SetFocus" (BYVAL hwnd AS LONG) AS LONG

'fr03 formulario de carga de etapas procesales
     DIM opendialog AS QOPENDIALOG
     DIM hoja AS QSTRINGGRID
     DIM bestudio AS QMYSQL
     DIM bgeltex AS qodbc
     DIM nrotra AS LONG
     DIM newcourrier10 AS QFONT
     DIM newcourrier10n AS QFONT
     newcourrier10.name = "Courier New"
     newcourrier10.size = 10
     newcourrier10n.name = "Courier New"
     newcourrier10n.size = 10
     newcourrier10n.size = 10
     newcourrier10n.addstyles(fsBold)

     DECLARE SUB clickmsojbancodesde
     DECLARE SUB load
     DECLARE SUB tranfdesdegeltex
     DECLARE SUB cargar_siraef_tab_change
     DECLARE SUB mcarsiraef_click
     DECLARE SUB siraef_etapa_tranferencia
     DECLARE SUB siraef_blanquear_campos
     DECLARE SUB siraef_alta
     DECLARE SUB seguicarpeta
     DECLARE SUB btfr03_grabaretapaclick
     DECLARE SUB fr03_blanquearcampos
     DECLARE SUB cmfr03_etapaschange
     DECLARE SUB btfr03_buscarclick
     DECLARE SUB fr03_blanquearcampos1
     DECLARE SUB btfr03_borraretapaclick
     SUB dummyproc:END SUB
     SUB cerrarfsojbancodesde:END SUB
     SUB cargar_siraef_cerrar:END SUB
     SUB fr03close:END SUB
'***********************************************************
' fr03 formulario de carga de etapas procesales
'***********************************************************
     CREATE fr03 AS QFORM
      center
      COLOR = &H00E0FFFF
      width = 600
      height = 550
      CAPTION = "Seguimiento de Carpetas"
      onclose = fr03close
      CREATE pnfr03_bus AS QPANEL
       top = 1
       left = 5
       width = fr03.clientwidth - 10
       height = 50
       COLOR = &H00C0FFC0
       CREATE lbfr03_sucu AS QLABEL
        top = 10
        left = 5
        CAPTION = "Agencia:"
        font = newcourrier10
       END CREATE
       CREATE txfr03_sucu AS QEDIT
        top = lbfr03_sucu.top
        left = lbfr03_sucu.left + lbfr03_sucu.width + 10
        width = 40
        font = newcourrier10
        inputmask = "000"
       END CREATE
       CREATE lbfr03_juicio AS QLABEL
        top = lbfr03_sucu.top
        left = txfr03_sucu.left + txfr03_sucu.width + 10
        CAPTION = "Juicio:"
        font = newcourrier10
       END CREATE
       CREATE txfr03_juicio AS QEDIT
        top = lbfr03_sucu.top
        left = lbfr03_juicio.left + lbfr03_juicio.width + 10
        width = 70
        font = newcourrier10
        inputmask = "9999999"
       END CREATE
       CREATE lbfr03_anio AS QLABEL
        top = lbfr03_sucu.top
        left = txfr03_juicio.left + txfr03_juicio.width + 10
        CAPTION = "Año:"
        font = newcourrier10
       END CREATE
       CREATE txfr03_anio AS QEDIT
        top = lbfr03_sucu.top
        left = lbfr03_anio.left + lbfr03_anio.width + 10
        width = 45
        font = newcourrier10
        inputmask = "0000"
       END CREATE
       CREATE btfr03_buscar AS QBUTTON
        top = lbfr03_sucu.top
        left = txfr03_anio.left + txfr03_anio.width + 40
        CAPTION = "&Buscar"
        font = newcourrier10
        onclick = btfr03_buscarclick
       END CREATE
      END CREATE
      CREATE lbfr03_contribuyente AS QLABEL
       top = lbfr03_sucu.top + 50
       left = lbfr03_sucu.top
       CAPTION = "Contribuyente:"
       font = newcourrier10
      END CREATE
      CREATE txfr03_contribuyente AS QEDIT
       top = lbfr03_contribuyente.top
       left = lbfr03_contribuyente.left + lbfr03_contribuyente.width + 10
       width = 400
       font = newcourrier10
      END CREATE
      CREATE lbfr03_cuit AS QLABEL
       top = txfr03_contribuyente.top + 30
       left = lbfr03_contribuyente.left
       CAPTION = "Cuit:"
       font = newcourrier10
      END CREATE
      CREATE txfr03_cuit AS QEDIT
       top = lbfr03_cuit.top
       left = txfr03_contribuyente.left
       width = 120
       inputmask = "00-00000000-0"
       font = newcourrier10
      END CREATE
      CREATE lsfr03_etapas AS QLISTVIEW 'ya tiene el end
       COLOR = &H00C0FFC0
       width = fr03.clientwidth
       height = 200
       top = txfr03_cuit.top + txfr03_cuit.height + 10
       left = 0
       viewstyle = vsreport
       addcolumns "C. Etapa","C. Subetapa","Etapa","Sub Etapa","Fecha","Nro. Trans."
       column(0).width = 55
       column(1).width = 55
       column(2).width = 200
       column(3).width = 200
       column(4).width = 100
       column(5).width = 100
       rowselect = true
       readonly = true
       gridlines = true
      END CREATE
      CREATE pnfr03_add AS QPANEL
       top = lsfr03_etapas.top + lsfr03_etapas.height + 10
       left = 5
       width = fr03.clientwidth - 10
       height = 180
       COLOR = &H00C0FFC0
       CREATE lbfr03_Descpanel AS QLABEL
        top = 1
        left = 1
        CAPTION = "Datos de la Etapa a Incorporar"
        font = newcourrier10n
       END CREATE
       CREATE lbfr03_etapas AS QLABEL
        top = lbfr03_descpanel.top + lbfr03_descpanel.height + 10
        left = 1
        CAPTION = "Etapa:"
        font = newcourrier10
       END CREATE
       CREATE cmfr03_etapas AS QCOMBOBOX
        top = lbfr03_etapas.top
        left = lbfr03_etapas.left + lbfr03_etapas.width + 42
        width = 400
        style = csdropdownlist
        font = newcourrier10
        onchange = cmfr03_etapaschange
       END CREATE
       CREATE lbfr03_subetapas AS QLABEL
        top = cmfr03_etapas.top + cmfr03_etapas.height + 10
        left = 1
        CAPTION = "Sub-Etapa:"
        font = newcourrier10
       END CREATE
       CREATE cmfr03_subetapas AS QCOMBOBOX
        top = lbfr03_subetapas.top
        left =lbfr03_subetapas.left + lbfr03_subetapas.width + 10
        width = cmfr03_etapas.width
        style = csdropdownlist
        font = newcourrier10
       END CREATE
       CREATE lbfr03_fechaetapa AS QLABEL
        top = cmfr03_subetapas.top + cmfr03_subetapas.height + 10
        left = lbfr03_subetapas.left
        CAPTION = "Fecha:"
        font = newcourrier10
       END CREATE
       CREATE txfr03_fechaetapa AS QEDIT
        top = lbfr03_fechaetapa.top
        left = lbfr03_subetapas.left + lbfr03_subetapas.width + 10
        inputmask = "00/00/0000"
        font = newcourrier10
        width = 100
       END CREATE
       CREATE btfr03_grabaretapa AS QOVALBTN
        top = txfr03_fechaetapa.top + txfr03_fechaetapa.height + 15
        left = txfr03_fechaetapa.left - 15
        height = 30
        width = 160
        CAPTION = "&Grabar Etapa"
        COLOR = clgreen
        font = newcourrier10
        onclick = btfr03_grabaretapaclick
       END CREATE
       CREATE btfr03_borraretapa AS QOVALBTN
        top = txfr03_fechaetapa.top + txfr03_fechaetapa.height + 15
        left = btfr03_grabaretapa.left + btfr03_grabaretapa.width + 10
        height = 30
        width = 160
        CAPTION = "&Brabar Etapa"
        COLOR = clgreen
        font = newcourrier10
        onclick = btfr03_borraretapaclick
       END CREATE

      END CREATE

     END CREATE



'**************programa principal****************************
     bestudio.connect("192.168.0.1","root","laky")
     IF bestudio.connected THEN
     ELSE
      SHOWMESSAGE "No se puede conectar con la base de datos"
      END
     END IF
     bestudio.selectdb("estudio")
     fr03.SHOWMODAL
     bestudio.CLOSE
     END
'**********************************************************
'procedimientos para el seguimiento de carpetas fr03
'**********************************************************
     SUB seguicarpeta
      fr03_blanquearcampos
      sql$ = "select tipo_codigo,codigo,desgel from ncodigo order by codigo"
      bestudio.query(sql$)
      WHILE bestudio.fetchrow
       bestudio.fieldseek(0)
       cmfr03_etapas.additems bestudio.row(0) & "-" & bestudio.row(1) & "-" & bestudio.row(2)
      WEND
      fr03.SHOWMODAL
     END SUB

     SUB btfr03_grabaretapaclick
      sql$= "select max(numero_transaccion) from netapa"
      IF bestudio.query(sql$) = 0 THEN
       SHOWMESSAGE "No se puede dar de alta a esta etapa, intente luego"
       EXIT SUB
      END IF
      IF bestudio.fetchrow() THEN
       bestudio.fieldseek(0)
       nrotra = VAL(bestudio.row(0)) + 1
      ELSE
       SHOWMESSAGE "No se puede obtener el Nro. de transacción, etapa no grabada"
       EXIT SUB
      END IF
      sql$ = "insert into netapa(sucu,juicio,anio,tipo_codigo,codigo,stipo_codigo,scodigo,numero_transaccion,origen_codigo,fecini) values("
      sql$ = sql$ & "'" & txfr03_sucu.text & "',"
      sql$ = sql$ & "'" & txfr03_juicio.text & "',"
      sql$ = sql$ & "'" & txfr03_anio.text & "',"
      sql$ = sql$ & "'" & MID$(cmfr03_etapas.text,1,1) & "',"
      sql$ = sql$ & "'" & MID$(cmfr03_etapas.text,3,3) & "',"
      sql$ = sql$ & "'" & MID$(cmfr03_subetapas.text,1,1) & "',"
      sql$ = sql$ & "'" & MID$(cmfr03_subetapas.text,3,3) & "',"
      sql$ = sql$ & "'" & STR$(nrotra) & "',"
      sql$ = sql$ & "'" & "M" & "',"
      sql$ = sql$ & "'" & MID$(txfr03_fechaetapa.text,7,4) & "-" & MID$(txfr03_fechaetapa.text,4,2) & "-" & MID$(txfr03_fechaetapa.text,1,2) & "'"
      sql$ = sql$ & ")"
      IF bestudio.query(sql$) = 0 THEN
       SHOWMESSAGE "No se pudo dar de alta la etapa, intente luego"
       EXIT SUB
      END IF
      lsfr03_etapas.additems MID$(cmfr03_etapas.text,1,5)
      cantitem = lsfr03_etapas.itemcount - 1
      lsfr03_etapas.addsubitem cantitem, MID$(cmfr03_subetapas.text,1,5)
      lsfr03_etapas.addsubitem cantitem, MID$(cmfr03_etapas.text,7,40)
      lsfr03_etapas.addsubitem cantitem, MID$(cmfr03_subetapas.text,7,40)
      lsfr03_etapas.addsubitem cantitem, txfr03_fechaetapa.text
      lsfr03_etapas.addsubitem cantitem, STR$(nrotra)
     END SUB

     SUB fr03_blanquearcampos
      cmfr03_etapas.clear
      cmfr03_subetapas.clear
      txfr03_fechaetapa.text = ""
      lsfr03_etapas.clear
      txfr03_sucu.text = ""
      txfr03_juicio.text = ""
      txfr03_anio.text = ""
      txfr03_contribuyente.text = ""
      txfr03_cuit.text = ""
     END SUB

     SUB fr03_blanquearcampos1
      txfr03_fechaetapa.text = ""
      lsfr03_etapas.clear
      txfr03_contribuyente.text = ""
      txfr03_cuit.text = ""
     END SUB




     SUB cmfr03_etapaschange
      cmfr03_subetapas.clear
      sql$ = "select tipo_codigo,scodigo,desgel from nscodigo where "   'aqui estoy
      sql$ = sql$ & "tipo_codigo = '" & MID$(cmfr03_etapas.text,1,1) & "' and "
      sql$ = sql$ & "codigo = '" & MID$(cmfr03_etapas.text,3,3) & "'"
      bestudio.query(sql$)
      WHILE bestudio.fetchrow
       bestudio.fieldseek(0)
       cmfr03_subetapas.additems bestudio.row(0) & "-" & bestudio.row(1) & "-" & bestudio.row(2)
      WEND
     END SUB


     SUB btfr03_buscarclick
      fr03_blanquearcampos1
      sql$ = "select caratula,nroidenti from njuicio where "
      sql$ = sql$ & "sucu = '" & txfr03_sucu.text & "' and "
      sql$ = sql$ & "juicio = '" & txfr03_juicio.text & "' and "
      sql$ = sql$ & "anio = '" & txfr03_anio.text & "'"
      bestudio.query(sql$)
      IF bestudio.fetchrow THEN
       bestudio.fieldseek(0)
       txfr03_contribuyente.text = bestudio.row(0)
       txfr03_cuit.text = MID$(bestudio.row(1),1,2) & "-" & MID$(bestudio.row(1),3,8) & "-" & MID$(bestudio.row(1),11,1)
      ELSE
       SHOWMESSAGE "El juicio no se ha encontrado"
       EXIT SUB
      END IF
      sql$ = "select netapa.tipo_codigo,netapa.codigo,netapa.stipo_codigo,netapa.scodigo,fecini,numero_transaccion,ncodigo.desgel,nscodigo.desgel "
      sql$ = sql$ & "from netapa left join ncodigo on netapa.codigo = ncodigo.codigo and netapa.tipo_codigo = ncodigo.tipo_codigo "
      sql$ = sql$ & "left join nscodigo on netapa.codigo = nscodigo.codigo and netapa.scodigo = nscodigo.scodigo and netapa.stipo_codigo = nscodigo.tipo_codigo "
      sql$ = sql$ & " where "
      sql$ = sql$ & "sucu = '" & txfr03_sucu.text & "' and "
      sql$ = sql$ & "juicio = '" & txfr03_juicio.text & "' and "
      sql$ = sql$ & "anio = '" & txfr03_anio.text & "'"
      sql$ = sql$ & " order by fecini "
      bestudio.query(sql$)
      WHILE bestudio.fetchrow
       bestudio.fieldseek(0)
       lsfr03_etapas.additems bestudio.row(0) & "-" & bestudio.row(1)
       cantitem = lsfr03_etapas.itemcount - 1
       lsfr03_etapas.addsubitem cantitem, bestudio.row(2) & "-" & bestudio.row(3)
       lsfr03_etapas.addsubitem cantitem, bestudio.row(6)
       lsfr03_etapas.addsubitem cantitem, bestudio.row(7)
       lsfr03_etapas.addsubitem cantitem, MID$(bestudio.row(4),9,2) & "/" &  MID$(bestudio.row(4),6,2) & "/" & MID$(bestudio.row(4),1,4)
       lsfr03_etapas.addsubitem cantitem, bestudio.row(5)
      WEND
     END SUB


     SUB btfr03_borraretapaclick
'ojo en subitem se cuenta de 0 a n los subitems
      sql$ = "delete from netapa where numero_transaccion = " & lsfr03_etapas.subitem(lsfr03_etapas.itemindex,4)
      IF bestudio.query(sql$) = 0  THEN
       SHOWMESSAGE "No se puede borrar la etapa Selecionada"
       EXIT SUB
      END IF
      lsfr03_etapas.delitems(lsfr03_etapas.itemindex)
     END SUB
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-08-14 21:50:10