[This is preliminary documentation and is subject to change.]

Indicates if the current row has changed.

Namespace:  Firefly.Box
Assembly:  Firefly.Box (in Firefly.Box.dll) Version: 3.4.23.6473 (3.4.23.6473)

Syntax

C#
public bool RowChanged { get; }
Visual Basic (Declaration)
Public ReadOnly Property RowChanged As Boolean
Visual C++
public:
property bool RowChanged {
	bool get ();
}

Remarks

This property indicates whether the current row has changed. In case it has, it will be save to the database on the SavingRow event.
  • Will Return "True" when the row has changed
  • Causes SavingRow event when leaving the row
  • RowChanged property becomes insignificant if OnChangeMarkRowAsChanged is set to "False"

Examples

The following example show the iterations between and
This example is in the form of Unit Tests. It references the NUnit framework. This framework can be downloaded from www.NUnit.org. For more information about unit testing visit: www.NUnit.org.
This example is based on test data. The code for the entities included in this test data can be found in the documentation of Entity
CopyC#
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Firefly.Box;
using Firefly.Box.Testing;

namespace TestFirefly.Box.Documentation
{
    [TestFixture]
    public class RowChangedProperty
    {
        [Test]
        public void ChangedRowProperySetToTrue()
        {
            var jobs = new Pubs.Jobs();
            jobs.InitializeWithTestData();
            var savingRowHappened = false;
            var bp = new BusinessProcess { From = jobs };
            bp.SavingRow += args => savingRowHappened = true;
            bp.ForFirstRow(() =>
            {
                bp.RowChanged.ShouldBe(false);
                jobs.Description.Value = "";
                bp.RowChanged.ShouldBe(true);
            });

            savingRowHappened.ShouldBe(true);
        }

        [Test]
        public void SetOnChangeMarkRowAsChanged()
        {
            var jobs = new Pubs.Jobs();
            jobs.InitializeWithTestData();
            var savingRowHappened = false;
            var bp = new BusinessProcess { From = jobs };
            bp.SavingRow += args => savingRowHappened = true;
            jobs.Description.OnChangeMarkRowAsChanged = false;

            bp.ForFirstRow(() =>
            {
                bp.RowChanged.ShouldBe(false);
                jobs.Description.Value = "";
                bp.RowChanged.ShouldBe(false);
            });


            savingRowHappened.ShouldBe(false);
        }
    }
}

See Also