private void Envelope_TableNewRow(object sender, System.Data.DataTableNewRowEventArgs e) { FFDataSet.EnvelopeRow row = e.Row as FFDataSet.EnvelopeRow; int max = (from Envelope in this.Envelope select Envelope.id).Max(); int maxP = (from Envelope in this.Envelope select Envelope.priorityOrder).Max(); row.id = max + 1; row.name = ""; row.groupID = SpclEnvelope.NULL; row.closed = false; row.accountID = SpclAccount.NULL; row.priorityOrder = maxP + 1; row.notes = ""; row.step = 0.0m; row.cap = 0.0m; row.nextDate = DateTime.Today; row.intervalDate = DateTime.MinValue; }
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(); }
public FFDataSet.EnvelopeRow NewEnvelopeRow() { FFDataSet.EnvelopeRow newRow = ffDataSet.Envelope.NewEnvelopeRow(); newRow.id = this.getNextIDFromTableNamed("Envelope"); newRow.name = ""; newRow.groupID = EnvelopeGroupCON.NULL.ID; newRow.favoriteAccountID = AccountCON.NULL.ID; newRow.closed = false; newRow.priority = newRow.id; newRow.notes = ""; newRow.goal = ""; ffDataSet.Envelope.AddEnvelopeRow(newRow); return(newRow); }
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); } }
/// <summary> /// Creates the object with a referance to a new account row. /// </summary> public EnvelopeModel() { this.envelopeRow = MyData.getInstance().Envelope.NewEnvelopeRow(); MyData.getInstance().Envelope.AddEnvelopeRow(this.envelopeRow); this.saveRow(); }
/// <summary> /// Creates the object and keeps a local referance to the given account row. /// </summary> /// <param name="aRow"></param> public EnvelopeModel(FFDataSet.EnvelopeRow eRow) { this.envelopeRow = eRow; }
public EnvelopeDRM(FFDataSet.EnvelopeRow eRow) { this.envelopeRow = eRow; }
/////////////////////////////////////////////////////////////////////// // Public functions /////////////////////////////////////////////////////////////////////// public EnvelopeDRM() { this.envelopeRow = DataSetModel.Instance.NewEnvelopeRow(); }