Histórico da Página
...
| Bloco de código | ||||||
|---|---|---|---|---|---|---|
| ||||||
#include 'protheus.ch'
#include 'fwmvcdef.ch'
user function ExecOpEst()
if RpcSetEnv("99","01",,,"EIC")
prcInclui()
prcAltera()
prcDelete()
endif
return nil
static function prcInclui()
local aArea := {}
local oModel := nil
local oModelEKJ := nil
local oGridEKT := nil
local lSetValue := .F.
dbSelectArea("EKJ")
aArea := EKJ->(getArea())
EKJ->(dbSetOrder(1)) // EKJ_FILIAL+EKJ_CNPJ_R+EKJ_FORN+EKJ_FOLOJA
if !EKJ->(dbSeek(xFilial("EKJ") + "12345678" + "GEN-00" + "00"))
oModel:= FWLoadModel("EICOE400")
oModel:SetOperation(MODEL_OPERATION_INSERT)
if oModel:Activate()
oModelEKJ := oModel:getModel("EICOE400_EKJ")
oGridEKT := oModel:GetModel("EICOE400_EKT")
lSetValue := oModelEKJ:setValue("EKJ_CNPJ_R","12345678")
lSetValue := lSetValue .and. oModelEKJ:setValue("EKJ_FORN","GEN-00")
lSetValue := lSetValue .and. oModelEKJ:setValue("EKJ_FOLOJA","00")
lSetValue := lSetValue .and. oModelEKJ:setValue("EKJ_NOME","NOME FORNECEDOR")
lSetValue := lSetValue .and. oModelEKJ:setValue("EKJ_LOGR","ENDEREÇO FORNECEDOR")
lSetValue := lSetValue .and. oModelEKJ:setValue("EKJ_CIDA","CIDADE FORNECEDOR")
lSetValue := lSetValue .and. oModelEKJ:setValue("EKJ_PAIS","US")
if lSetValue
lSetValue := oGridEKT:setValue("EKT_AGEEMI","17")
lSetValue := lSetValue .and. oGridEKT:setValue("EKT_NUMIDE","12345678910")
endif
if lSetValue .and. oModel:VldData() .and. oModel:CommitData()
ConOut("Inclusao realizada com sucesso.")
else
VarInfo("Erro no execauto do modelo EICOE400 -> ", oModel:GetErrorMessage())
endif
oModel:DeActivate()
oModel:Destroy()
FwFreeObj(oModel)
endif
endif
restArea(aArea)
return nil
static function prcAltera()
local aArea := {}
local oModel := nil
local oModelEKJ := nil
local oGridEKT := nil
local lSetValue := .F.
dbSelectArea("EKJ")
aArea := EKJ->(getArea())
EKJ->(dbSetOrder(1)) // EKJ_FILIAL+EKJ_CNPJ_R+EKJ_FORN+EKJ_FOLOJA
if EKJ->(dbSeek(xFilial("EKJ") + "12345678" + "GEN-00" + "00"))
oModel:= FWLoadModel("EICOE400")
oModel:SetOperation(MODEL_OPERATION_UPDATE)
if oModel:Activate()
oModelEKJ := oModel:getModel("EICOE400_EKJ")
oGridEKT := oModel:GetModel("EICOE400_EKT")
lSetValue := oModelEKJ:setValue("EKJ_NOME","NOME ALTERADO")
if lSetValue
lSetValue := oGridEKT:setValue("EKT_NUMIDE","0987654321")
endif
if lSetValue .and. oModel:VldData() .and. oModel:CommitData()
ConOut("Alteracao realizada com sucesso.")
else
VarInfo("Erro no execauto do modelo EICOE400 -> ", oModel:GetErrorMessage())
endif
oModel:DeActivate()
oModel:Destroy()
FwFreeObj(oModel)
endif
endif
restArea(aArea)
return nil
static function prcDelete()
local aArea := {}
local oModel := nil
dbSelectArea("EKJ")
aArea := EKJ->(getArea())
EKJ->(dbSetOrder(1)) // EKJ_FILIAL+EKJ_CNPJ_R+EKJ_FORN+EKJ_FOLOJA
if EKJ->(dbSeek(xFilial("EKJ") + "12345678" + "GEN-00" + "00"))
oModel:= FWLoadModel("EICOE400")
oModel:SetOperation(MODEL_OPERATION_DELETE)
if oModel:Activate()
if oModel:VldData() .and. oModel:CommitData()
ConOut("Exclusao realizada com sucesso.")
else
VarInfo("Erro no execauto do modelo EICOE400 -> ", oModel:GetErrorMessage())
endif
oModel:DeActivate()
oModel:Destroy()
FwFreeObj(oModel)
endif
endif
restArea(aArea)
return nil
|
03. MODELO DE DADOS
| Modelos | Descrição |
|---|---|
| EICOE400_EKJ | Capa do operador estrangeiro |
| EICOE400_EKT | Identificações Adicionais do operador estrangeiro. |
...
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas