Home > database >  Expert advice, these programming statements say something...
Expert advice, these programming statements say something...

Time:09-25

1 the function of query
Long lPos, lPurchaseOrderCode
String sSQL

Then if wf_prechange (false, 'all')
Dw_search. Accepttext ()
Il_PurchaseOrderCode=dw_search. Object. The data [1, 1]
If il_PurchaseOrderCode & gt; 0 then
Dw_1. Reset ()
Dw_2. Reset ()

SSQL=dw_1. Getsqlselect ()

LPos=pos (sSQL, 'where')
If lPos & gt; 0 then
SSQL=mid (sSQL, 1, the lPos - 1)
End the if

SSQL +="where purchaseordercode=" + string (il_PurchaseOrderCode)

Dw_1. Setsqlselect (sSQL)
Dw_1. SetTransobject (SQLCA)
If dw_1. Retrieve () & gt; 0 then

SSQL=dw_2. Getsqlselect ()

LPos=pos (sSQL, 'where')
If lPos & gt; 0 then
SSQL=mid (sSQL, 1, the lPos - 1)
End the if

SSQL +="where purchaseordercode=" + string (il_PurchaseOrderCode)

Dw_2. Setsqlselect (sSQL)
Dw_2. SetTransobject (SQLCA)
Dw_2. Retrieve ()
End the if
End the if
End the if



2 remove
Long ll_row lRowCnt, lRow

Ll_row=dw_1. GetRow ()

If ll_row & gt; 0 and il_PurchaseOrderCode & gt; 0 then
If messageBox (' ask ', 'are you sure you want to delete the purchase order [' + string (il_PurchaseOrderCode) +']? 'the question! Yesno! Then, 2)=1

LRowCnt=dw_2. RowCount ()
If lRowCnt & gt; 0 then
For lRow=lRowCnt to 1
Dw_2. Deleterow (lRow)
Next
End the if

Dw_1. Deleterow (ll_row)

Il_PurchaseOrderCode=0

Wf_prechange (true, 'all')
End the if
End the if



3 save
Long lDBIDENTIT

If dw_1. RowCount () & gt; 0 then
Dw_1. Object. Operatorcode [1]=gs_username
Dw_1. Accepttext ()

If dw_1. The update ()=1 then
commit;
MessageBox (' prompt ', 'save the success! ')

Declare cur_PurchaseOrderCode cursor for the select isNull (@ @ IDENTITY, 0);
The open cur_PurchaseOrderCode;
The fetch cur_PurchaseOrderCode into: lDBIDENTIT;

The close cur_PurchaseOrderCode;

If lDBIDENTIT & gt; 0 then
Il_PurchaseOrderCode=lDBIDENTIT

Dw_search. Event ue_retrieve ()

Dw_search. Object. The data [1, 1]=il_PurchaseOrderCode
//cb_search. Event clicked ()
End the if
The else
The rollback.
MessageBox (' prompt ', 'save failed! ~ r ~ n '+ SQLCA sqlerrtext, the Exclamation!)
End the if
The else
Wf_prechange (false, 'all')
end if

CodePudding user response:

.

CodePudding user response:

.

CodePudding user response:

Ha ha, I top! Analysis of slowly!

CodePudding user response:

Is all some very basic statements, and you were given the code to handle things

CodePudding user response:

1 the function of query
Long lPos, lPurchaseOrderCode
String sSQL

If wf_prechange (false, 'all') then//custom function judge condition
Dw_search. Accepttext ()//put the data in the data window
Il_PurchaseOrderCode=dw_search. Object. The data value [1, 1]//
If il_PurchaseOrderCode & gt; 0 then if a value greater than 0
Dw_1. Reset ()//clear data
Dw_2. Reset ()

SSQL=dw_1. Getsqlselect ()//get dw_1 select statement

LPos=pos (sSQL, 'where')//to determine whether a statement containing the where
If lPos & gt; 0 then
SSQL=mid (sSQL, 1, the lPos - 1)//if you include such as the where statement before
End the if

SSQL +="where purchaseordercode=" + string (il_PurchaseOrderCode)//compound SQL statement

Dw_1. Setsqlselect (sSQL)//modify dw_1 select statement
Dw_1. SetTransobject (SQLCA)//set the data object
If dw_1. Retrieve () & gt; 0 then judge whether display data is greater than 0

SSQL=dw_2. Getsqlselect ()//in front of the reference

LPos=pos (sSQL, 'where')
If lPos & gt; 0 then
SSQL=mid (sSQL, 1, the lPos - 1)
End the if

SSQL +="where purchaseordercode=" + string (il_PurchaseOrderCode)

Dw_2. Setsqlselect (sSQL)
Dw_2. SetTransobject (SQLCA)
Dw_2. Retrieve ()
End the if
End the if
End the if



2 remove
Long ll_row lRowCnt, lRow

Ll_row=dw_1. GetRow () to get the current line

If ll_row & gt; 0 and il_PurchaseOrderCode & gt; 0 then judge
If messageBox (' ask ', 'are you sure you want to delete the purchase order [' + string (il_PurchaseOrderCode) +']? 'the question! Yesno! Then, 2)=1

Statistical dw_2 lRowCnt=dw_2. RowCount () lines
If lRowCnt & gt; 0 then line number greater than 0
For lRow=lRowCnt 1 cycle to remove
Dw_2. Deleterow (lRow)
Next
End the if

Dw_1. Deleterow (ll_row) delete

Il_PurchaseOrderCode=0 assignment

Wf_prechange (true, 'all') custom function
End the if
End the if



3 save
Long lDBIDENTIT

If dw_1. RowCount () & gt; 0 then judge whether dw_1 line number greater than 0
Dw_1. Object. Operatorcode [1]=gs_username assignment
Dw_1. Accepttext ()

If dw_1. The update ()=1 then update
commit;
MessageBox (' prompt ', 'save the success! ')

Declare cur_PurchaseOrderCode cursor for the select isNull (@ @ IDENTITY, 0); Declare cursor
The open cur_PurchaseOrderCode;
The fetch cur_PurchaseOrderCode into: lDBIDENTIT;

The close cur_PurchaseOrderCode;

If lDBIDENTIT & gt; 0 then
Il_PurchaseOrderCode=lDBIDENTIT

Dw_search. Event ue_retrieve trigger custom events ()

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related