using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Newtonsoft.Json; namespace jdis_import.RESTObjects { [JsonObject(MemberSerialization.OptIn)] public class WorkOrder { [JsonProperty(PropertyName = "ID")] public int ID { get; set; } [JsonProperty(PropertyName = "CustomerID")] public int CustomerID { get { return this.Customer != null ? this.Customer.ID : 0; } set { value = this.Customer != null ? this.Customer.ID : 0; } } [JsonProperty(PropertyName = "PriorityID")] public int PriorityID { get { return this.Priority != null ? this.Priority.ID : 0; } set { value = this.Priority != null ? this.Priority.ID : 0; } } [JsonProperty(PropertyName = "StatusID")] public int StatusID { get { return this.Status != null ? this.Status.ID : 0; } set { value = this.Status != null ? this.Status.ID : 0; } } [JsonProperty(PropertyName = "EquipmentID")] public int EquipmentID { get { return this.Equipment != null ? this.Equipment.ID : 0; } set { value = this.Equipment != null ? this.Equipment.ID : 0; } } [JsonProperty(PropertyName = "ReasonID")] public int? ReasonID { get { return this.Reason != null ? this.Reason.ID : null; } set { value = this.Reason != null ? this.Reason.ID : null; } } [JsonProperty(PropertyName = "IncompleteReasonID")] public int? IncompleteReasonID { get; set; } [JsonProperty(PropertyName = "TechnicianUserID")] public int TechnicianUserID { get { return this.Technician != null ? this.Technician.ID : 0; } set { value = this.Technician != null ? this.Technician.ID : 0; } } [JsonProperty(PropertyName = "Number")] public string Number { get; set; } [JsonProperty(PropertyName = "MeterReading")] public decimal? MeterReading { get; set; } [JsonProperty(PropertyName = "Odometer")] public decimal? Odometer { get; set; } [JsonProperty(PropertyName = "SpecialInstructions")] public string SpecialInstructions { get; set; } [JsonProperty(PropertyName = "ScheduledStartDate")] public DateTime ScheduledStartDate { get; set; } [JsonProperty(PropertyName = "ScheduledEndDate")] public DateTime ScheduledEndDate { get; set; } [JsonProperty(PropertyName = "StartDate")] public DateTime? StartDate { get; set; } [JsonProperty(PropertyName = "EndDate")] public DateTime? EndDate { get; set; } [JsonProperty(PropertyName = "ApprovedDate")] public DateTime? ApprovedDate { get; set; } [JsonProperty(PropertyName = "CreateDate")] public DateTime CreateDate { get; set; } [JsonProperty(PropertyName = "CreateUserID")] public int CreateUserID { get; set; } [JsonProperty(PropertyName = "UpdateDate")] public DateTime UpdateDate { get; set; } [JsonProperty(PropertyName = "UpdateUserID")] public int UpdateUserID { get; set; } [JsonProperty(PropertyName = "Customer")] public Customer Customer { get; set; } [JsonProperty(PropertyName = "Priority")] public Priority Priority { get; set; } [JsonProperty(PropertyName = "Status")] public Status Status { get; set; } [JsonProperty(PropertyName = "Equipment")] public Equipment Equipment { get; set; } [JsonProperty(PropertyName = "Reason")] public Reason Reason { get; set; } [JsonProperty(PropertyName = "Technician")] public User Technician { get; set; } } }