Пример #1
0
        protected override void InitializeCore(DataRow sourceRow)
        {
            Currency currency = EntitySet.Currencies.Get(GetInt32(sourceRow, "currency_id", 0));

            CreationDate        = GetDateTime(sourceRow, "creation_date");
            LastTransactionDate = GetDateTime(sourceRow, "last_transaction_date");
            Type = EntityEnum.Parse <AccountType>(GetString(sourceRow, "type"));
            CardPaymentSystem = EntityEnum.Parse <PaymentSystem>(GetString(sourceRow, "card_issuer"));
            Issuer            = GetString(sourceRow, "issuer");
            Number            = GetString(sourceRow, "number");
            Total             = new Money(GetMoneyAmount(sourceRow, "total_amount", 0m), currency);
            Limit             = new Money(GetMoneyAmount(sourceRow, "total_limit", 0m), currency);
            SortOrder         = GetInt32(sourceRow, "sort_order", 0);
            Active            = GetBoolean(sourceRow, "is_active");
            Aggregate         = GetBoolean(sourceRow, "is_include_into_totals");
            CancellationDate  = GetDateTime(sourceRow, "closing_day");
        }
Пример #2
0
        protected override void InitializeCore(DataRow sourceRow)
        {
            _parentId = GetInt32(sourceRow, "parent_id", 0);

            AccountFrom      = EntitySet.Accounts.Get(GetInt32(sourceRow, "from_account_id", 0));
            AccountTo        = EntitySet.Accounts.Get(GetInt32(sourceRow, "to_account_id", 0));
            Category         = EntitySet.Categories.Get(GetInt32(sourceRow, "category_id", 0));
            Project          = EntitySet.Projects.Get(GetInt32(sourceRow, "project_id", 0));
            Note             = GetString(sourceRow, "note");
            AmountFrom       = GetMoneyAmount(sourceRow, "from_amount", 0m);
            AmountTo         = GetMoneyAmount(sourceRow, "to_amount", 0m);
            DateTime         = GetDateTime(sourceRow, "datetime", DateTime.MinValue);
            Status           = EntityEnum.Parse <TransactionStatus>(GetString(sourceRow, "status"));
            OriginalCurrency = EntitySet.Currencies.Get(GetInt32(sourceRow, "original_currency_id", 0));
            OriginalAmount   = GetMoneyAmount(sourceRow, "original_from_amount", 0m);
            IsTemplate       = GetBoolean(sourceRow, "is_template");
            TemplateName     = GetString(sourceRow, "template_name");
        }