Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String ls_value, ls_null
- Integer li_tab_order[], li_opcion
- Boolean lb_array_ind[], lb_estado = false
- String ls_array_code[], ls_array_value[], ls_EmptyArray[]
- Integer li_row, lj_row, li_cont, contador
- setnull(ls_null)
- lb_array_ind = {ib_MontoCredito, ib_ExcepCuotas, ib_ExcepTEA}
- ls_array_code = {"000004", "000003", "000037"}
- li_tab_order = {270, 280, 290, 300}
- if ib_MontoCredito = true or ib_ExcepCuotas = true or ib_ExcepTEA = true then
- li_opcion = MessageBox(g_nomapl,"A continuación se generará(n) la(s) excepcion(es) automática(s)." + &
- "~rVerifique los datos ingresados antes de proseguir." + &
- "~r¿Datos ingresados correctamente?", question!, YesNo!, 2)
- if li_opcion = 1 then
- if ib_bandera = false then
- ib_bandera = true
- dw_sol_cre.SetItem(1, "cre$cre_ind_exc", '1')
- for li_row = 1 to UpperBound(lb_array_ind)
- if lb_array_ind[li_row] = true then
- ii_cont += 1
- dw_sol_cre.SetItem(1, "motivo_exc"+string(ii_cont), ls_array_code[li_row])
- end if
- next
- f_activar("motivo_exc"+string(ii_cont+1), li_tab_order[ii_cont+1], dw_sol_cre)
- else
- ls_array_value = ls_EmptyArray
- /*
- Capturo el valor del combo box, solo se capturarán aquellas
- excepciones llenadas de forma manual y lo guardo dentro de un
- arreglo.
- Después procedo a limpiar el campo y deshabilitarlo
- */
- for li_row = 1 to 4
- ls_value = dw_sol_cre.GetItemString(1, "motivo_exc"+string(li_row))
- if not isnull(ls_value) or len(ls_value) > 0 then
- for lj_row = 1 to UpperBound(ls_array_code)
- if ls_value = ls_array_code[lj_row] then
- lb_estado = true
- exit
- end if
- next
- if lb_estado = false then
- contador += 1
- ls_array_value[contador] = ls_value
- end if
- end if
- dw_sol_cre.setitem(1, "motivo_exc"+string(li_row), ls_null)
- f_desactivar("motivo_exc"+string(li_row), dw_sol_cre)
- next
- /*
- Ahora seteamos las excepciones automaticas y, de ser el caso,
- también las excepciones manuales
- */
- for li_row = 1 to UpperBound(lb_array_ind)
- if lb_array_ind[li_row] = true then
- li_cont += 1
- dw_sol_cre.SetItem(1, "motivo_exc"+string(li_cont), ls_array_code[li_row])
- end if
- next
- /*
- Verificamos ls_array_value
- case > 1:
- seteamos los valores contenidos dentro del arreglo y si el contador
- es menor a 4, que es el total de excepciones, activa el combobox
- que le precede.
- case = 1
- seteamos el valor unico contenido en el arreglo y activamos el
- combobox que le precede.
- */
- if UpperBound(ls_array_value) > 1 then
- contador = li_cont
- for li_row = 1 to UpperBound(ls_array_value)
- contador += 1
- dw_sol_cre.SetItem(1, "motivo_exc"+string(contador), ls_array_value[li_row])
- next
- if contador < 4 then //total de excepciones
- f_activar("motivo_exc"+string(contador+1), li_tab_order[contador+1], dw_sol_cre)
- end if
- elseif UpperBound(ls_array_value) = 1 then
- dw_sol_cre.SetItem(1, "motivo_exc"+string(li_cont+1), ls_array_value[li_cont])
- f_activar("motivo_exc"+string(li_cont+2), li_tab_order[li_cont+2], dw_sol_cre)
- end if
- end if
- else
- dw_sol_cre.SetItem(1, "cre$cre_ind_gar", ls_null)
- end if
- else
- f_activar("motivo_exc1", 270, dw_sol_cre)
- ib_bandera = true
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement