This commit is contained in:
2021-07-27 19:13:51 +00:00
parent 4cd151f88b
commit 120f9f85a4
3 changed files with 9 additions and 9 deletions

View File

@@ -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
}
}
/// <summary>

View File

@@ -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;
}

View File

@@ -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]