/////////////////////////////////////////////////////////////////////// // 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; } }
public AccountBankModel() { this.accountRow = MyData.getInstance().Account.NewAccountRow(); MyData.getInstance().Account.AddAccountRow(this.accountRow); MyData.getInstance().saveRow(this.accountRow); this.bankInfoRow = null; }
public bool doesAccountUseEnvelopes(int accountID) { FFDataSet.AccountRow account = this.ffDataSet.Account.FindByid(accountID); if (account != null) { return(account.envelopes); } else { return(false); } }
public FFDataSet.BankInfoRow NewBankInfoRow(FFDataSet.AccountRow account) { FFDataSet.BankInfoRow newRow = ffDataSet.BankInfo.NewBankInfoRow(); newRow.accountID = account.id; newRow.bankID = BankCON.NULL.ID; newRow.accountNumber = ""; newRow.polarity = PolarityCON.DEBIT.Value; ffDataSet.BankInfo.AddBankInfoRow(newRow); return(newRow); }
private void Account_TableNewRow(object sender, System.Data.DataTableNewRowEventArgs e) { FFDataSet.AccountRow row = e.Row as FFDataSet.AccountRow; int max = (from Account in this.Account select Account.id).Max(); row.id = max + 1; row.name = ""; row.typeID = SpclAccountType.NULL; row.catagory = SpclAccountCat.EXPENSE; row.closed = false; row.envelopes = false; }
public FFDataSet.AccountRow NewAccountRow() { FFDataSet.AccountRow newRow = ffDataSet.Account.NewAccountRow(); newRow.id = this.getNextIDFromTableNamed("Account"); newRow.name = ""; newRow.typeID = AccountTypeCON.NULL.ID; newRow.catagory = CatagoryCON.NULL.ID; newRow.closed = false; newRow.envelopes = false; ffDataSet.Account.AddAccountRow(newRow); return(newRow); }
public AccountDRM(FFDataSet.AccountRow accountRow, FFDataSet.BankInfoRow bankRow) { this.accountRow = accountRow; this.bankInfoRow = bankRow; }
/////////////////////////////////////////////////////////////////////// // Public functions /////////////////////////////////////////////////////////////////////// public AccountDRM() { this.accountRow = DataSetModel.Instance.NewAccountRow(); this.bankInfoRow = null; }
private void addRequiredTableRows() { //////////////////////////// // Required Account type Rows FFDataSet.AccountTypeRow accountTypeNull = this.ffDataSet.AccountType.FindByid(AccountTypeCON.NULL.ID); if (accountTypeNull == null) { accountTypeNull = this.ffDataSet.AccountType.AddAccountTypeRow(AccountTypeCON.NULL.ID, AccountTypeCON.NULL.Name); } //////////////////////////// // Required Envelope Group Rows FFDataSet.EnvelopeGroupRow envelopeGroupNull = this.ffDataSet.EnvelopeGroup.FindByid(EnvelopeGroupCON.NULL.ID); if (envelopeGroupNull == null) { envelopeGroupNull = this.ffDataSet.EnvelopeGroup.AddEnvelopeGroupRow(EnvelopeGroupCON.NULL.ID, AccountTypeCON.NULL.Name, 0.0m, 0.0m); } //////////////////////////// // Required Transaction Type Rows FFDataSet.TransactionTypeRow transactionTypeNull = this.ffDataSet.TransactionType.FindByid(TransactionTypeCON.NULL.ID); if (transactionTypeNull == null) { transactionTypeNull = this.ffDataSet.TransactionType.AddTransactionTypeRow(TransactionTypeCON.NULL.ID, TransactionTypeCON.NULL.Name); } //////////////////////////// // Required Bank Rows FFDataSet.BankRow bankNull = this.ffDataSet.Bank.FindByid(BankCON.NULL.ID); if (bankNull == null) { bankNull = this.ffDataSet.Bank.AddBankRow(BankCON.NULL.ID, BankCON.NULL.Name, " "); } //////////////////////////// // Required Account Rows FFDataSet.AccountRow accountNull = this.ffDataSet.Account.FindByid(AccountCON.NULL.ID); if (accountNull == null) { accountNull = this.ffDataSet.Account.AddAccountRow(AccountCON.NULL.ID, AccountCON.NULL.Name, accountTypeNull, CatagoryCON.NULL.ID, false, false); } //////////////////////////// // Required Envelope Rows FFDataSet.EnvelopeRow envelopeNull = this.ffDataSet.Envelope.FindByid(EnvelopeCON.NULL.ID); FFDataSet.EnvelopeRow envelopeNoEnvelope = this.ffDataSet.Envelope.FindByid(EnvelopeCON.NO_ENVELOPE.ID); if (envelopeNull == null) { envelopeNull = this.ffDataSet.Envelope.AddEnvelopeRow(EnvelopeCON.NULL.ID, EnvelopeCON.NULL.Name, envelopeGroupNull, false, accountNull, 0, " ", "N"); } if (envelopeNoEnvelope == null) { envelopeNoEnvelope = this.ffDataSet.Envelope.AddEnvelopeRow(EnvelopeCON.NO_ENVELOPE.ID, EnvelopeCON.NO_ENVELOPE.Name, envelopeGroupNull, false, accountNull, 0, " ", "N"); } //////////////////////////// // Required Transaction Row FFDataSet.TransactionRow transactionNull = this.ffDataSet.Transaction.FindByid(TransactionCON.NULL.ID); if (transactionNull == null) { transactionNull = this.ffDataSet.Transaction.AddTransactionRow(TransactionCON.NULL.ID, DateTime.MinValue, transactionTypeNull, ""); } //////////////////////////// // Required LineItem Row FFDataSet.LineItemRow lineItemNull = this.ffDataSet.LineItem.FindByid(LineItemCON.NULL.ID); if (lineItemNull == null) { lineItemNull = this.ffDataSet.LineItem.AddLineItemRow(LineItemCON.NULL.ID, transactionNull, accountNull, "", 0, TransactionStateCON.PENDING.Value, false); } }
public AccountBankModel(FFDataSet.AccountRow aRow) { this.accountRow = aRow; this.bankInfoRow = MyData.getInstance().BankInfo.FindByaccountID(this.ID); }
/////////////////////////////////////////////////////////////////////// // Private functions /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // Public functions /////////////////////////////////////////////////////////////////////// public AccountBankModel(int aID) { this.accountRow = MyData.getInstance().Account.FindByid(aID); this.bankInfoRow = MyData.getInstance().BankInfo.FindByaccountID(aID); }