Ejemplo n.º 1
0
        public static ENAddressEntityRecord ToStructure(ssAddress_CS.RestRecords.JSONENAddressEntityRecord obj, IBehaviorsConfiguration config)
        {
            ENAddressEntityRecord s = new ENAddressEntityRecord(null);

            if (obj != null)
            {
                s.ssId              = obj.AttrId == null ? 0L: obj.AttrId.Value;
                s.ssAddressLine1    = obj.AttrAddressLine1 == null ? "": obj.AttrAddressLine1;
                s.ssAddressLine2    = obj.AttrAddressLine2 == null ? "": obj.AttrAddressLine2;
                s.ssAddressLine3    = obj.AttrAddressLine3 == null ? "": obj.AttrAddressLine3;
                s.ssAddressLine4    = obj.AttrAddressLine4 == null ? "": obj.AttrAddressLine4;
                s.ssAddressLine5    = obj.AttrAddressLine5 == null ? "": obj.AttrAddressLine5;
                s.ssCity            = obj.AttrCity == null ? "": obj.AttrCity;
                s.ssCounty          = obj.AttrCounty == null ? "": obj.AttrCounty;
                s.ssPostcode        = obj.AttrPostcode == null ? "": obj.AttrPostcode;
                s.ssCountryId       = obj.AttrCountryId == null ? 0L: obj.AttrCountryId.Value;
                s.ssAddressTypeId   = obj.AttrAddressTypeId == null ? 0L: obj.AttrAddressTypeId.Value;
                s.ssActive          = obj.AttrActive == null ? true: obj.AttrActive.Value;
                s.ssCreatedDate     = obj.AttrCreatedDate == null ? new DateTime(1900, 1, 1, 0, 0, 0): OutSystems.RESTService.Conversions.TextToDateTime(obj.AttrCreatedDate, config.DateTimeFormat);
                s.ssCreatedBy       = obj.AttrCreatedBy == null ? 0: obj.AttrCreatedBy.Value;
                s.ssLastUpdatedDate = obj.AttrLastUpdatedDate == null ? new DateTime(1900, 1, 1, 0, 0, 0): OutSystems.RESTService.Conversions.TextToDateTime(obj.AttrLastUpdatedDate, config.DateTimeFormat);
                s.ssLastUpdatedBy   = obj.AttrLastUpdatedBy == null ? 0: obj.AttrLastUpdatedBy.Value;
            }
            return(s);
        }
 public JSONRCAddressRecord(RCAddressRecord s, IBehaviorsConfiguration config)
 {
     if (config.DefaultValuesBehavior == DefaultValuesBehavior.DontSend)
     {
         AttrAddress = ssAddress_CS.RestRecords.JSONENAddressEntityRecord.FromStructure(s.ssENAddress, config);
     }
     else
     {
         AttrAddress = ssAddress_CS.RestRecords.JSONENAddressEntityRecord.FromStructure(s.ssENAddress, config);
     }
 }