Example #1
0
        ///////////////////////////////////////////////////////////////////////
        // Event stuff
        ///////////////////////////////////////////////////////////////////////



        ///////////////////////////////////////////////////////////////////////
        //
        ///////////////////////////////////////////////////////////////////////
        public FFDataSet.TransactionRow getTransactionRowWithID(int transID)
        {
            FFDataSet.TransactionRow row = ffDataSet.Transaction.FindByid(transID);

            if (row == null)
            {
                showErrorMessage("Invalid transaction row ID.");
            }

            return(row);
        }
Example #2
0
        public TransactionModel(FFDataSet.TransactionRow tRow) : base(tRow)
        {
            this.LineItems = new ObservableCollection <LineItemModel>();
            this.LineItems.CollectionChanged += new NotifyCollectionChangedEventHandler(LineItems_CollectionChanged);

            // add the lines this way so the collection(add/Remove) event can handle
            // subscribing and unsubscribing
            foreach (LineItemModel newLine in this.getLineItemModels())
            {
                this.LineItems.Add(newLine);
            }
        }
Example #3
0
        public FFDataSet.TransactionRow NewTransactionRow()
        {
            FFDataSet.TransactionRow newRow = ffDataSet.Transaction.NewTransactionRow();

            newRow.id          = this.getNextIDFromTableNamed("Transaction");
            newRow.date        = DateTime.Today;
            newRow.typeID      = TransactionTypeCON.NULL.ID;
            newRow.description = "";

            ffDataSet.Transaction.AddTransactionRow(newRow);

            return(newRow);
        }
        private void Transaction_TableNewRow(object sender, System.Data.DataTableNewRowEventArgs e)
        {
            FFDataSet.TransactionRow row = e.Row as FFDataSet.TransactionRow;

            int max =
                (from Transaction in this.Transaction
                 select Transaction.id).Max();

            row.id                 = max + 1;
            row.date               = DateTime.Today;
            row.typeID             = SpclAccountType.NULL;
            row.description        = "";
            row.confirmationNumber = "";
            row.complete           = LineComplete.PENDING;
        }
Example #5
0
        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);
            }
        }
Example #6
0
 public TransactionDRM(int transactionID)
 {
     this.transactionRow = DataSetModel.Instance.getTransactionRowWithID(transactionID);
 }
Example #7
0
 public TransactionDRM(FFDataSet.TransactionRow tRow)
 {
     this.transactionRow = tRow;
 }
Example #8
0
 ///////////////////////////////////////////////////////////
 // Public functions
 ///////////////////////////////////////////////////////////
 public TransactionDRM()
 {
     this.transactionRow = DataSetModel.Instance.NewTransactionRow();
 }
Example #9
0
 public TransactionModel(FFDataSet.TransactionRow row)
 {
     this.transactionRow = row;
 }
Example #10
0
 ///////////////////////////////////////////////////////////////////////
 // Public functions
 ///////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Default constructor. Adds a new transaction row to the table.
 /// </summary>
 public TransactionModel()
 {
     this.transactionRow = MyData.getInstance().Transaction.NewTransactionRow();
     MyData.getInstance().Transaction.AddTransactionRow(this.transactionRow);
     this.saveRow();
 }