//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version: 1.1.4322.573
//
//     Changes to this file may cause incorrect behavior and will be lost if 
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

namespace HISClinic.DataModel {
    using System;
    using System.Data;
    using System.Xml;
    using System.Runtime.Serialization;
    
    
    [Serializable()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Diagnostics.DebuggerStepThrough()]
    [System.ComponentModel.ToolboxItem(true)]
    public class RegistrationTypes : DataSet {
        
        private t_RegistrationTypeDataTable tablet_RegistrationType;
        
        public RegistrationTypes() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected RegistrationTypes(SerializationInfo info, StreamingContext context) {
            string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
            if ((strSchema != null)) {
                DataSet ds = new DataSet();
                ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema)));
                if ((ds.Tables["t_RegistrationType"] != null)) {
                    this.Tables.Add(new t_RegistrationTypeDataTable(ds.Tables["t_RegistrationType"]));
                }
                this.DataSetName = ds.DataSetName;
                this.Prefix = ds.Prefix;
                this.Namespace = ds.Namespace;
                this.Locale = ds.Locale;
                this.CaseSensitive = ds.CaseSensitive;
                this.EnforceConstraints = ds.EnforceConstraints;
                this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
                this.InitVars();
            }
            else {
                this.InitClass();
            }
            this.GetSerializationData(info, context);
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
        public t_RegistrationTypeDataTable t_RegistrationType {
            get {
                return this.tablet_RegistrationType;
            }
        }
        
        public override DataSet Clone() {
            RegistrationTypes cln = ((RegistrationTypes)(base.Clone()));
            cln.InitVars();
            return cln;
        }
        
        protected override bool ShouldSerializeTables() {
            return false;
        }
        
        protected override bool ShouldSerializeRelations() {
            return false;
        }
        
        protected override void ReadXmlSerializable(XmlReader reader) {
            this.Reset();
            DataSet ds = new DataSet();
            ds.ReadXml(reader);
            if ((ds.Tables["t_RegistrationType"] != null)) {
                this.Tables.Add(new t_RegistrationTypeDataTable(ds.Tables["t_RegistrationType"]));
            }
            this.DataSetName = ds.DataSetName;
            this.Prefix = ds.Prefix;
            this.Namespace = ds.Namespace;
            this.Locale = ds.Locale;
            this.CaseSensitive = ds.CaseSensitive;
            this.EnforceConstraints = ds.EnforceConstraints;
            this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
            this.InitVars();
        }
        
        protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
            System.IO.MemoryStream stream = new System.IO.MemoryStream();
            this.WriteXmlSchema(new XmlTextWriter(stream, null));
            stream.Position = 0;
            return System.Xml.Schema.XmlSchema.Read(new XmlTextReader(stream), null);
        }
        
        internal void InitVars() {
            this.tablet_RegistrationType = ((t_RegistrationTypeDataTable)(this.Tables["t_RegistrationType"]));
            if ((this.tablet_RegistrationType != null)) {
                this.tablet_RegistrationType.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "RegistrationTypes";
            this.Prefix = "";
            this.Namespace = "http://tempuri.org/RegistrationTypes.xsd";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tablet_RegistrationType = new t_RegistrationTypeDataTable();
            this.Tables.Add(this.tablet_RegistrationType);
        }
        
        private bool ShouldSerializet_RegistrationType() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void t_RegistrationTypeRowChangeEventHandler(object sender, t_RegistrationTypeRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class t_RegistrationTypeDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnRegistrationTypeID;
            
            private DataColumn columnName;
            
            internal t_RegistrationTypeDataTable() : 
                    base("t_RegistrationType") {
                this.InitClass();
            }
            
            internal t_RegistrationTypeDataTable(DataTable table) : 
                    base(table.TableName) {
                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                    this.CaseSensitive = table.CaseSensitive;
                }
                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                    this.Locale = table.Locale;
                }
                if ((table.Namespace != table.DataSet.Namespace)) {
                    this.Namespace = table.Namespace;
                }
                this.Prefix = table.Prefix;
                this.MinimumCapacity = table.MinimumCapacity;
                this.DisplayExpression = table.DisplayExpression;
            }
            
            [System.ComponentModel.Browsable(false)]
            public int Count {
                get {
                    return this.Rows.Count;
                }
            }
            
            internal DataColumn RegistrationTypeIDColumn {
                get {
                    return this.columnRegistrationTypeID;
                }
            }
            
            internal DataColumn NameColumn {
                get {
                    return this.columnName;
                }
            }
            
            public t_RegistrationTypeRow this[int index] {
                get {
                    return ((t_RegistrationTypeRow)(this.Rows[index]));
                }
            }
            
            public event t_RegistrationTypeRowChangeEventHandler t_RegistrationTypeRowChanged;
            
            public event t_RegistrationTypeRowChangeEventHandler t_RegistrationTypeRowChanging;
            
            public event t_RegistrationTypeRowChangeEventHandler t_RegistrationTypeRowDeleted;
            
            public event t_RegistrationTypeRowChangeEventHandler t_RegistrationTypeRowDeleting;
            
            public void Addt_RegistrationTypeRow(t_RegistrationTypeRow row) {
                this.Rows.Add(row);
            }
            
            public t_RegistrationTypeRow Addt_RegistrationTypeRow(string Name) {
                t_RegistrationTypeRow rowt_RegistrationTypeRow = ((t_RegistrationTypeRow)(this.NewRow()));
                rowt_RegistrationTypeRow.ItemArray = new object[] {
                        null,
                        Name};
                this.Rows.Add(rowt_RegistrationTypeRow);
                return rowt_RegistrationTypeRow;
            }
            
            public t_RegistrationTypeRow FindByRegistrationTypeID(short RegistrationTypeID) {
                return ((t_RegistrationTypeRow)(this.Rows.Find(new object[] {
                            RegistrationTypeID})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                t_RegistrationTypeDataTable cln = ((t_RegistrationTypeDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new t_RegistrationTypeDataTable();
            }
            
            internal void InitVars() {
                this.columnRegistrationTypeID = this.Columns["RegistrationTypeID"];
                this.columnName = this.Columns["Name"];
            }
            
            private void InitClass() {
                this.columnRegistrationTypeID = new DataColumn("RegistrationTypeID", typeof(short), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnRegistrationTypeID);
                this.columnName = new DataColumn("Name", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnName);
                this.Constraints.Add(new UniqueConstraint("RegistrationTypesKey1", new DataColumn[] {
                                this.columnRegistrationTypeID}, true));
                this.columnRegistrationTypeID.AutoIncrement = true;
                this.columnRegistrationTypeID.AllowDBNull = false;
                this.columnRegistrationTypeID.ReadOnly = true;
                this.columnRegistrationTypeID.Unique = true;
                this.columnName.AllowDBNull = false;
            }
            
            public t_RegistrationTypeRow Newt_RegistrationTypeRow() {
                return ((t_RegistrationTypeRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new t_RegistrationTypeRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(t_RegistrationTypeRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.t_RegistrationTypeRowChanged != null)) {
                    this.t_RegistrationTypeRowChanged(this, new t_RegistrationTypeRowChangeEvent(((t_RegistrationTypeRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.t_RegistrationTypeRowChanging != null)) {
                    this.t_RegistrationTypeRowChanging(this, new t_RegistrationTypeRowChangeEvent(((t_RegistrationTypeRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.t_RegistrationTypeRowDeleted != null)) {
                    this.t_RegistrationTypeRowDeleted(this, new t_RegistrationTypeRowChangeEvent(((t_RegistrationTypeRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.t_RegistrationTypeRowDeleting != null)) {
                    this.t_RegistrationTypeRowDeleting(this, new t_RegistrationTypeRowChangeEvent(((t_RegistrationTypeRow)(e.Row)), e.Action));
                }
            }
            
            public void Removet_RegistrationTypeRow(t_RegistrationTypeRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class t_RegistrationTypeRow : DataRow {
            
            private t_RegistrationTypeDataTable tablet_RegistrationType;
            
            internal t_RegistrationTypeRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tablet_RegistrationType = ((t_RegistrationTypeDataTable)(this.Table));
            }
            
            public short RegistrationTypeID {
                get {
                    return ((short)(this[this.tablet_RegistrationType.RegistrationTypeIDColumn]));
                }
                set {
                    this[this.tablet_RegistrationType.RegistrationTypeIDColumn] = value;
                }
            }
            
            public string Name {
                get {
                    return ((string)(this[this.tablet_RegistrationType.NameColumn]));
                }
                set {
                    this[this.tablet_RegistrationType.NameColumn] = value;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class t_RegistrationTypeRowChangeEvent : EventArgs {
            
            private t_RegistrationTypeRow eventRow;
            
            private DataRowAction eventAction;
            
            public t_RegistrationTypeRowChangeEvent(t_RegistrationTypeRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public t_RegistrationTypeRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
