예제 #1
0
        ///////////////////////////////////////////////////////////////////////
        // Public functions
        ///////////////////////////////////////////////////////////////////////
        public BalanceModel(FFDataSet.AccountRow aRow)
        {
            if (aRow == null)
            {
                throw new ArgumentNullException("AccountRow");
            }


            this.AccountID  = aRow.id;
            this.EnvelopeID = SpclEnvelope.NULL;
            this.Name       = aRow.name;
            this.GroupName  = aRow.AccountTypeRow.name;

            if (aRow.catagory == SpclAccountCat.ACCOUNT)
            {
                this._Type = BalanceModel.BalType.Account;
                this.setAccountBalance();
                this.setSubBalanceColection();
            }
            else if (aRow.catagory == SpclAccountCat.EXPENSE)
            {
                this._Type   = BalanceModel.BalType.Expence;
                this.Balance = 0.0m;
            }
            else if (aRow.catagory == SpclAccountCat.INCOME)
            {
                this._Type   = BalanceModel.BalType.Income;
                this.Balance = 0.0m;
            }
        }
            internal static BAL CreateInstanceOfType(BalType balType, IEnumerable <StackSymbolSequenceSet <S> > bottoms)
            {
                switch (balType)
                {
                case BalType.BAL_L: return(new BAL_L(bottoms));

                case BalType.BAL_R: return(new BAL_R(bottoms));

                default: throw new InvalidOperationException("illegal bal type");
                }
            }
예제 #3
0
        public BalanceModel(FFDataSet.EnvelopeRow eRow)
        {
            if (eRow == null)
            {
                throw new ArgumentNullException("EnvelopeRow");
            }

            this.AccountID  = SpclAccount.NULL;
            this.EnvelopeID = eRow.id;
            this.Name       = eRow.name;
            this.GroupName  = eRow.EnvelopeGroupRow.name;
            this._Type      = BalanceModel.BalType.Envelope;

            this.setEnvelopeBalance();
            this.setSubBalanceColection();
        }
예제 #4
0
        public BalanceModel(int accountID, int envelopeID, bool subEnvelope)
        {
            this.AccountID  = accountID;
            this.EnvelopeID = envelopeID;

            if (subEnvelope)
            {
                this.Name      = MyData.getInstance().Envelope.FindByid(envelopeID).name;
                this.GroupName = null;
                this._Type     = BalanceModel.BalType.SubEnvelope;

                this.setSubBalance();
            }
            else
            {
                this.Name      = MyData.getInstance().Account.FindByid(accountID).name;
                this.GroupName = null;
                this._Type     = BalanceModel.BalType.SubAccount;

                this.setSubBalance();
            }
        }
 internal override bool HasBALType(BalType balType)
 {
     return(balType == BalType.BAL_L);
 }
            internal static Func <Node <A, S>, StackSymbolSequenceSet <S> > GetOppositeSideSelector(BalType balType)
            {
                switch (balType)
                {
                case BalType.BAL_L: return(BAL_R.SideSelector);

                case BalType.BAL_R: return(BAL_L.SideSelector);

                default: throw new InvalidOperationException("illegal bal type");
                }
            }