public AuditTrail(JToken node) : base(node) { if (node["id"] != null) { this._Id = ParseInt(node["id"].Value <string>()); } if (node["createdAt"] != null) { this._CreatedAt = ParseInt(node["createdAt"].Value <string>()); } if (node["parsedAt"] != null) { this._ParsedAt = ParseInt(node["parsedAt"].Value <string>()); } if (node["status"] != null) { this._Status = (AuditTrailStatus)ParseEnum(typeof(AuditTrailStatus), node["status"].Value <string>()); } if (node["auditObjectType"] != null) { this._AuditObjectType = (AuditTrailObjectType)StringEnum.Parse(typeof(AuditTrailObjectType), node["auditObjectType"].Value <string>()); } if (node["objectId"] != null) { this._ObjectId = node["objectId"].Value <string>(); } if (node["relatedObjectId"] != null) { this._RelatedObjectId = node["relatedObjectId"].Value <string>(); } if (node["relatedObjectType"] != null) { this._RelatedObjectType = (AuditTrailObjectType)StringEnum.Parse(typeof(AuditTrailObjectType), node["relatedObjectType"].Value <string>()); } if (node["entryId"] != null) { this._EntryId = node["entryId"].Value <string>(); } if (node["masterPartnerId"] != null) { this._MasterPartnerId = ParseInt(node["masterPartnerId"].Value <string>()); } if (node["partnerId"] != null) { this._PartnerId = ParseInt(node["partnerId"].Value <string>()); } if (node["requestId"] != null) { this._RequestId = node["requestId"].Value <string>(); } if (node["userId"] != null) { this._UserId = node["userId"].Value <string>(); } if (node["action"] != null) { this._Action = (AuditTrailAction)StringEnum.Parse(typeof(AuditTrailAction), node["action"].Value <string>()); } if (node["data"] != null) { this._Data = ObjectFactory.Create <AuditTrailInfo>(node["data"]); } if (node["ks"] != null) { this._Ks = node["ks"].Value <string>(); } if (node["context"] != null) { this._Context = (AuditTrailContext)ParseEnum(typeof(AuditTrailContext), node["context"].Value <string>()); } if (node["entryPoint"] != null) { this._EntryPoint = node["entryPoint"].Value <string>(); } if (node["serverName"] != null) { this._ServerName = node["serverName"].Value <string>(); } if (node["ipAddress"] != null) { this._IpAddress = node["ipAddress"].Value <string>(); } if (node["userAgent"] != null) { this._UserAgent = node["userAgent"].Value <string>(); } if (node["clientTag"] != null) { this._ClientTag = node["clientTag"].Value <string>(); } if (node["description"] != null) { this._Description = node["description"].Value <string>(); } if (node["errorDescription"] != null) { this._ErrorDescription = node["errorDescription"].Value <string>(); } }
public AuditTrail(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "id": this._Id = ParseInt(propertyNode.InnerText); continue; case "createdAt": this._CreatedAt = ParseInt(propertyNode.InnerText); continue; case "parsedAt": this._ParsedAt = ParseInt(propertyNode.InnerText); continue; case "status": this._Status = (AuditTrailStatus)ParseEnum(typeof(AuditTrailStatus), propertyNode.InnerText); continue; case "auditObjectType": this._AuditObjectType = (AuditTrailObjectType)StringEnum.Parse(typeof(AuditTrailObjectType), propertyNode.InnerText); continue; case "objectId": this._ObjectId = propertyNode.InnerText; continue; case "relatedObjectId": this._RelatedObjectId = propertyNode.InnerText; continue; case "relatedObjectType": this._RelatedObjectType = (AuditTrailObjectType)StringEnum.Parse(typeof(AuditTrailObjectType), propertyNode.InnerText); continue; case "entryId": this._EntryId = propertyNode.InnerText; continue; case "masterPartnerId": this._MasterPartnerId = ParseInt(propertyNode.InnerText); continue; case "partnerId": this._PartnerId = ParseInt(propertyNode.InnerText); continue; case "requestId": this._RequestId = propertyNode.InnerText; continue; case "userId": this._UserId = propertyNode.InnerText; continue; case "action": this._Action = (AuditTrailAction)StringEnum.Parse(typeof(AuditTrailAction), propertyNode.InnerText); continue; case "data": this._Data = ObjectFactory.Create <AuditTrailInfo>(propertyNode); continue; case "ks": this._Ks = propertyNode.InnerText; continue; case "context": this._Context = (AuditTrailContext)ParseEnum(typeof(AuditTrailContext), propertyNode.InnerText); continue; case "entryPoint": this._EntryPoint = propertyNode.InnerText; continue; case "serverName": this._ServerName = propertyNode.InnerText; continue; case "ipAddress": this._IpAddress = propertyNode.InnerText; continue; case "userAgent": this._UserAgent = propertyNode.InnerText; continue; case "clientTag": this._ClientTag = propertyNode.InnerText; continue; case "description": this._Description = propertyNode.InnerText; continue; case "errorDescription": this._ErrorDescription = propertyNode.InnerText; continue; } } }