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));
}

你可能感兴趣的:(c,json,.net,asp.net,asp)