Front end: The front end defines an object that is serialized as a JSON string when an instance of the object is passed as a value
The code is as follows:
To define a JS object:
Defines a query condition object var searchcondition=function () {this . code=$ ("#Code"). Val (); This. projectid=$ ("#Project"). Val (); This. customerid=$ ("#Customer"). Val (); };
Serialization of
$ ("#search"). Click (function () {
var sc = new searchcondition ();
$ (' #projectlist '). DataGrid (' Load ', {
V_cusproject:JSON.stringify (SC),
Type: "Getprojectlist"
});
});
Background: Accepts JSON strings, then deserializes them into objects or key-value pairs
The code is as follows:
String Vpmodel = GETPARAM.F ("V_cusproject"); Model.v_cusproject VP = jsonhelp.jsontoobject<model.v_cusproject> (Vpmodel);
This allows the entity to be made easy to do the following
Or become a key-value pair:
String conditons = GETPARAM.F ("conditons"); dictionary<string, object> dic = Jsonhelp.datarowfromjson (conditons);
Glance