private string getGroupJSON(Operation operation) { var group = new GroupJSON.Group(); if (operation == Operation.CreateGroupOperation) { group.groupName = groupName.Text; group.groupType = "USER"; } else if (operation == Operation.UpdateGroupOperation) { group.groupName = groupNameUpd.Text; group.groupType = "USER"; } var serializer = new JavaScriptSerializer(); var groupRoot = new GroupJSON.RootObject(); groupRoot.group = group; return(JsonConvert.SerializeObject(groupRoot, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore })); }
private string getGroupJSON(Operation operation) { var group = new GroupJSON.Group(); if (operation == Operation.CreateGroupOperation) { group.groupName = groupName.Text; group.groupType = "USER"; } else if (operation == Operation.UpdateGroupOperation) { group.groupName = groupNameUpd.Text; group.groupType = "USER"; } var serializer = new JavaScriptSerializer(); var groupRoot = new GroupJSON.RootObject(); groupRoot.group = group; return JsonConvert.SerializeObject(groupRoot, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); }