Click or drag to resize
CalculationWorks Logo
Add HasChanges to BcfDataSet
Adding HasChanges Property and AcceptChanges() to a BcfDataSet

This example shows how a BcfDataSet can provide a property like the System.Data.DataSet "HasChanges" property.

This example requires a BcfDataSetStateIdBehavior.

Code Item

Meaning

SampleDataSet

Your BcfDataSets class name.

partial class SampleDataSet {

    private Guid acceptedStateIdField;

    public bool HasChanges {
        get {
            return Behavior.StateIdItem.Value != acceptedStateIdField;
        }
    }

    public void AcceptChanges() {
        acceptedStateIdField = Behavior.StateIdItem.Value;
    }
}
See Also