Ejemplo n.º 1
0
 /// <summary>
 /// Compares two objects and breaks the data integrity seal if the objects are not equal.
 /// </summary>
 protected PostalAddress PokeSeal(PostalAddress OldValue, PostalAddress NewValue)
 {
     if(OldValue != NewValue)
         BreakSeal();
     return(NewValue);
 }
Ejemplo n.º 2
0
 public static PostalAddress Deserialize(string str)
 {
     if (str.Contains(Delimiter.ToString()))
     {
         PostalAddress obj = new PostalAddress();
         string[] ary = str.Split(Delimiter);
         int i = 0;
         obj.Reference = ary[i++];
         obj.Address1 = ary[i++];
         obj.Address2 = ary[i++];
         obj.Address3 = ary[i++];
         obj.City = ary[i++];
         obj.StateCode = ary[i++];
         obj.StateName = ary[i++];
         obj.PostalCode = ary[i++];
         obj.CountryCode = ary[i++];
         obj.CountryName = ary[i++];
         return obj;
     }
     else
     {
         return new PostalAddress(str);
     }
 }
Ejemplo n.º 3
0
 public static string Serialize(PostalAddress obj)
 {
     string str = String.Empty;
     str += obj.Reference + Delimiter;
     str += obj.Address1 + Delimiter;
     str += obj.Address2 + Delimiter;
     str += obj.Address3 + Delimiter;
     str += obj.City + Delimiter;
     str += obj.StateCode + Delimiter;
     str += obj.StateName + Delimiter;
     str += obj.PostalCode + Delimiter;
     str += obj.CountryCode + Delimiter;
     str += obj.CountryName;
     return str;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Convert an XMLNameValueCollection into a sql object
        /// </summary>
        /*
        public static object ToSql(ArrayList input)
        {
            return ToSql(input, true);
        }

        public static object ToSql(ArrayList input, bool blnStrongDataType)
        {
            if (input == null)
                return DBNull.Value;
            else
            {
                string strData = General.Utilities.Serialization.ArrayList.SerializeArrayList(input, ",",blnStrongDataType);
                if (!StringFunctions.IsNullOrWhiteSpace(strData))
                    return strData;
                else
                    return DBNull.Value;
            }
        }
        */
        /// <summary>
        /// Convert an XMLNameValueCollection into a sql object
        /// </summary>
        public static object ToSql(PostalAddress input)
        {
            if (input == null)
                return DBNull.Value;
            else
                return PostalAddress.Serialize(input);
        }