using System;
using System.Reflection;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using MicroFour.StrataFrame.UI.Windows.Forms;

using MicroFour.StrataFrame.Business;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Runtime.Serialization;




namespace TestConcurr1
{
    // --- Subclass the Form ---    
    public partial class MyForm : MicroFour.StrataFrame.UI.Windows.Forms.StandardForm
        {
             public MyForm()
             {
                // InitializeComponent();
                 this.AutoHandleCollisions = false;
                 this.BackColor = System.Drawing.Color.LemonChiffon;
             }

        
             private void MyForm_Load(object sender, EventArgs e)
             {

             }
            
        }


        /// <summary>
        ///  SubClass the BO ---
        /// </summary>
        public class MyBO : MicroFour.StrataFrame.Business.BusinessLayer
        {
            public MyBO()
                : base()
            { }

            public MyBO(IContainer container)
                : base(container)
            { }

            public MyBO(SerializationInfo info, StreamingContext context)
                : base(info, context)
            { }

            protected override void OnSetDefaultValues()
            {
                base.OnSetDefaultValues();
            }

            private void MyBO_ConcurrencyException(MicroFour.StrataFrame.Data.ConcurrencyExceptionEventArgs e)
            {
                this.AddBrokenRule(this.PrimaryKeyField, "Another user has amended this item at the same time");
                //e.ResaveRecord = true;
                //this.Save();
                e.ResaveRecord = false;
             }

        }





}

