The Perfect Day

分享技术,编写未来

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
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();
                    }
                }
            }
posted on 2009-01-04 16:37  StephenJu  阅读(297)  评论(0编辑  收藏  举报