Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. public class DTO_Upvise_Project
  2. {
  3. public string id;
  4. public string name;
  5. public int health;
  6. public string owner;
  7. public long startdate;
  8. public long enddate;
  9. public int status;
  10. public decimal budget;
  11. public string geo;
  12. public string street;
  13. public int percentcomplete;
  14. public string note;
  15. public string groupid;
  16. public string companyid;
  17. public string contactid;
  18. public string opportunityid;
  19. public string custom;
  20. public string signature;
  21. public string signaturename;
  22. public long lastreportdate;
  23. public string city;
  24. public string state;
  25. public string zipcode;
  26. public string country;
  27. public string stageid;
  28. public string code;
  29. public long starttime;
  30. public int workduration;
  31. public int breakduration;
  32. public string notifmessage;
  33. public string color;
  34.  
  35. public DTO_Upvise_Project(JSONObject obj)
  36. {
  37. if (obj != null)
  38. {
  39. id = obj.getString("id");
  40. name = obj.getString("name");
  41. owner = obj.getString("owner");
  42. startdate = obj.getLong("startdate");
  43. enddate = obj.getLong("enddate");
  44. status = obj.getInt("status");
  45. health = obj.getInt("health");
  46. geo = obj.getString("geo");
  47. groupid = obj.getString("groupid");
  48. color = obj.getString("color");
  49. budget = obj.getDecimal("budget");
  50. }
  51. }
  52.  
  53. public new JSONObject ToJSONObject()
  54. {
  55. JSONObject form_JSONObject = new JSONObject();
  56.  
  57. form_JSONObject.put("id", id);
  58. form_JSONObject.put("name", name);
  59. form_JSONObject.put("owner", owner);
  60. form_JSONObject.put("date", date);
  61. form_JSONObject.put("templateid", templateid);
  62. form_JSONObject.put("status", status);
  63. form_JSONObject.put("value", value);
  64. form_JSONObject.put("geo", geo);
  65. form_JSONObject.put("address", address);
  66. form_JSONObject.put("value", value);
  67. form_JSONObject.put("linkedtable", linkedtable);
  68. form_JSONObject.put("linkedid", linkedid);
  69. form_JSONObject.put("groupid", groupid);
  70. form_JSONObject.put("history", history);
  71. form_JSONObject.put("priority", priority);
  72. form_JSONObject.put("planid", planid);
  73. form_JSONObject.put("color", color);
  74. form_JSONObject.put("projectid", projectid);
  75. form_JSONObject.put("counterid", counterid);
  76. form_JSONObject.put("hidden", hidden);
  77.  
  78. return form_JSONObject;
  79. }
  80.  
  81. public static void AddToJSONObject(object value, string key, JSONObject obj)
  82. {
  83. if (value != null)
  84. obj.put(key, value);
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement