using MicroFour.StrataFrame.Business;
using MicroFour.StrataFrame.Security;
using MicroFour.StrataFrame.UI.Windows.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.IO;

namespace TestConcurr1
{
    partial class TestSFCustBO
    {

        #region Component Implementation

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            components = new System.ComponentModel.Container();

            this.CheckRulesOnCurrentRow += new CheckRulesOnCurrentRowEventHandler(TestSFCustBO_CheckRulesOnCurrentRow);
            this.SetDefaultValues += new SetDefaultValuesEventHandler(TestSFCustBO_SetDefaultValues);
        }

        #endregion


        #region BusinessLayer Overriden Methods & Properties

        /// <summary>
        /// The collection of required fields for the business object.
        /// </summary>
        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public override RequiredFieldsCollection RequiredFields
        {
            get
            {
                return base.RequiredFields;
            }
            set
            {
                base.RequiredFields = value;
            }
        }

        /// <summary>
        /// Defines the constraint that defines the parent-child relationship between this business object type and another business object type.
        /// </summary>
        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public override IBusinessParentRelationship ParentRelationship
        {
            get
            {
                return base.ParentRelationship;
            }
            set
            {
                base.ParentRelationship = value;
            }
        }

        /// <summary>
        /// Returns all of the field names in a single string in the form of [field1],[field2],...  This must be used in the place of '*' in select statements if Query Notifications are to be registered.
        /// </summary>
        protected override String AllFieldNames
        {
            get
            {
                return "[cust_pk],[cust_Company],[cust_Prefix],[cust_FirstName],[cust_MiddleName],[cust_LastName],[cust_Suffix],[cust_Address1],[cust_Address2],[cust_City],[cust_State],[cust_Postal],[cust_Country],[cust_Email],[cust_PhoneDay],[cust_PhoneDayType],[cust_PhoneNight],[cust_PhoneNightType],[cust_Created],[cust_Version]";
            }
        }

        /// <summary>
        /// The name of the database that contains the table to which this business object is mapped.
        /// </summary>
        public override String Database
        {
            get
            {
                return "StrataFrameSample";
            }
        }

        private static string[] _PrimaryKeyFields = new string[] { "cust_pk" };
        /// <summary>
        /// Gets the field or fields that comprise the primary key for the business object.
        /// </summary>
        public override string[] PrimaryKeyFields
        {
            get
            {
                return _PrimaryKeyFields;
            }
        }

        /// <summary>
        /// The name of the table in the database to which this business object is mapped.
        /// </summary>
        public override String TableName
        {
            get
            {
                return "Customers";
            }
        }

        /// <summary>
        /// The schema of the table in the database to which this business object is mapped.
        /// </summary>
        public override String TableSchema
        {
            get
            {
                return "dbo";
            }
        }

        /// <summary>
        /// Creates and returns an array of DataColumns that contains the schema for the table.  This is used to prevent a round trip to the server to aquire the initial schema for the internal DataTable.
        /// </summary>
        protected override DataColumn[] CreateTableSchema()
        {
            return new DataColumn[] {
new DataColumn("cust_pk", typeof(System.Int32)),
new DataColumn("cust_Company", typeof(System.String)),
new DataColumn("cust_Prefix", typeof(System.String)),
new DataColumn("cust_FirstName", typeof(System.String)),
new DataColumn("cust_MiddleName", typeof(System.String)),
new DataColumn("cust_LastName", typeof(System.String)),
new DataColumn("cust_Suffix", typeof(System.String)),
new DataColumn("cust_Address1", typeof(System.String)),
new DataColumn("cust_Address2", typeof(System.String)),
new DataColumn("cust_City", typeof(System.String)),
new DataColumn("cust_State", typeof(System.String)),
new DataColumn("cust_Postal", typeof(System.String)),
new DataColumn("cust_Country", typeof(System.String)),
new DataColumn("cust_Email", typeof(System.String)),
new DataColumn("cust_PhoneDay", typeof(System.String)),
new DataColumn("cust_PhoneDayType", typeof(System.Int32)),
new DataColumn("cust_PhoneNight", typeof(System.String)),
new DataColumn("cust_PhoneNightType", typeof(System.Int32)),
new DataColumn("cust_Created", typeof(System.DateTime)),
new DataColumn("cust_Version", typeof(System.Int32))};
        }

        /// <summary>
        /// Adds a broken rule to the business object's collection
        /// </summary>
        protected void AddBrokenRule(TestSFCustBOFieldNames Field, string ErrorMessage)
        {
            base.AddBrokenRule(Field, ErrorMessage);
        }

        /// <summary>
        /// Adds a broken rule to the business object's collection
        /// </summary>
        protected new void AddBrokenRule(string FieldName, string ErrorMessage)
        {
            base.AddBrokenRule(FieldName, ErrorMessage);
        }

        /// <summary>
        /// Adds a broken rules to the business object's collection using the given message key to pull the error message from the localization database
        /// </summary>
        protected void AddBrokenRuleByKey(TestSFCustBOFieldNames Field, string ErrorMessageKey)
        {
            base.AddBrokenRuleByKey(Field, ErrorMessageKey);
        }

        /// <summary>
        /// Adds a broken rules to the business object's collection using the given message key to pull the error message from the localization database
        /// </summary>
        protected new void AddBrokenRuleByKey(string FieldName, string ErrorMessageKey)
        {
            base.AddBrokenRuleByKey(FieldName, ErrorMessageKey);
        }

        /// <summary>
        /// Gets a collection of the names for all fields that belong to this business object and map to the database.
        /// </summary>
        public override List<string> AllFieldsList
        {
            get
            {
                return _AllFieldsList;
            }
        }

        /// <summary>
        /// Gets a dictionary of the DbTypes for all fields that belong to this business object and map to the database.
        /// </summary>
        public override Dictionary<string, DbType> FieldDbTypes
        {
            get
            {
                return _FieldDbTypes;
            }
        }

        /// <summary>
        /// Gets a dictionary of all fields within this business object that map to the FieldNames enumeration for this business object.
        /// </summary>
        public override BusinessLayerFieldEnumDictionary FieldEnums
        {
            get
            {
                return _FieldEnums;
            }
        }

        /// <summary>
        /// Gets a dictionary of all of the lengths for all fields within this business object that map to a field in the database.
        /// </summary>
        public override Dictionary<string, int> FieldLengths
        {
            get
            {
                return _FieldLengths;
            }
        }

        /// <summary>
        /// Gets a dictionary of the native DbType (SqlDbType, OracleType, OleDbType, etc.) for all fields within this buisness object that map to a field in the database.
        /// </summary>
        public override Dictionary<string, int> FieldNativeDbTypes
        {
            get
            {
                return _FieldNativeDbTypes;
            }
        }

        /// <summary>
        /// Gets a dictionary of the security permission keys for each field in the business object.
        /// </summary>
        public override Dictionary<string, string> FieldPermissionKeys
        {
            get
            {
                return _FieldPermissionKeys;
            }
        }

        #endregion

        #region Field Properties

        /// <summary>
        /// cust_pk
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_pk"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.Int32 cust_pk
        {
            get
            {
                return (System.Int32)this.CurrentRow["cust_pk"];
            }
            set
            {
                this.CurrentRow["cust_pk"] = value;
            }
        }

