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

namespace Remuneraciones.DataSetFT {
    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 DSComuna : DataSet {
        
        private ComunaDataTable tableComuna;
        
        public DSComuna() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected DSComuna(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["Comuna"] != null)) {
                    this.Tables.Add(new ComunaDataTable(ds.Tables["Comuna"]));
                }
                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 ComunaDataTable Comuna {
            get {
                return this.tableComuna;
            }
        }
        
        public override DataSet Clone() {
            DSComuna cln = ((DSComuna)(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["Comuna"] != null)) {
                this.Tables.Add(new ComunaDataTable(ds.Tables["Comuna"]));
            }
            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.tableComuna = ((ComunaDataTable)(this.Tables["Comuna"]));
            if ((this.tableComuna != null)) {
                this.tableComuna.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "DSComuna";
            this.Prefix = "";
            this.Namespace = "http://tempuri.org/DSComuna.xsd";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tableComuna = new ComunaDataTable();
            this.Tables.Add(this.tableComuna);
        }
        
        private bool ShouldSerializeComuna() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void ComunaRowChangeEventHandler(object sender, ComunaRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ComunaDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnCod_Comuna;
            
            private DataColumn columnNomComuna;
            
            private DataColumn columnObservacion;
            
            private DataColumn columnUser_Id;
            
            private DataColumn columnCod_Ciudad;
            
            private DataColumn columnUser_Dt;
            
            internal ComunaDataTable() : 
                    base("Comuna") {
                this.InitClass();
            }
            
            internal ComunaDataTable(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 Cod_ComunaColumn {
                get {
                    return this.columnCod_Comuna;
                }
            }
            
            internal DataColumn NomComunaColumn {
                get {
                    return this.columnNomComuna;
                }
            }
            
            internal DataColumn ObservacionColumn {
                get {
                    return this.columnObservacion;
                }
            }
            
            internal DataColumn User_IdColumn {
                get {
                    return this.columnUser_Id;
                }
            }
            
            internal DataColumn Cod_CiudadColumn {
                get {
                    return this.columnCod_Ciudad;
                }
            }
            
            internal DataColumn User_DtColumn {
                get {
                    return this.columnUser_Dt;
                }
            }
            
            public ComunaRow this[int index] {
                get {
                    return ((ComunaRow)(this.Rows[index]));
                }
            }
            
            public event ComunaRowChangeEventHandler ComunaRowChanged;
            
            public event ComunaRowChangeEventHandler ComunaRowChanging;
            
            public event ComunaRowChangeEventHandler ComunaRowDeleted;
            
            public event ComunaRowChangeEventHandler ComunaRowDeleting;
            
            public void AddComunaRow(ComunaRow row) {
                this.Rows.Add(row);
            }
            
            public ComunaRow AddComunaRow(string Cod_Comuna, string NomComuna, string Observacion, string User_Id, string Cod_Ciudad, System.DateTime User_Dt) {
                ComunaRow rowComunaRow = ((ComunaRow)(this.NewRow()));
                rowComunaRow.ItemArray = new object[] {
                        Cod_Comuna,
                        NomComuna,
                        Observacion,
                        User_Id,
                        Cod_Ciudad,
                        User_Dt};
                this.Rows.Add(rowComunaRow);
                return rowComunaRow;
            }
            
            public ComunaRow FindByCod_Comuna(string Cod_Comuna) {
                return ((ComunaRow)(this.Rows.Find(new object[] {
                            Cod_Comuna})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ComunaDataTable cln = ((ComunaDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ComunaDataTable();
            }
            
            internal void InitVars() {
                this.columnCod_Comuna = this.Columns["Cod_Comuna"];
                this.columnNomComuna = this.Columns["NomComuna"];
                this.columnObservacion = this.Columns["Observacion"];
                this.columnUser_Id = this.Columns["User_Id"];
                this.columnCod_Ciudad = this.Columns["Cod_Ciudad"];
                this.columnUser_Dt = this.Columns["User_Dt"];
            }
            
            private void InitClass() {
                this.columnCod_Comuna = new DataColumn("Cod_Comuna", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCod_Comuna);
                this.columnNomComuna = new DataColumn("NomComuna", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnNomComuna);
                this.columnObservacion = new DataColumn("Observacion", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnObservacion);
                this.columnUser_Id = new DataColumn("User_Id", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnUser_Id);
                this.columnCod_Ciudad = new DataColumn("Cod_Ciudad", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCod_Ciudad);
                this.columnUser_Dt = new DataColumn("User_Dt", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnUser_Dt);
                this.Constraints.Add(new UniqueConstraint("DSComunaKey2", new DataColumn[] {
                                this.columnCod_Comuna}, true));
                this.columnCod_Comuna.AllowDBNull = false;
                this.columnCod_Comuna.Unique = true;
                this.columnNomComuna.AllowDBNull = false;
                this.columnCod_Ciudad.AllowDBNull = false;
            }
            
            public ComunaRow NewComunaRow() {
                return ((ComunaRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ComunaRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ComunaRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ComunaRowChanged != null)) {
                    this.ComunaRowChanged(this, new ComunaRowChangeEvent(((ComunaRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ComunaRowChanging != null)) {
                    this.ComunaRowChanging(this, new ComunaRowChangeEvent(((ComunaRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ComunaRowDeleted != null)) {
                    this.ComunaRowDeleted(this, new ComunaRowChangeEvent(((ComunaRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ComunaRowDeleting != null)) {
                    this.ComunaRowDeleting(this, new ComunaRowChangeEvent(((ComunaRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveComunaRow(ComunaRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ComunaRow : DataRow {
            
            private ComunaDataTable tableComuna;
            
            internal ComunaRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableComuna = ((ComunaDataTable)(this.Table));
            }
            
            public string Cod_Comuna {
                get {
                    return ((string)(this[this.tableComuna.Cod_ComunaColumn]));
                }
                set {
                    this[this.tableComuna.Cod_ComunaColumn] = value;
                }
            }
            
            public string NomComuna {
                get {
                    return ((string)(this[this.tableComuna.NomComunaColumn]));
                }
                set {
                    this[this.tableComuna.NomComunaColumn] = value;
                }
            }
            
            public string Observacion {
                get {
                    try {
                        return ((string)(this[this.tableComuna.ObservacionColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("No se puede obtener el valor porque es DBNull.", e);
                    }
                }
                set {
                    this[this.tableComuna.ObservacionColumn] = value;
                }
            }
            
            public string User_Id {
                get {
                    try {
                        return ((string)(this[this.tableComuna.User_IdColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("No se puede obtener el valor porque es DBNull.", e);
                    }
                }
                set {
                    this[this.tableComuna.User_IdColumn] = value;
                }
            }
            
            public string Cod_Ciudad {
                get {
                    return ((string)(this[this.tableComuna.Cod_CiudadColumn]));
                }
                set {
                    this[this.tableComuna.Cod_CiudadColumn] = value;
                }
            }
            
            public System.DateTime User_Dt {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableComuna.User_DtColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("No se puede obtener el valor porque es DBNull.", e);
                    }
                }
                set {
                    this[this.tableComuna.User_DtColumn] = value;
                }
            }
            
            public bool IsObservacionNull() {
                return this.IsNull(this.tableComuna.ObservacionColumn);
            }
            
            public void SetObservacionNull() {
                this[this.tableComuna.ObservacionColumn] = System.Convert.DBNull;
            }
            
            public bool IsUser_IdNull() {
                return this.IsNull(this.tableComuna.User_IdColumn);
            }
            
            public void SetUser_IdNull() {
                this[this.tableComuna.User_IdColumn] = System.Convert.DBNull;
            }
            
            public bool IsUser_DtNull() {
                return this.IsNull(this.tableComuna.User_DtColumn);
            }
            
            public void SetUser_DtNull() {
                this[this.tableComuna.User_DtColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ComunaRowChangeEvent : EventArgs {
            
            private ComunaRow eventRow;
            
            private DataRowAction eventAction;
            
            public ComunaRowChangeEvent(ComunaRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ComunaRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
