Private int iSendCount = 0;
Private void Test (DSSendCollection dsRequest)
{
// Compare the benchmark data
String strS1Name = Convert. ToString (dsSend. Sub1.Rows [0] ["s1_name"]). Trim ();
String strS1UUID = Convert. ToString (dsSend. Sub1.Rows [0] ["uuid"]). Trim ();
DSSendCollection dsSendEdi = new DSSendCollection ();
// Sort the primary table
Dssendcollection. sub1row [] DRS = dsrequest. sub1.select ("", "s1_name, UUID") as dssendcollection. sub1row [];
For (INT I = 0; I <Drs. length; I ++)
{
If (DRS [I]. s1_name.trim ()! = Strs1name | DRS [I]. UUID. Trim ()! = Strs1uuid)
{
DataRow [] filterRows = dsRequest. Sub1.Select ("s1_Name = '" + strS1Name + "' and uuid = '" + strS1UUID + "'");
For (int j = 0; j <filterRows. Length; j ++)
{
DataRow drShipment = filterRows [j]; // the row of the master table.
ImportRow (drShipment, dsSendEdi );
}
// Send Edi
ISendCount ++;
MessageBox. Show ("Send EDI" + "" + iSendCount + "times ");
StrS1Name = drs [I]. s1_Name.Trim ();
StrS1UUID = drs [I]. uuid. Trim ();
DsSendEdi. Clear ();
DsSendEdi. AcceptChanges ();
}
If (I = Drs. Length-1)
{
If (isendcount = 0)
{
// Send EDI: directly send dsrequest
}
Else
{
Datarow [] filterrows = dsrequest. sub1.select ("s1_name = '" + strs1name + "' and UUID = '" + strs1uuid + "'");
For (Int J = 0; j <filterrows. length; j ++)
{
DataRow drShipment = filterRows [j];
ImportRow (drShipment, dsSendEdi );
}
// Send Edi
ISendCount ++;
MessageBox. Show ("Send EDI" + "" + iSendCount + "times ");
DsSendEdi. Clear ();
DsSendEdi. AcceptChanges ();
}
}
}