Пример #1
0
        public static AccountStandard CreateAccountStandard(AccountAction accountInput, string[] fields)
        {
            try
            {
                var accountStandard = new AccountStandard();
                for (var i = 0; i < fields.Length; i++)
                {
                    if (accountInput.Actions?[i] != null)
                    {
                        accountInput.Actions[i](accountStandard, fields[i]);
                    }
                }

                if (!accountStandard.Validation())
                {
                    accountStandard = null;
                }

                return(accountStandard);
            }
            catch (Exception e)
            {
                //Console.WriteLine(e);
                return(null);
            }
        }
Пример #2
0
 public static void TypeType(AccountStandard account, string type)
 {
     Enum.TryParse(type, true, out EType eType);
     if (eType < EType.Unknown || eType >= EType.Max)
     {
         eType = EType.Unknown;
     }
     account.Type = eType;
 }
Пример #3
0
 // Identifier -> AccountCode
 public static void IdentifierAccountCode(AccountStandard account, string identifier)
 {
     account.AccountCode = null;
     if (identifier != null)
     {
         var pos = identifier.IndexOf('|');
         if (pos >= 0)
         {
             account.AccountCode = identifier.Substring(pos + 1);
         }
     }
 }
Пример #4
0
        // Currency: CD->CAD US->USD
        public static void CurrencyCurrency(AccountStandard account, string currency)
        {
            var inCurrency = currency?.Trim().ToUpper();

            switch (inCurrency)
            {
            case "CD":
            case "C":
                account.Currency = ECurrency.CAD;
                break;

            case "US":
            case "U":
                account.Currency = ECurrency.USD;
                break;

            default:
                account.Currency = ECurrency.Unknown;
                break;
            }
        }
Пример #5
0
 public static void CustodianCodeAccountCode(AccountStandard account, string code)
 {
     account.AccountCode = code;
 }
Пример #6
0
 public static void NameName(AccountStandard account, string name)
 {
     account.Name = name;
 }
Пример #7
0
 // Identifier -> AccountCode
 public static void OpenedOpenDate(AccountStandard account, string date)
 {
     account.OpenDate = Convert.ToDateTime(date);
 }