33 |
</and> |
</and> |
34 |
</condition> |
</condition> |
35 |
</datasource> |
</datasource> |
36 |
|
<!--entity relation--> |
37 |
|
<datasource name="entityRelationDataSource" database="papo" table="entity_relation, _entity_relation_data" historytable="_entity_relation_data"> |
38 |
|
<condition> |
39 |
|
<and> |
40 |
|
<eq> |
41 |
|
<cfield name="entity_relation.id"/> |
42 |
|
<cfield name="_entity_relation_data._table"/> |
43 |
|
</eq> |
44 |
|
<null> |
45 |
|
<cfield name="_entity_relation_data._end_t"/> |
46 |
|
</null> |
47 |
|
</and> |
48 |
|
</condition> |
49 |
|
</datasource> |
50 |
|
<!--relation_types--> |
51 |
|
<datasource name="relationTypesDataSource" database="papo" table="relation_types, _relation_types_data" historytable="_relation_types_data"> |
52 |
|
<condition> |
53 |
|
<and> |
54 |
|
<eq> |
55 |
|
<cfield name="relation_types.id"/> |
56 |
|
<cfield name="_relation_types_data._table"/> |
57 |
|
</eq> |
58 |
|
<null> |
59 |
|
<cfield name="_relation_types_data._end_t"/> |
60 |
|
</null> |
61 |
|
</and> |
62 |
|
</condition> |
63 |
|
</datasource> |
64 |
|
<!--/entity relation--> |
65 |
|
|
66 |
<!-- trigger--> |
<!-- trigger--> |
67 |
<!-- <trigger name="ownBranchFocusInTrigger" type="NAMED"><![CDATA[ --> |
<!-- <trigger name="ownBranchFocusInTrigger" type="NAMED"><![CDATA[ --> |
68 |
<!-- ownBranchBlock.clear() --> |
<!-- ownBranchBlock.clear() --> |
168 |
</datasource> |
</datasource> |
169 |
<!-- parte de multi entities --> |
<!-- parte de multi entities --> |
170 |
<datasource name="entityTypesDataSource" database="papo" |
<datasource name="entityTypesDataSource" database="papo" |
171 |
detaillink="_entity_types_data.entity" master="ownBranchDataSource" |
table="entity_types, _entity_types_data" historytable="_entity_types_data"> |
|
masterlink="entity.id" table="entity_types, _entity_types_data" historytable="_entity_types_data"> |
|
172 |
<condition> |
<condition> |
173 |
<and> |
<and> |
174 |
<eq> |
<eq> |
181 |
</and> |
</and> |
182 |
</condition> |
</condition> |
183 |
</datasource> |
</datasource> |
184 |
|
<!-- parte de store house--> |
185 |
|
<datasource name="ownStorehouseDataSource" database="papo" table="entity, _entity_data, own_entity, _own_entity_data, |
186 |
|
own_storehouse, _own_storehouse_data" |
187 |
|
historytable="_entity_data, _own_entity_data, _own_storehouse_data"> |
188 |
|
<condition> |
189 |
|
<and> |
190 |
|
<!-- table = id n --> |
191 |
|
<eq> |
192 |
|
<cfield name="entity.id"/> |
193 |
|
<cfield name="_entity_data._table"/> |
194 |
|
</eq> |
195 |
|
<eq> |
196 |
|
<cfield name="own_entity.id"/> |
197 |
|
<cfield name="_own_entity_data._table"/> |
198 |
|
</eq> |
199 |
|
<eq> |
200 |
|
<cfield name="own_storehouse.id"/> |
201 |
|
<cfield name="_own_storehouse_data._table"/> |
202 |
|
</eq> |
203 |
|
<!-- uniones del objeto n-1 --> |
204 |
|
<eq> |
205 |
|
<cfield name="_own_storehouse_data.own_entity"/> |
206 |
|
<cfield name="own_entity.id"/> |
207 |
|
</eq> |
208 |
|
<eq> |
209 |
|
<cfield name="_own_entity_data.entity"/> |
210 |
|
<cfield name="entity.id"/> |
211 |
|
</eq> |
212 |
|
<!-- history tables = null n --> |
213 |
|
<null> |
214 |
|
<cfield name="_entity_data._end_t"/> |
215 |
|
</null> |
216 |
|
<null> |
217 |
|
<cfield name="_own_entity_data._end_t"/> |
218 |
|
</null> |
219 |
|
<null> |
220 |
|
<cfield name="_own_storehouse_data._end_t"/> |
221 |
|
</null> |
222 |
|
</and> |
223 |
|
</condition> |
224 |
|
</datasource> |
225 |
|
|
226 |
|
|
227 |
<!-- triggers --> |
<!-- triggers --> |
228 |
|
|
232 |
try: |
try: |
233 |
commitState= 0 |
commitState= 0 |
234 |
if ownBranchBlock.getCurrentRecord().isInserted(): |
if ownBranchBlock.getCurrentRecord().isInserted(): |
235 |
|
#ownBranchBlock.entityIdEntry.autofillBySequence('entity_id_seq') |
236 |
|
#ownStorehouseBlock.storehouseEntityIdEntry.autofillBySequence('entity_id_seq') |
237 |
|
ownStorehouseBlock.nameEntry = 'storehowse' |
238 |
|
print str(ownBranchBlock.entityIdEntry) |
239 |
ownBranchBlock.postChanges() |
ownBranchBlock.postChanges() |
240 |
commitState= 1 |
ownStorehouseBlock.postChanges() |
241 |
entityTypesBlock.ownBranchEntityEntry = str(ownBranchBlock.entityIdEntry) |
commitState= 2 |
242 |
# own branch lo busco de entre las constantes PAPO |
commitState= 3 |
243 |
entityTypesBlock.ownBranchEntityTypeEntry = <neb:Inline>'"'.PAPO::ownBranchType.'"'</neb:Inline> |
#cargo la relación own_storehowse_of_own_branch |
244 |
|
entityRelationBlock.entityRelationIdEntry.autofillBySequence('entity_relation_id_seq') |
245 |
|
#cargo la parte de la relacion correspondiente a own_branch |
246 |
|
entityRelationBlock.entityRelationFromEntry = str(ownBranchBlock.entityIdEntry) |
247 |
|
#cargo la parte de la relacion correspondiente a own_storehowse |
248 |
|
entityRelationBlock.entityRelationToEntry = str(ownStorehouseBlock.storehouseEntityIdEntry) |
249 |
|
entityRelationBlock.postChanges() |
250 |
|
# cargo relation_types |
251 |
|
commitState= 4 |
252 |
|
relationTypesBlock.entityRelationEntry = str(entityRelationBlock.entityRelationIdEntry) |
253 |
|
relationTypesBlock.relationTypeEntry = <neb:Inline>'"'.PAPO::storehouseOfBranchType.'"'</neb:Inline> |
254 |
|
relationTypesBlock.postChanges () |
255 |
|
#le doy de alta a entity types de ownBranch y de ownStorehowse |
256 |
|
entityTypesBlock.entityEntry = str(ownBranchBlock.entityIdEntry) |
257 |
|
entityTypesBlock.entityTypeEntry = <neb:Inline>'"'.PAPO::ownBranchType.'"'</neb:Inline> |
258 |
|
entityTypesBlock.newRecord() |
259 |
|
entityTypesBlock.entityEntry = str(ownStorehouseBlock.storehouseEntityIdEntry) |
260 |
|
entityTypesBlock.entityTypeEntry = <neb:Inline>'"'.PAPO::ownStorehouseType.'"'</neb:Inline> |
261 |
|
entityTypesBlock.postChanges() |
262 |
# le doy de alta a las 4 direcciones basicas |
# le doy de alta a las 4 direcciones basicas |
263 |
|
commitState= 5 |
264 |
addressBlock.addressTypeIdEntry = 1 |
addressBlock.addressTypeIdEntry = 1 |
265 |
addressBlock.nextRecord() |
addressBlock.nextRecord() |
266 |
addressBlock.addressTypeIdEntry = 2 |
addressBlock.addressTypeIdEntry = 2 |
274 |
ownBranchBlock.postChanges() |
ownBranchBlock.postChanges() |
275 |
commitConnection () |
commitConnection () |
276 |
except DBError, err: |
except DBError, err: |
277 |
mesgs= {0: 'los datos de la sucursal', 1: 'las direccciones'} |
mesgs= {0: 'los datos de la sucursal',1:'own branch type',2:'own storehowse type',3:'relation' ,4:'relation types',5 : 'las direccciones'} |
278 |
rollbackConnection() |
rollbackConnection() |
279 |
message = "Hay problemas para grabar " + mesgs[commitState] |
message = "Hay problemas para grabar " + mesgs[commitState] |
280 |
genericBox(mesagge+"\n"+str(err),['Aceptar']) |
genericBox(message+"\n"+str(err),['Aceptar']) |
281 |
</trigger> |
</trigger> |
282 |
<trigger name="ownBranchRollbackTrigger" type="NAMED"><![CDATA[ |
<trigger name="ownBranchRollbackTrigger" type="NAMED"><![CDATA[ |
283 |
ownBranchBlock.reset() |
ownBranchBlock.reset() |
310 |
<button x="11" y="19" trigger="ownBranchDeleteTrigger" width="9" label="Borrar" name="ownBranchDeleteBtn" height="1"/> |
<button x="11" y="19" trigger="ownBranchDeleteTrigger" width="9" label="Borrar" name="ownBranchDeleteBtn" height="1"/> |
311 |
<button x="21" y="19" trigger="ownBranchRollbackTrigger" width="9" label="Cancelar" name="ownBranchRollbackBtn" height="1"/> |
<button x="21" y="19" trigger="ownBranchRollbackTrigger" width="9" label="Cancelar" name="ownBranchRollbackBtn" height="1"/> |
312 |
</block> |
</block> |
313 |
|
<!--own Storehowse --> |
314 |
|
<block name="ownStorehouseBlock" datasource="ownStorehouseDataSource" restrictInsert="y" transparentBlock="y"> |
315 |
|
<entry name="storehouseEntityIdEntry" field="entity.id" x="1" y="1" width="20" hidden=""/> |
316 |
|
<entry name="nameEntry" field="_entity_data.name" x="1" y="8" width="40" hidden="" /> |
317 |
|
</block> |
318 |
<!-- entity types --> |
<!-- entity types --> |
319 |
<block name="entityTypesBlock" datasource="entityTypesDataSource" > |
<block name="entityTypesBlock" datasource="entityTypesDataSource" > |
320 |
<entry name="ownBranchEntityTypeEntry" field="_entity_types_data.entity_type" |
<entry name="entityTypeEntry" field="_entity_types_data.entity_type" |
321 |
x="40" y="4" width="4" hidden=""/> |
x="40" y="4" width="4" hidden=""/> |
322 |
<entry name="ownBranchEntityEntry" field="_entity_types_data.entity" |
<entry name="entityEntry" field="_entity_types_data.entity" |
323 |
x="40" y="4" width="4" hidden=""/> |
x="40" y="4" width="4" hidden=""/> |
324 |
</block> |
</block> |
325 |
<!-- /entity types --> |
<!-- /entity types --> |
326 |
|
<!--entity relation--> |
327 |
|
<block name="entityRelationBlock" datasource="entityRelationDataSource" > |
328 |
|
<entry name="entityRelationIdEntry" field="entity_relation.id" x="70" y="1" hidden="" /> |
329 |
|
<entry name="entityRelationToEntry" field="_entity_relation_data.entity_to" x="70" y="2" hidden="" /> |
330 |
|
<entry name="entityRelationFromEntry" field="_entity_relation_data.entity_from" x="70" y="3" hidden="" /> |
331 |
|
</block> |
332 |
|
<!--relation_types--> |
333 |
|
<block name="relationTypesBlock" datasource="relationTypesDataSource" > |
334 |
|
<entry name="relationTypeEntry" field="_relation_types_data.relation_type" x="70" y="5" hidden="" /> |
335 |
|
<entry name="entityRelationEntry" field="_relation_types_data.entity_relation" x="70" y="6" hidden=""/> |
336 |
|
</block> |
337 |
|
<!--/entity relation--> |
338 |
|
|
339 |
</page> |
</page> |
340 |
<!-- DIRECCIONES --> |
<!-- DIRECCIONES --> |
341 |
<neb:Block> |
<neb:Block> |
342 |
my $fields = [ { 'label' => 'Nombre de sucursal', |
my $fields = [ { 'label' => 'Nombre de sucursal', |
343 |
'entry' => 'nameEntry', |
'entry' => 'nameEntry', |
344 |
'name' => '', |
'name' => '', |