        /// <summary>
        /// cust_Company
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Company"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Company
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Company"];
            }
            set
            {
                this.CurrentRow["cust_Company"] = value;
            }
        }

        /// <summary>
        /// cust_Prefix
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Prefix"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Prefix
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Prefix"];
            }
            set
            {
                this.CurrentRow["cust_Prefix"] = value;
            }
        }

        /// <summary>
        /// cust_FirstName
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_FirstName"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_FirstName
        {
            get
            {
                return (System.String)this.CurrentRow["cust_FirstName"];
            }
            set
            {
                this.CurrentRow["cust_FirstName"] = value;
            }
        }

        /// <summary>
        /// cust_MiddleName
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_MiddleName"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_MiddleName
        {
            get
            {
                return (System.String)this.CurrentRow["cust_MiddleName"];
            }
            set
            {
                this.CurrentRow["cust_MiddleName"] = value;
            }
        }

        /// <summary>
        /// cust_LastName
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_LastName"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_LastName
        {
            get
            {
                return (System.String)this.CurrentRow["cust_LastName"];
            }
            set
            {
                this.CurrentRow["cust_LastName"] = value;
            }
        }

        /// <summary>
        /// cust_Suffix
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Suffix"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Suffix
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Suffix"];
            }
            set
            {
                this.CurrentRow["cust_Suffix"] = value;
            }
        }

        /// <summary>
        /// cust_Address1
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Address1"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Address1
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Address1"];
            }
            set
            {
                this.CurrentRow["cust_Address1"] = value;
            }
        }

        /// <summary>
        /// cust_Address2
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Address2"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Address2
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Address2"];
            }
            set
            {
                this.CurrentRow["cust_Address2"] = value;
            }
        }

        /// <summary>
        /// cust_City
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_City"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_City
        {
            get
            {
                return (System.String)this.CurrentRow["cust_City"];
            }
            set
            {
                this.CurrentRow["cust_City"] = value;
            }
        }

        /// <summary>
        /// cust_State
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_State"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_State
        {
            get
            {
                return (System.String)this.CurrentRow["cust_State"];
            }
            set
            {
                this.CurrentRow["cust_State"] = value;
            }
        }

        /// <summary>
        /// cust_Postal
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Postal"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Postal
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Postal"];
            }
            set
            {
                this.CurrentRow["cust_Postal"] = value;
            }
        }

        /// <summary>
        /// cust_Country
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Country"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Country
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Country"];
            }
            set
            {
                this.CurrentRow["cust_Country"] = value;
            }
        }

        /// <summary>
        /// cust_Email
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Email"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_Email
        {
            get
            {
                return (System.String)this.CurrentRow["cust_Email"];
            }
            set
            {
                this.CurrentRow["cust_Email"] = value;
            }
        }

        /// <summary>
        /// cust_PhoneDay
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_PhoneDay"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_PhoneDay
        {
            get
            {
                return (System.String)this.CurrentRow["cust_PhoneDay"];
            }
            set
            {
                this.CurrentRow["cust_PhoneDay"] = value;
            }
        }

        /// <summary>
        /// cust_PhoneDayType
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_PhoneDayType"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.Int32 cust_PhoneDayType
        {
            get
            {
                return (System.Int32)this.CurrentRow["cust_PhoneDayType"];
            }
            set
            {
                this.CurrentRow["cust_PhoneDayType"] = value;
            }
        }

        /// <summary>
        /// cust_PhoneNight
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_PhoneNight"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.String cust_PhoneNight
        {
            get
            {
                return (System.String)this.CurrentRow["cust_PhoneNight"];
            }
            set
            {
                this.CurrentRow["cust_PhoneNight"] = value;
            }
        }

        /// <summary>
        /// cust_PhoneNightType
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_PhoneNightType"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.Int32 cust_PhoneNightType
        {
            get
            {
                return (System.Int32)this.CurrentRow["cust_PhoneNightType"];
            }
            set
            {
                this.CurrentRow["cust_PhoneNightType"] = value;
            }
        }

        /// <summary>
        /// cust_Created
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Created"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.DateTime cust_Created
        {
            get
            {
                return (System.DateTime)this.CurrentRow["cust_Created"];
            }
            set
            {
                this.CurrentRow["cust_Created"] = value;
            }
        }

        /// <summary>
        /// cust_Version
        /// </summary>
        [Browsable(false),
         BusinessFieldDisplayInEditor(),
         Description("cust_Version"),
         DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public System.Int32 cust_Version
        {
            get
            {
                return (System.Int32)this.CurrentRow["cust_Version"];
            }
            set
            {
                this.CurrentRow["cust_Version"] = value;
            }
        }

        #endregion

        #region Field Property Events

        #endregion

        #region Nested Types & Field Security

        /// <summary>
        /// Contains all of the field names that belong to the business object.
        /// </summary>
        public enum TestSFCustBOFieldNames
        {
            cust_pk,
            cust_Company,
            cust_Prefix,
            cust_FirstName,
            cust_MiddleName,
            cust_LastName,
            cust_Suffix,
            cust_Address1,
            cust_Address2,
            cust_City,
            cust_State,
            cust_Postal,
            cust_Country,
            cust_Email,
            cust_PhoneDay,
            cust_PhoneDayType,
            cust_PhoneNight,
            cust_PhoneNightType,
            cust_Created,
            cust_Version,
            CUSTOM_FIELD
        }

        /// <summary>
        /// Gets the System.Type of the enumeration that contains the field names for the business object.
        /// </summary>
        public override System.Type GetFieldEnumType()
        {
            return typeof(TestSFCustBOFieldNames);
        }

        /// <summary>
        /// Creates a new CheckFieldSecurityEventArgs object that can be used with this business object type.
        /// </summary>
        protected override CheckFieldSecurityEventArgsBase CreateNewFieldSecurityEventArgs(System.Enum Field, string CustomField, string PermissionKey, PermissionInfo Perm)
        {
            return new CheckFieldSecurityEventArgs<TestSFCustBOFieldNames>(Field, CustomField, PermissionKey, Perm);
        }

        /// <summary>
        /// Describes a method that will handle the CheckFieldScurity event.
        /// </summary>
        public delegate void CheckFieldSecurityEventHandler(object sender, CheckFieldSecurityEventArgs<TestSFCustBOFieldNames> e);

        /// <summary>
        /// Occurs when the business objects needs to check the security on a field.
        /// </summary>
        public event CheckFieldSecurityEventHandler CheckFieldSecurity;

        /// <summary>
        /// Raises the CheckFieldSecurity event.
        /// </summary>
        protected override void OnCheckFieldSecurity(CheckFieldSecurityEventArgsBase e)
        {
            if (this.CheckFieldSecurity != null)
            {
                this.CheckFieldSecurity(this, (CheckFieldSecurityEventArgs<TestSFCustBOFieldNames>)e);
            }
        }

        #endregion

        #region Item Property Implementation


        private static List<string> _AllFieldsList;
        private static Dictionary<string, DbType> _FieldDbTypes;
        private static BusinessLayerFieldEnumDictionary _FieldEnums;
        private static Dictionary<string, int> _FieldLengths;
        private static Dictionary<string, int> _FieldNativeDbTypes;
        private static Dictionary<string, string> _FieldPermissionKeys;

        /// <summary>
        /// Initializes the static members of the TestSFCustBO class.
        /// </summary>
        static TestSFCustBO()
        {
            //-- Create the new shared dictionary and populate it with an 
            //   instance of each property descriptor
            _PropertyDescriptors = new PropertyDescriptorDictionary(25);
            _PropertyDescriptors.Add("cust_pk", new FieldDescriptor(TestSFCustBOFieldNames.cust_pk, typeof(System.Int32)));
            _PropertyDescriptors.Add("cust_Company", new FieldDescriptor(TestSFCustBOFieldNames.cust_Company, typeof(System.String)));
            _PropertyDescriptors.Add("cust_Prefix", new FieldDescriptor(TestSFCustBOFieldNames.cust_Prefix, typeof(System.String)));
            _PropertyDescriptors.Add("cust_FirstName", new FieldDescriptor(TestSFCustBOFieldNames.cust_FirstName, typeof(System.String)));
            _PropertyDescriptors.Add("cust_MiddleName", new FieldDescriptor(TestSFCustBOFieldNames.cust_MiddleName, typeof(System.String)));
            _PropertyDescriptors.Add("cust_LastName", new FieldDescriptor(TestSFCustBOFieldNames.cust_LastName, typeof(System.String)));
            _PropertyDescriptors.Add("cust_Suffix", new FieldDescriptor(TestSFCustBOFieldNames.cust_Suffix, typeof(System.String)));
            _PropertyDescriptors.Add("cust_Address1", new FieldDescriptor(TestSFCustBOFieldNames.cust_Address1, typeof(System.String)));
            _PropertyDescriptors.Add("cust_Address2", new FieldDescriptor(TestSFCustBOFieldNames.cust_Address2, typeof(System.String)));
            _PropertyDescriptors.Add("cust_City", new FieldDescriptor(TestSFCustBOFieldNames.cust_City, typeof(System.String)));
            _PropertyDescriptors.Add("cust_State", new FieldDescriptor(TestSFCustBOFieldNames.cust_State, typeof(System.String)));
            _PropertyDescriptors.Add("cust_Postal", new FieldDescriptor(TestSFCustBOFieldNames.cust_Postal, typeof(System.String)));
            _PropertyDescriptors.Add("cust_Country", new FieldDescriptor(TestSFCustBOFieldNames.cust_Country, typeof(System.String)));
            _PropertyDescriptors.Add("cust_Email", new FieldDescriptor(TestSFCustBOFieldNames.cust_Email, typeof(System.String)));
            _PropertyDescriptors.Add("cust_PhoneDay", new FieldDescriptor(TestSFCustBOFieldNames.cust_PhoneDay, typeof(System.String)));
            _PropertyDescriptors.Add("cust_PhoneDayType", new FieldDescriptor(TestSFCustBOFieldNames.cust_PhoneDayType, typeof(System.Int32)));
            _PropertyDescriptors.Add("cust_PhoneNight", new FieldDescriptor(TestSFCustBOFieldNames.cust_PhoneNight, typeof(System.String)));
            _PropertyDescriptors.Add("cust_PhoneNightType", new FieldDescriptor(TestSFCustBOFieldNames.cust_PhoneNightType, typeof(System.Int32)));
            _PropertyDescriptors.Add("cust_Created", new FieldDescriptor(TestSFCustBOFieldNames.cust_Created, typeof(System.DateTime)));
            _PropertyDescriptors.Add("cust_Version", new FieldDescriptor(TestSFCustBOFieldNames.cust_Version, typeof(System.Int32)));

            _AllFieldsList = new List<string>(20);
            _AllFieldsList.Add("cust_pk");
            _AllFieldsList.Add("cust_Company");
            _AllFieldsList.Add("cust_Prefix");
            _AllFieldsList.Add("cust_FirstName");
            _AllFieldsList.Add("cust_MiddleName");
            _AllFieldsList.Add("cust_LastName");
            _AllFieldsList.Add("cust_Suffix");
            _AllFieldsList.Add("cust_Address1");
            _AllFieldsList.Add("cust_Address2");
            _AllFieldsList.Add("cust_City");
            _AllFieldsList.Add("cust_State");
            _AllFieldsList.Add("cust_Postal");
            _AllFieldsList.Add("cust_Country");
            _AllFieldsList.Add("cust_Email");
            _AllFieldsList.Add("cust_PhoneDay");
            _AllFieldsList.Add("cust_PhoneDayType");
            _AllFieldsList.Add("cust_PhoneNight");
            _AllFieldsList.Add("cust_PhoneNightType");
            _AllFieldsList.Add("cust_Created");
            _AllFieldsList.Add("cust_Version");

            _FieldDbTypes = new Dictionary<string, DbType>(20);
            _FieldDbTypes.Add("cust_pk", DbType.Int32);
            _FieldDbTypes.Add("cust_Company", DbType.String);
            _FieldDbTypes.Add("cust_Prefix", DbType.String);
            _FieldDbTypes.Add("cust_FirstName", DbType.String);
            _FieldDbTypes.Add("cust_MiddleName", DbType.String);
            _FieldDbTypes.Add("cust_LastName", DbType.String);
            _FieldDbTypes.Add("cust_Suffix", DbType.String);
            _FieldDbTypes.Add("cust_Address1", DbType.String);
            _FieldDbTypes.Add("cust_Address2", DbType.String);
            _FieldDbTypes.Add("cust_City", DbType.String);
            _FieldDbTypes.Add("cust_State", DbType.String);
            _FieldDbTypes.Add("cust_Postal", DbType.AnsiString);
            _FieldDbTypes.Add("cust_Country", DbType.String);
            _FieldDbTypes.Add("cust_Email", DbType.AnsiString);
            _FieldDbTypes.Add("cust_PhoneDay", DbType.AnsiString);
            _FieldDbTypes.Add("cust_PhoneDayType", DbType.Int32);
            _FieldDbTypes.Add("cust_PhoneNight", DbType.AnsiString);
            _FieldDbTypes.Add("cust_PhoneNightType", DbType.Int32);
            _FieldDbTypes.Add("cust_Created", DbType.DateTime);
            _FieldDbTypes.Add("cust_Version", DbType.Int32);

            _FieldEnums = new BusinessLayerFieldEnumDictionary(21);
            _FieldEnums.Add("cust_pk", TestSFCustBOFieldNames.cust_pk);
            _FieldEnums.Add("cust_Company", TestSFCustBOFieldNames.cust_Company);
            _FieldEnums.Add("cust_Prefix", TestSFCustBOFieldNames.cust_Prefix);
            _FieldEnums.Add("cust_FirstName", TestSFCustBOFieldNames.cust_FirstName);
            _FieldEnums.Add("cust_MiddleName", TestSFCustBOFieldNames.cust_MiddleName);
            _FieldEnums.Add("cust_LastName", TestSFCustBOFieldNames.cust_LastName);
            _FieldEnums.Add("cust_Suffix", TestSFCustBOFieldNames.cust_Suffix);
            _FieldEnums.Add("cust_Address1", TestSFCustBOFieldNames.cust_Address1);
            _FieldEnums.Add("cust_Address2", TestSFCustBOFieldNames.cust_Address2);
            _FieldEnums.Add("cust_City", TestSFCustBOFieldNames.cust_City);
            _FieldEnums.Add("cust_State", TestSFCustBOFieldNames.cust_State);
            _FieldEnums.Add("cust_Postal", TestSFCustBOFieldNames.cust_Postal);
            _FieldEnums.Add("cust_Country", TestSFCustBOFieldNames.cust_Country);
            _FieldEnums.Add("cust_Email", TestSFCustBOFieldNames.cust_Email);
            _FieldEnums.Add("cust_PhoneDay", TestSFCustBOFieldNames.cust_PhoneDay);
            _FieldEnums.Add("cust_PhoneDayType", TestSFCustBOFieldNames.cust_PhoneDayType);
            _FieldEnums.Add("cust_PhoneNight", TestSFCustBOFieldNames.cust_PhoneNight);
            _FieldEnums.Add("cust_PhoneNightType", TestSFCustBOFieldNames.cust_PhoneNightType);
            _FieldEnums.Add("cust_Created", TestSFCustBOFieldNames.cust_Created);
            _FieldEnums.Add("cust_Version", TestSFCustBOFieldNames.cust_Version);
            _FieldEnums.Add("CUSTOM_FIELD", TestSFCustBOFieldNames.CUSTOM_FIELD);

            _FieldLengths = new Dictionary<string, int>(20);
            _FieldLengths.Add("cust_pk", 0);
            _FieldLengths.Add("cust_Company", 150);
            _FieldLengths.Add("cust_Prefix", 20);
            _FieldLengths.Add("cust_FirstName", 60);
            _FieldLengths.Add("cust_MiddleName", 60);
            _FieldLengths.Add("cust_LastName", 60);
            _FieldLengths.Add("cust_Suffix", 20);
            _FieldLengths.Add("cust_Address1", 150);
            _FieldLengths.Add("cust_Address2", 150);
            _FieldLengths.Add("cust_City", 60);
            _FieldLengths.Add("cust_State", 128);
            _FieldLengths.Add("cust_Postal", 20);
            _FieldLengths.Add("cust_Country", 120);
            _FieldLengths.Add("cust_Email", 100);
            _FieldLengths.Add("cust_PhoneDay", 20);
            _FieldLengths.Add("cust_PhoneDayType", 0);
            _FieldLengths.Add("cust_PhoneNight", 20);
            _FieldLengths.Add("cust_PhoneNightType", 0);
            _FieldLengths.Add("cust_Created", 0);
            _FieldLengths.Add("cust_Version", 0);

            _FieldNativeDbTypes = new Dictionary<string, int>(20);
            _FieldNativeDbTypes.Add("cust_pk", (int)System.Data.SqlDbType.Int);
            _FieldNativeDbTypes.Add("cust_Company", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_Prefix", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_FirstName", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_MiddleName", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_LastName", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_Suffix", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_Address1", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_Address2", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_City", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_State", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_Postal", (int)System.Data.SqlDbType.VarChar);
            _FieldNativeDbTypes.Add("cust_Country", (int)System.Data.SqlDbType.NVarChar);
            _FieldNativeDbTypes.Add("cust_Email", (int)System.Data.SqlDbType.VarChar);
            _FieldNativeDbTypes.Add("cust_PhoneDay", (int)System.Data.SqlDbType.VarChar);
            _FieldNativeDbTypes.Add("cust_PhoneDayType", (int)System.Data.SqlDbType.Int);
            _FieldNativeDbTypes.Add("cust_PhoneNight", (int)System.Data.SqlDbType.VarChar);
            _FieldNativeDbTypes.Add("cust_PhoneNightType", (int)System.Data.SqlDbType.Int);
            _FieldNativeDbTypes.Add("cust_Created", (int)System.Data.SqlDbType.DateTime);
            _FieldNativeDbTypes.Add("cust_Version", (int)System.Data.SqlDbType.Int);

            _FieldPermissionKeys = new Dictionary<string, string>(20);

        }

        private static bool _AreCustomDescriptorsEvaluated = false;
        protected override bool AreCustomDescriptorsEvaluated
        {
            get
            {
                bool llReturn = _AreCustomDescriptorsEvaluated;
                _AreCustomDescriptorsEvaluated = true;
                return llReturn;
            }
        }

        private static PropertyDescriptorDictionary _PropertyDescriptors;
        protected override PropertyDescriptorDictionary PropertyDescriptors
        {
            get
            {
                return _PropertyDescriptors;
            }
        }

        /// <summary>
        /// A PropertyDescriptor class used to Get and Set the value of fields within the TestSFCustBO business object.
        /// </summary>
        private class FieldDescriptor :
        MicroFour.StrataFrame.Business.FieldPropertyDescriptor<TestSFCustBOFieldNames>
        {
            public FieldDescriptor(TestSFCustBOFieldNames field, Type fieldType) :
                base(field, fieldType) { }
            private static Type _ComponentType = typeof(TestSFCustBO);
            public override object GetValue(object component)
            {
                switch (this.Field)
                {
                    case TestSFCustBOFieldNames.cust_pk:
                        return ((TestSFCustBO)component).cust_pk;
                    case TestSFCustBOFieldNames.cust_Company:
                        return ((TestSFCustBO)component).cust_Company;
                    case TestSFCustBOFieldNames.cust_Prefix:
                        return ((TestSFCustBO)component).cust_Prefix;
                    case TestSFCustBOFieldNames.cust_FirstName:
                        return ((TestSFCustBO)component).cust_FirstName;
                    case TestSFCustBOFieldNames.cust_MiddleName:
                        return ((TestSFCustBO)component).cust_MiddleName;
                    case TestSFCustBOFieldNames.cust_LastName:
                        return ((TestSFCustBO)component).cust_LastName;
                    case TestSFCustBOFieldNames.cust_Suffix:
                        return ((TestSFCustBO)component).cust_Suffix;
                    case TestSFCustBOFieldNames.cust_Address1:
                        return ((TestSFCustBO)component).cust_Address1;
                    case TestSFCustBOFieldNames.cust_Address2:
                        return ((TestSFCustBO)component).cust_Address2;
                    case TestSFCustBOFieldNames.cust_City:
                        return ((TestSFCustBO)component).cust_City;
                    case TestSFCustBOFieldNames.cust_State:
                        return ((TestSFCustBO)component).cust_State;
                    case TestSFCustBOFieldNames.cust_Postal:
                        return ((TestSFCustBO)component).cust_Postal;
                    case TestSFCustBOFieldNames.cust_Country:
                        return ((TestSFCustBO)component).cust_Country;
                    case TestSFCustBOFieldNames.cust_Email:
                        return ((TestSFCustBO)component).cust_Email;
                    case TestSFCustBOFieldNames.cust_PhoneDay:
                        return ((TestSFCustBO)component).cust_PhoneDay;
                    case TestSFCustBOFieldNames.cust_PhoneDayType:
                        return ((TestSFCustBO)component).cust_PhoneDayType;
                    case TestSFCustBOFieldNames.cust_PhoneNight:
                        return ((TestSFCustBO)component).cust_PhoneNight;
                    case TestSFCustBOFieldNames.cust_PhoneNightType:
                        return ((TestSFCustBO)component).cust_PhoneNightType;
                    case TestSFCustBOFieldNames.cust_Created:
                        return ((TestSFCustBO)component).cust_Created;
                    case TestSFCustBOFieldNames.cust_Version:
                        return ((TestSFCustBO)component).cust_Version;
                    default:
                        throw new BusinessLayerException("Field not supported.");
                }
            }
            public override void SetValue(object component, object value)
            {
                switch (this.Field)
                {
                    case TestSFCustBOFieldNames.cust_pk:
                        ((TestSFCustBO)component).cust_pk = (System.Int32)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Company:
                        ((TestSFCustBO)component).cust_Company = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Prefix:
                        ((TestSFCustBO)component).cust_Prefix = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_FirstName:
                        ((TestSFCustBO)component).cust_FirstName = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_MiddleName:
                        ((TestSFCustBO)component).cust_MiddleName = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_LastName:
                        ((TestSFCustBO)component).cust_LastName = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Suffix:
                        ((TestSFCustBO)component).cust_Suffix = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Address1:
                        ((TestSFCustBO)component).cust_Address1 = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Address2:
                        ((TestSFCustBO)component).cust_Address2 = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_City:
                        ((TestSFCustBO)component).cust_City = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_State:
                        ((TestSFCustBO)component).cust_State = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Postal:
                        ((TestSFCustBO)component).cust_Postal = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Country:
                        ((TestSFCustBO)component).cust_Country = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Email:
                        ((TestSFCustBO)component).cust_Email = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_PhoneDay:
                        ((TestSFCustBO)component).cust_PhoneDay = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_PhoneDayType:
                        ((TestSFCustBO)component).cust_PhoneDayType = (System.Int32)value;
                        break;
                    case TestSFCustBOFieldNames.cust_PhoneNight:
                        ((TestSFCustBO)component).cust_PhoneNight = (System.String)value;
                        break;
                    case TestSFCustBOFieldNames.cust_PhoneNightType:
                        ((TestSFCustBO)component).cust_PhoneNightType = (System.Int32)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Created:
                        ((TestSFCustBO)component).cust_Created = (System.DateTime)value;
                        break;
                    case TestSFCustBOFieldNames.cust_Version:
                        ((TestSFCustBO)component).cust_Version = (System.Int32)value;
                        break;
                    default:
                        throw new BusinessLayerException("Field not supported.");
                }
            }
            public override Type ComponentType
            {
                get
                {
                    return _ComponentType;
                }
            }
        }

        #endregion

    }

}
