FWMariaDB and XBrowse - Query - Mr. Rao

FWMariaDB and XBrowse - Query - Mr. Rao

Postby jose_murugosa » Tue Dec 21, 2021 11:15 am

CODE: SELECT ALL EXPAND VIEW

#include "Fivewin.ch"
#include "xbrowse.ch"

function PlanillaMantDiarios( oCn )
LOCAL oDlg, oFont1, oFont2, oFont3, oBrw, oRs, wmes, wanio, csql, oGet:={}
LOCAL ii
wmes := 11
wanio:= 2021
oGet:=Array(2)

cSql := "SELECT * FROM mantenimientos JOIN planilla JOIN maquinas JOIN sectores ON ( mantenimientos.mant_id = planilla.plaMant_id and mantenimientos.mantMaq_id = maquinas.Maq_id and mantenimientos.mantSector_id = sectores.Sector_ID ) WHERE ( planilla.pla_mes = 11 and planilla.pla_anio = 2021 )"
oRs := oCn:RowSet( cSql )

DEFINE DIALOG oDlg RESOURCE "DLG_PLAMDIARIOS" TITLE "Planilla de Mantenimientos Diarios"

REDEFINE GET oGet[1] VAR wmes id 101 picture "99" of oDlg
REDEFINE GET oGet[2] VAR wanio id 102 picture "9999" of oDlg

REDEFINE XbROWSE oBrw id 201 of oDlg DATASOURCE oRs ;
COLUMNS "mant_nombre", "pla_mes", "pla_anio", "Sector_Nombre", "D1", "D2", ;
"D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", ;
"D13", "D14", "D15", "D16", "D17", "D18", "D19", "D20", "D21", "D22", ;
"D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31" ;
HEADERS "Mantenimiento:", "Mes:", "Año:", "Sector:", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", ;
"13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" ;
SIZES 320, 30, 40, 120, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, ;
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ;
FASTEDIT

WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:SetChecks( nil, .t. )
:nfreeze := 4
:lEdit:=.t.
END WITH

ACTIVATE DIALOG oDlg CENTER
oRs:Close()
RETURN nil




I have this code, it allows me to display the information of a query that includes 4 tables, but only allows me to edit the main table.

I have implemented a solution by storing the query in a temporary table, but I have several cases like this in a development and I would be interested to know if it is possible to edit all the tables at the same time with xbrowse, if it can only be done by means of a temporary table or if there can be a better solution.

Thank you.


Tengo este código, me permite visualizar la información del query que incluye 4 tablas, pero solo me permite editar la tabla principal.

He implementado una solución poniendo el query en una tabla temporal, pero tengo varios casos como este en un desarrollo y me interesaría saber si se puede editar sobre todas las tablas a la vez con xbrowse, si solo puede hacerse mediante una tabla temporal o si puede haber una mejor solución.

Gracias.
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1173
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests