Class4.cs 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Serialization;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace WpfApp1.model
  8. {
  9. [DataContract]
  10. public class Client
  11. {
  12. [DataMember]
  13. public string Name { get; set; }
  14. [DataMember]
  15. public int Age { get; set; }
  16. [DataMember]
  17. public int Price { get; set; }
  18. [DataMember]
  19. public string Place { get; set; }
  20. [DataMember]
  21. public string Category { get; set; }
  22. [DataMember]
  23. public bool IsActive { get; set; }
  24. [DataMember(Name = "DateFlight")]
  25. private string? stringDate { get; set; }
  26. [IgnoreDataMember]
  27. public DateTime? DateFlight
  28. {
  29. get
  30. {
  31. return stringDate == null ? null : DateTime.Parse(stringDate);
  32. }
  33. set
  34. {
  35. stringDate = value.ToString();
  36. }
  37. }
  38. }
  39. }