private int iSendCount = 0;
private void Test(DSSendCollection dsRequest)
{
//取基准数据做比较
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();
//对主表排序
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];//主表的行
ImportRow(drShipment, dsSendEdi);
}
//发送Edi
iSendCount++;
MessageBox.Show("发送EDI "+""+iSendCount+"次");
strS1Name = drs[i].s1_Name.Trim();
strS1UUID = drs[i].uuid.Trim();
dsSendEdi.Clear();
dsSendEdi.AcceptChanges();
}
if (i == drs.Length - 1)
{
if (iSendCount == 0)
{
//发送Edi:直接传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);
}
//发送Edi
iSendCount++;
MessageBox.Show("发送EDI " + "" + iSendCount + "次");
dsSendEdi.Clear();
dsSendEdi.AcceptChanges();
}
}
}
private void Test(DSSendCollection dsRequest)
{
//取基准数据做比较
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();
//对主表排序
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];//主表的行
ImportRow(drShipment, dsSendEdi);
}
//发送Edi
iSendCount++;
MessageBox.Show("发送EDI "+""+iSendCount+"次");
strS1Name = drs[i].s1_Name.Trim();
strS1UUID = drs[i].uuid.Trim();
dsSendEdi.Clear();
dsSendEdi.AcceptChanges();
}
if (i == drs.Length - 1)
{
if (iSendCount == 0)
{
//发送Edi:直接传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);
}
//发送Edi
iSendCount++;
MessageBox.Show("发送EDI " + "" + iSendCount + "次");
dsSendEdi.Clear();
dsSendEdi.AcceptChanges();
}
}
}