UserProfile.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using Newtonsoft.Json.Linq;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. namespace SuperAdmin.Models.Object
  7. {
  8. public class UserProfile : Posting
  9. {
  10. public String id { get; set; }
  11. public String usersId { get; set; }
  12. public String users { get; set; }
  13. //public String serviceid { get; set; }
  14. public String fullName { get; set; }
  15. public String sex { get; set; }
  16. public String address { get; set; }
  17. public String provinceId { get; set; }
  18. public String cardNumber { get; set; }
  19. public String email { get; set; }
  20. public String company { get; set; }
  21. public String description { get; set; }
  22. public String picture { get; set; }
  23. public String sexNeed { get; set; }
  24. public String birthday { get; set; }
  25. public String birthday_day { get; set; }
  26. public String birthday_month { get; set; }
  27. public String birthday_year { get; set; }
  28. public String height { get; set; }
  29. public String weight { get; set; }
  30. public String work { get; set; }
  31. public String isLike { get; set; }
  32. public String totalLike { get; set; }
  33. public String totalPic { get; set; }
  34. public String totalView { get; set; }
  35. public String lookingFor { get; set; }
  36. public List<Interest> listInterests { get; set; }
  37. public String interests { get; set; }
  38. public UserProfile() { }
  39. public UserProfile(string json) : this(JObject.Parse(json))
  40. { }
  41. public UserProfile(JObject jObject)
  42. {
  43. if (jObject != null)
  44. {
  45. id = (string)jObject["id"];
  46. usersId = (string)jObject["usersId"];
  47. users = (string)jObject["users"];
  48. //serviceid = (string)jObject["serviceid"];
  49. fullName = (string)jObject["fullName"];
  50. sex = (string)jObject["sex"];
  51. address = (string)jObject["address"];
  52. provinceId = (string)jObject["provinceId"];
  53. cardNumber = (string)jObject["cardNumber"];
  54. email = (string)jObject["email"];
  55. company = (string)jObject["company"];
  56. description = (string)jObject["description"];
  57. picture = (string)jObject["picture"];
  58. sexNeed = (string)jObject["sexNeed"];
  59. birthday = (string)jObject["birthday"];
  60. if (birthday != null && birthday != "")
  61. {
  62. birthday_day = birthday.Substring(0, 2);
  63. birthday_month = birthday.Substring(3, 2);
  64. birthday_year = birthday.Substring(6);
  65. }
  66. height = (string)jObject["height"];
  67. weight = (string)jObject["weight"];
  68. work = (string)jObject["work"];
  69. isLike = (string)jObject["isLike"];
  70. totalLike = (string)jObject["totalLike"];
  71. totalPic = (string)jObject["totalPic"];
  72. totalView = (string)jObject["totalView"];
  73. lookingFor = (string)jObject["lookingFor"];
  74. var list = jObject["listInterests"];
  75. if (list != null && list.HasValues)
  76. {
  77. listInterests = new List<Interest>();
  78. JArray a = (JArray)list;
  79. foreach (JObject o in a.Children<JObject>())
  80. {
  81. listInterests.Add(new Interest(o));
  82. }
  83. }
  84. }
  85. }
  86. }
  87. public class Interest
  88. {
  89. public String id { get; set; }
  90. public String code { get; set; }
  91. public String name { get; set; }
  92. public String picture { get; set; }
  93. public Interest() { }
  94. public Interest(JObject jObject)
  95. {
  96. if (jObject != null)
  97. {
  98. id = (string)jObject["id"];
  99. code = (string)jObject["code"];
  100. name = (string)jObject["name"];
  101. picture = (string)jObject["picture"];
  102. }
  103. }
  104. }
  105. }