Ô¼?//------------------------------------------------------------------------------
// <autogenerated>
//     Ten kod zostaÒ? wygenerowany przez narzñôdzie.
//     Runtime Version: 1.0.2914.16
//
//     Zmiany w tym pliku mogñÖ spowodowañá nieprawidÒ?owe zachowanie. Zmiany zostanñÖ utracone
//     w przypadku ponownego wygenerowania tego pliku.
// </autogenerated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by xsd, Version=1.0.2914.16.
// 
using System;
using System.Data;
using System.Xml;
using System.Runtime.Serialization;


[Serializable()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public class Employees : System.Data.DataSet {
    
    private DocumentDataTable tableDocument;
    
    private EmployeesDataTable tableEmployees;
    
    private DataRelation relationDocument_Employees;
    
    public Employees() {
        this.InitClass();
    }
    
    private Employees(SerializationInfo info, StreamingContext context) {
        this.InitClass();
        this.GetSerializationData(info, context);
    }
    
    [System.ComponentModel.Browsable(false)]
    [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
    public DocumentDataTable Document {
        get {
            return this.tableDocument;
        }
    }
    
    [System.ComponentModel.Browsable(false)]
    [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
    public EmployeesDataTable EmployeesTable {
        get {
            return this.tableEmployees;
        }
    }
    
    protected override bool ShouldSerializeTables() {
        return false;
    }
    
    protected override bool ShouldSerializeRelations() {
        return false;
    }
    
    protected override void ReadXmlSerializable(XmlReader reader) {
        this.ReadXml(reader, XmlReadMode.IgnoreSchema);
    }
    
    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);
    }
    
    private void InitClass() {
        this.DataSetName = "Employees";
        this.Namespace = "http://tempuri.org/Employees.xsd";
        this.tableDocument = new DocumentDataTable();
        this.Tables.Add(this.tableDocument);
        this.tableEmployees = new EmployeesDataTable();
        this.Tables.Add(this.tableEmployees);
        this.tableEmployees.Constraints.Add(new System.Data.ForeignKeyConstraint("Document_Employees", new DataColumn[] {
                        this.tableDocument.Document_IdColumn}, new DataColumn[] {
                        this.tableEmployees.Document_IdColumn}));
        this.relationDocument_Employees = new DataRelation("Document_Employees", new DataColumn[] {
                    this.tableDocument.Document_IdColumn}, new DataColumn[] {
                    this.tableEmployees.Document_IdColumn}, false);
        this.relationDocument_Employees.Nested = true;
        this.Relations.Add(this.relationDocument_Employees);
    }
    
    private bool ShouldSerializeDocument() {
        return false;
    }
    
    private bool ShouldSerializeEmployees() {
        return false;
    }
    
    public delegate void DocumentRowChangeEventHandler(object sender, DocumentRowChangeEvent e);
    
    public delegate void EmployeesRowChangeEventHandler(object sender, EmployeesRowChangeEvent e);
    
    public class DocumentDataTable : DataTable, System.Collections.IEnumerable {
        
        private DataColumn columnDocument_Id;
        
        internal DocumentDataTable() : 
                base("Document") {
            this.InitClass();
        }
        
        [System.ComponentModel.Browsable(false)]
        public int Count {
            get {
                return this.Rows.Count;
            }
        }
        
        internal DataColumn Document_IdColumn {
            get {
                return this.columnDocument_Id;
            }
        }
        
        public DocumentRow this[int index] {
            get {
                return ((DocumentRow)(this.Rows[index]));
            }
        }
        
        public event DocumentRowChangeEventHandler DocumentRowChanged;
        
        public event DocumentRowChangeEventHandler DocumentRowChanging;
        
        public event DocumentRowChangeEventHandler DocumentRowDeleted;
        
        public event DocumentRowChangeEventHandler DocumentRowDeleting;
        
        public void AddDocumentRow(DocumentRow row) {
            this.Rows.Add(row);
        }
        
        public DocumentRow AddDocumentRow() {
            DocumentRow rowDocumentRow = ((DocumentRow)(this.NewRow()));
            rowDocumentRow.ItemArray = new object[] {
                    null};
            this.Rows.Add(rowDocumentRow);
            return rowDocumentRow;
        }
        
        public System.Collections.IEnumerator GetEnumerator() {
            return this.Rows.GetEnumerator();
        }
        
        private void InitClass() {
            this.columnDocument_Id = new DataColumn("Document_Id", typeof(int), "", System.Data.MappingType.Hidden);
            this.columnDocument_Id.AutoIncrement = true;
            this.columnDocument_Id.AllowDBNull = false;
            this.columnDocument_Id.Unique = true;
            this.Columns.Add(this.columnDocument_Id);
            this.PrimaryKey = new DataColumn[] {
                    this.columnDocument_Id};
        }
        
        public DocumentRow NewDocumentRow() {
            return ((DocumentRow)(this.NewRow()));
        }
        
        protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
            // We need to ensure that all Rows in the tabled are typed rows.
            // Table calls newRow whenever it needs to create a row.
            // So the following conditions are covered by Row newRow(Record record)
            // * Cursor calls table.addRecord(record) 
            // * table.addRow(object[] values) calls newRow(record)    
            return new DocumentRow(builder);
        }
        
        protected override System.Type GetRowType() {
            return typeof(DocumentRow);
        }
        
        protected override void OnRowChanged(DataRowChangeEventArgs e) {
            base.OnRowChanged(e);
            if ((this.DocumentRowChanged != null)) {
                this.DocumentRowChanged(this, new DocumentRowChangeEvent(((DocumentRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowChanging(DataRowChangeEventArgs e) {
            base.OnRowChanging(e);
            if ((this.DocumentRowChanging != null)) {
                this.DocumentRowChanging(this, new DocumentRowChangeEvent(((DocumentRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowDeleted(DataRowChangeEventArgs e) {
            base.OnRowDeleted(e);
            if ((this.DocumentRowDeleted != null)) {
                this.DocumentRowDeleted(this, new DocumentRowChangeEvent(((DocumentRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowDeleting(DataRowChangeEventArgs e) {
            base.OnRowDeleting(e);
            if ((this.DocumentRowDeleting != null)) {
                this.DocumentRowDeleting(this, new DocumentRowChangeEvent(((DocumentRow)(e.Row)), e.Action));
            }
        }
        
        public void RemoveDocumentRow(DocumentRow row) {
            this.Rows.Remove(row);
        }
    }
    
    public class DocumentRow : DataRow {
        
        private DocumentDataTable tableDocument;
        
        internal DocumentRow(DataRowBuilder rb) : 
                base(rb) {
            this.tableDocument = ((DocumentDataTable)(this.Table));
        }
        
        public EmployeesRow[] GetEmployeesRows() {
            return ((EmployeesRow[])(this.GetChildRows(this.Table.ChildRelations["Document_Employees"])));
        }
    }
    
    public class DocumentRowChangeEvent : EventArgs {
        
        private DocumentRow eventRow;
        
        private System.Data.DataRowAction eventAction;
        
        public DocumentRowChangeEvent(DocumentRow row, DataRowAction action) {
            this.eventRow = row;
            this.eventAction = action;
        }
        
        public DocumentRow Row {
            get {
                return this.eventRow;
            }
        }
        
        public DataRowAction Action {
            get {
                return this.eventAction;
            }
        }
    }
    
    public class EmployeesDataTable : DataTable, System.Collections.IEnumerable {
        
        private DataColumn columnEmployeeID;
        
        private DataColumn columnLastName;
        
        private DataColumn columnFirstName;
        
        private DataColumn columnTitle;
        
        private DataColumn columnBirthDate;
        
        private DataColumn columnHireDate;
        
        private DataColumn columnNotes;
        
        private DataColumn columnDocument_Id;
        
        internal EmployeesDataTable() : 
                base("Employees") {
            this.InitClass();
        }
        
        [System.ComponentModel.Browsable(false)]
        public int Count {
            get {
                return this.Rows.Count;
            }
        }
        
        internal DataColumn EmployeeIDColumn {
            get {
                return this.columnEmployeeID;
            }
        }
        
        internal DataColumn LastNameColumn {
            get {
                return this.columnLastName;
            }
        }
        
        internal DataColumn FirstNameColumn {
            get {
                return this.columnFirstName;
            }
        }
        
        internal DataColumn TitleColumn {
            get {
                return this.columnTitle;
            }
        }
        
        internal DataColumn BirthDateColumn {
            get {
                return this.columnBirthDate;
            }
        }
        
        internal DataColumn HireDateColumn {
            get {
                return this.columnHireDate;
            }
        }
        
        internal DataColumn NotesColumn {
            get {
                return this.columnNotes;
            }
        }
        
        internal DataColumn Document_IdColumn {
            get {
                return this.columnDocument_Id;
            }
        }
        
        public EmployeesRow this[int index] {
            get {
                return ((EmployeesRow)(this.Rows[index]));
            }
        }
        
        public event EmployeesRowChangeEventHandler EmployeesRowChanged;
        
        public event EmployeesRowChangeEventHandler EmployeesRowChanging;
        
        public event EmployeesRowChangeEventHandler EmployeesRowDeleted;
        
        public event EmployeesRowChangeEventHandler EmployeesRowDeleting;
        
        public void AddEmployeesRow(EmployeesRow row) {
            this.Rows.Add(row);
        }
        
        public EmployeesRow AddEmployeesRow(string LastName, string FirstName, string Title, System.DateTime BirthDate, System.DateTime HireDate, string Notes, DocumentRow parentDocumentRowByDocument_Employees) {
            EmployeesRow rowEmployeesRow = ((EmployeesRow)(this.NewRow()));
            rowEmployeesRow.ItemArray = new object[] {
                    null,
                    LastName,
                    FirstName,
                    Title,
                    BirthDate,
                    HireDate,
                    Notes,
                    parentDocumentRowByDocument_Employees[0]};
            this.Rows.Add(rowEmployeesRow);
            return rowEmployeesRow;
        }
        
        public System.Collections.IEnumerator GetEnumerator() {
            return this.Rows.GetEnumerator();
        }
        
        private void InitClass() {
            this.columnEmployeeID = new DataColumn("EmployeeID", typeof(int), "", System.Data.MappingType.Element);
            this.columnEmployeeID.AutoIncrement = true;
            this.columnEmployeeID.AllowDBNull = false;
            this.columnEmployeeID.ReadOnly = true;
            this.Columns.Add(this.columnEmployeeID);
            this.columnLastName = new DataColumn("LastName", typeof(string), "", System.Data.MappingType.Element);
            this.columnLastName.AllowDBNull = false;
            this.Columns.Add(this.columnLastName);
            this.columnFirstName = new DataColumn("FirstName", typeof(string), "", System.Data.MappingType.Element);
            this.columnFirstName.AllowDBNull = false;
            this.Columns.Add(this.columnFirstName);
            this.columnTitle = new DataColumn("Title", typeof(string), "", System.Data.MappingType.Element);
            this.Columns.Add(this.columnTitle);
            this.columnBirthDate = new DataColumn("BirthDate", typeof(System.DateTime), "", System.Data.MappingType.Element);
            this.Columns.Add(this.columnBirthDate);
            this.columnHireDate = new DataColumn("HireDate", typeof(System.DateTime), "", System.Data.MappingType.Element);
            this.Columns.Add(this.columnHireDate);
            this.columnNotes = new DataColumn("Notes", typeof(string), "", System.Data.MappingType.Element);
            this.Columns.Add(this.columnNotes);
            this.columnDocument_Id = new DataColumn("Document_Id", typeof(int), "", System.Data.MappingType.Hidden);
            this.Columns.Add(this.columnDocument_Id);
        }
        
        public EmployeesRow NewEmployeesRow() {
            return ((EmployeesRow)(this.NewRow()));
        }
        
        protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
            // We need to ensure that all Rows in the tabled are typed rows.
            // Table calls newRow whenever it needs to create a row.
            // So the following conditions are covered by Row newRow(Record record)
            // * Cursor calls table.addRecord(record) 
            // * table.addRow(object[] values) calls newRow(record)    
            return new EmployeesRow(builder);
        }
        
        protected override System.Type GetRowType() {
            return typeof(EmployeesRow);
        }
        
        protected override void OnRowChanged(DataRowChangeEventArgs e) {
            base.OnRowChanged(e);
            if ((this.EmployeesRowChanged != null)) {
                this.EmployeesRowChanged(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowChanging(DataRowChangeEventArgs e) {
            base.OnRowChanging(e);
            if ((this.EmployeesRowChanging != null)) {
                this.EmployeesRowChanging(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowDeleted(DataRowChangeEventArgs e) {
            base.OnRowDeleted(e);
            if ((this.EmployeesRowDeleted != null)) {
                this.EmployeesRowDeleted(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
            }
        }
        
        protected override void OnRowDeleting(DataRowChangeEventArgs e) {
            base.OnRowDeleting(e);
            if ((this.EmployeesRowDeleting != null)) {
                this.EmployeesRowDeleting(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action));
            }
        }
        
        public void RemoveEmployeesRow(EmployeesRow row) {
            this.Rows.Remove(row);
        }
    }
    
    public class EmployeesRow : DataRow {
        
        private EmployeesDataTable tableEmployees;
        
        internal EmployeesRow(DataRowBuilder rb) : 
                base(rb) {
            this.tableEmployees = ((EmployeesDataTable)(this.Table));
        }
        
        public int EmployeeID {
            get {
                return ((int)(this[this.tableEmployees.EmployeeIDColumn]));
            }
            set {
                this[this.tableEmployees.EmployeeIDColumn] = value;
            }
        }
        
        public string LastName {
            get {
                return ((string)(this[this.tableEmployees.LastNameColumn]));
            }
            set {
                this[this.tableEmployees.LastNameColumn] = value;
            }
        }
        
        public string FirstName {
            get {
                return ((string)(this[this.tableEmployees.FirstNameColumn]));
            }
            set {
                this[this.tableEmployees.FirstNameColumn] = value;
            }
        }
        
        public string Title {
            get {
                try {
                    return ((string)(this[this.tableEmployees.TitleColumn]));
                }
                catch (InvalidCastException e) {
                    throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                }
            }
            set {
                this[this.tableEmployees.TitleColumn] = value;
            }
        }
        
        public System.DateTime BirthDate {
            get {
                try {
                    return ((System.DateTime)(this[this.tableEmployees.BirthDateColumn]));
                }
                catch (InvalidCastException e) {
                    throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                }
            }
            set {
                this[this.tableEmployees.BirthDateColumn] = value;
            }
        }
        
        public System.DateTime HireDate {
            get {
                try {
                    return ((System.DateTime)(this[this.tableEmployees.HireDateColumn]));
                }
                catch (InvalidCastException e) {
                    throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                }
            }
            set {
                this[this.tableEmployees.HireDateColumn] = value;
            }
        }
        
        public string Notes {
            get {
                try {
                    return ((string)(this[this.tableEmployees.NotesColumn]));
                }
                catch (InvalidCastException e) {
                    throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                }
            }
            set {
                this[this.tableEmployees.NotesColumn] = value;
            }
        }
        
        public DocumentRow DocumentRow {
            get {
                return ((DocumentRow)(this.GetParentRow(this.Table.ParentRelations["Document_Employees"])));
            }
            set {
                this.SetParentRow(value, this.Table.ParentRelations["Document_Employees"]);
            }
        }
        
        public bool IsTitleNull() {
            return this.IsNull(this.tableEmployees.TitleColumn);
        }
        
        public void SetTitleNull() {
            this[this.tableEmployees.TitleColumn] = System.Convert.DBNull;
        }
        
        public bool IsBirthDateNull() {
            return this.IsNull(this.tableEmployees.BirthDateColumn);
        }
        
        public void SetBirthDateNull() {
            this[this.tableEmployees.BirthDateColumn] = System.Convert.DBNull;
        }
        
        public bool IsHireDateNull() {
            return this.IsNull(this.tableEmployees.HireDateColumn);
        }
        
        public void SetHireDateNull() {
            this[this.tableEmployees.HireDateColumn] = System.Convert.DBNull;
        }
        
        public bool IsNotesNull() {
            return this.IsNull(this.tableEmployees.NotesColumn);
        }
        
        public void SetNotesNull() {
            this[this.tableEmployees.NotesColumn] = System.Convert.DBNull;
        }
    }
    
    public class EmployeesRowChangeEvent : EventArgs {
        
        private EmployeesRow eventRow;
        
        private System.Data.DataRowAction eventAction;
        
        public EmployeesRowChangeEvent(EmployeesRow row, DataRowAction action) {
            this.eventRow = row;
            this.eventAction = action;
        }
        
        public EmployeesRow Row {
            get {
                return this.eventRow;
            }
        }
        
        public DataRowAction Action {
            get {
                return this.eventAction;
            }
        }
    }
}
