///实体类
namespaceDataInterface.Model
{
publicclassMetercs
{
publicstringMname{get;set;}
publicstringTid{get;set;}
publicstringTname{get;set;}
publicstringTzdxh{get;set;}
}
publicclassMetercsList
{ // www.jb200.com
publicList<Metercs>getMetercs{get;set;}
}
}
///转换操作,转换成json字符串
List<Metercs>Reterminals=newList<Metercs>();
foreach(varretinmeters)
{
Reterminals.Add(newMetercs(){Mname=ret.Mname,Tid=ret.Tid,Tname=ret.Tname,Tzdxh=ret.Tzdxh});
}
MetercsListTerminallist=newMetercsList();
Terminallist.getMetercs=Reterminals;
reStr=new
javascriptSerializer().Serialize(Terminallist);