示例#1
0
        public static Internal.AccountItem ToAccountItem(this AccountInfo obj)
        {
            if (obj == null)
            {
                return(null);
            }

            var ret = new Internal.AccountItem();

            ret.AccountId     = obj.AccountId;
            ret.AccountName   = obj.AccountName;
            ret.AccountNumber = obj.AccountNumber;
            ret.AccountState  = obj.AccountState;
            ret.Active        = obj.Active;
            ret.TimeZone      = obj.TimeZone.ToString();

            ret.BillingAddr = obj.BillingAddress.ToAddressItem();
            ret.Contact     = obj.Contact.ToUserItem();

            return(ret);
        }
示例#2
0
        public static AccountInfo ToAccountInfo(this Internal.AccountItem obj)
        {
            if (obj == null)
            {
                return(null);
            }

            var ret = new AccountInfo();

            ret.AccountId     = obj.AccountId;
            ret.AccountName   = obj.AccountName;
            ret.AccountNumber = obj.AccountNumber;
            ret.AccountState  = obj.AccountState;
            ret.Active        = obj.Active;

            try { ret.TimeZone = (TimeZoneName)Enum.Parse(typeof(TimeZoneName), obj.TimeZone, true); }
            catch { ret.TimeZone = TimeZoneName.Eastern; }

            ret.BillingAddress = new Address(obj.BillingAddr);
            ret.Contact        = new User(obj.Contact);

            return(ret);
        }