Public class OrdersType
{
Private string _ OrderNum;
Public string OrderNum
{
Get {return _ OrderNum ;}
Set {_ OrderNum = value ;}
}
Private string _ Invs_num;
Public string Invs_num
{
Get {return _ Invs_num ;}
Set {_ Invs_num = value ;}
}
Private string _ CountryCode;
Public string CountryCode
{
Get {return _ CountryCode ;}
Set {_ CountryCode = value ;}
}
Private Items [] _ ItemList;
Public Items [] ItemList
{
Get {return _ ItemList ;}
Set {_ ItemList = value ;}
}
Private GoodsInfoType [] _ GoodsInfoType;
Public GoodsInfoType [] GoodsInfoType
{
Get {return _ GoodsInfoType ;}
Set {_ GoodsInfoType = value ;}
}
}
Bytes -----------------------------------------------------------------------------------------------------
Private void ListTest (List <GoodsInfoType> goods)
{
List <GoodsInfoType> glist = new List <GoodsInfoType> ();
String TypeId = string. Empty;
List <string> strId = new List <string> ();
OrdersType order = new OrdersType ();
Order. invs_num= "123456 ";
Order. OrderNum = "MW1234848 ";
Order. CountryCode = "CN ";
Foreach (GoodsInfoType good in goods)
{
TypeId = good. GoodsTypeID1;
If (strId. Contains (TypeId ))
{
Continue;
}
Glist = goods. FindAll (p =>
{
If (p. GoodsTypeID1 = TypeId)
{
Return true;
}
Else
{
Return false;
}
});
Order. GoodsInfoType = glist. ToArray ();
StrId. Add (TypeId );
}
}