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));
}
posted @ 2007-02-25 21:21  三角猫  阅读(338)  评论(0编辑  收藏  举报