diff --git a/server/AyaNova/biz/AyaTypeId.cs b/server/AyaNova/biz/AyaTypeId.cs index 8b623417..51805c48 100644 --- a/server/AyaNova/biz/AyaTypeId.cs +++ b/server/AyaNova/biz/AyaTypeId.cs @@ -39,19 +39,18 @@ namespace AyaNova.Biz _ayaType = aType; } - public AyaTypeId(string sATypeNumeral, string sId) + [Newtonsoft.Json.JsonConstructor] + public AyaTypeId(string sAType, string sId) { _id = long.Parse(sId); - int nType = int.Parse(sATypeNumeral); + int nType = int.Parse(sAType); if (!AyaTypeExists(nType)) _ayaType = AyaType.NoType; else - _ayaType = (AyaType)Enum.Parse(typeof(AyaType), sATypeNumeral); + _ayaType = (AyaType)Enum.Parse(typeof(AyaType), sAType); } - public AyaTypeId() - { - } + public bool Equals(AyaTypeId x, AyaTypeId y) { @@ -75,7 +74,7 @@ namespace AyaNova.Biz } } - + /// diff --git a/server/AyaNova/biz/WorkOrderBiz.cs b/server/AyaNova/biz/WorkOrderBiz.cs index 8bb17a8d..f0cbc7c8 100644 --- a/server/AyaNova/biz/WorkOrderBiz.cs +++ b/server/AyaNova/biz/WorkOrderBiz.cs @@ -166,10 +166,11 @@ namespace AyaNova.Biz await WorkOrderHandlePotentialNotificationEvent(AyaEvent.Created, newObject); - if (!newObject.GenCopyAttachmentsFrom.IsEmpty) + if (newObject.GenCopyAttachmentsFrom !=null && !newObject.GenCopyAttachmentsFrom.IsEmpty) { //copy attachment from existing object + newObject.GenCopyAttachmentsFrom=null;//so it doesn't get returned } return newObject; } diff --git a/server/AyaNova/models/WorkOrder.cs b/server/AyaNova/models/WorkOrder.cs index 283479e1..b7d70a57 100644 --- a/server/AyaNova/models/WorkOrder.cs +++ b/server/AyaNova/models/WorkOrder.cs @@ -116,7 +116,7 @@ namespace AyaNova.Models public bool UserCanViewLoanerCosts { get; set; } - [NotMapped] + [NotMapped,JsonProperty(NullValueHandling=NullValueHandling.Ignore)] public AyaTypeId GenCopyAttachmentsFrom { get; set; }//INTERNAL, USED TO SIGNIFY ATTACHMENTS NEED TO BE COPIED ON SAVE [NotMapped, JsonIgnore]