ASP.NET 的 JSON 应用
public class Services
{
public string ServiceNo = null;
public string ServiceState = null;
}
private int _AppendService(Services serv)
{
return SqlHelper.ExecuteNoQuery("INSERT INTO wfServices([ServiceNo], [ServiceState]) VALUES ('" + serv.ServiceNo + "', '" + serv.ServiceState + "')");
}
public bool AppendService(string strJSON)
{
// strJSON = "{\"ServiceNo\":\"1\",\"ServiceState\":\"C\"}";
return (1 == _AppendService(JavaScriptConvert.DeserializeObject(strJSON, typeof(Services)) as Services));
}
{
public string ServiceNo = null;
public string ServiceState = null;
}
private int _AppendService(Services serv)
{
return SqlHelper.ExecuteNoQuery("INSERT INTO wfServices([ServiceNo], [ServiceState]) VALUES ('" + serv.ServiceNo + "', '" + serv.ServiceState + "')");
}
public bool AppendService(string strJSON)
{
// strJSON = "{\"ServiceNo\":\"1\",\"ServiceState\":\"C\"}";
return (1 == _AppendService(JavaScriptConvert.DeserializeObject(strJSON, typeof(Services)) as Services));
}
作者: 三角猫
http://www.zu14.cn/
转载请保留此信息