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

namespace PetShop.Model {
    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 Dataset1 : DataSet {
        
        private _ItemDataTable table_Item;
        
        public Dataset1() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected Dataset1(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["Item"] != null)) {
                    this.Tables.Add(new _ItemDataTable(ds.Tables["Item"]));
                }
                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 _ItemDataTable _Item {
            get {
                return this.table_Item;
            }
        }
        
        public override DataSet Clone() {
            Dataset1 cln = ((Dataset1)(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["Item"] != null)) {
                this.Tables.Add(new _ItemDataTable(ds.Tables["Item"]));
            }
            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.table_Item = ((_ItemDataTable)(this.Tables["Item"]));
            if ((this.table_Item != null)) {
                this.table_Item.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "Dataset1";
            this.Prefix = "";
            this.Namespace = "http://tempuri.org/Dataset1.xsd";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.table_Item = new _ItemDataTable();
            this.Tables.Add(this.table_Item);
        }
        
        private bool ShouldSerialize_Item() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void _ItemRowChangeEventHandler(object sender, _ItemRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class _ItemDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnItemId;
            
            private DataColumn columnProductId;
            
            private DataColumn columnListPrice;
            
            private DataColumn columnUnitCost;
            
            private DataColumn columnSupplier;
            
            private DataColumn columnStatus;
            
            private DataColumn columnAttr1;
            
            private DataColumn columnAttr2;
            
            private DataColumn columnAttr3;
            
            private DataColumn columnAttr4;
            
            private DataColumn columnAttr5;
            
            internal _ItemDataTable() : 
                    base("Item") {
                this.InitClass();
            }
            
            internal _ItemDataTable(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 ItemIdColumn {
                get {
                    return this.columnItemId;
                }
            }
            
            internal DataColumn ProductIdColumn {
                get {
                    return this.columnProductId;
                }
            }
            
            internal DataColumn ListPriceColumn {
                get {
                    return this.columnListPrice;
                }
            }
            
            internal DataColumn UnitCostColumn {
                get {
                    return this.columnUnitCost;
                }
            }
            
            internal DataColumn SupplierColumn {
                get {
                    return this.columnSupplier;
                }
            }
            
            internal DataColumn StatusColumn {
                get {
                    return this.columnStatus;
                }
            }
            
            internal DataColumn Attr1Column {
                get {
                    return this.columnAttr1;
                }
            }
            
            internal DataColumn Attr2Column {
                get {
                    return this.columnAttr2;
                }
            }
            
            internal DataColumn Attr3Column {
                get {
                    return this.columnAttr3;
                }
            }
            
            internal DataColumn Attr4Column {
                get {
                    return this.columnAttr4;
                }
            }
            
            internal DataColumn Attr5Column {
                get {
                    return this.columnAttr5;
                }
            }
            
            public _ItemRow this[int index] {
                get {
                    return ((_ItemRow)(this.Rows[index]));
                }
            }
            
            public event _ItemRowChangeEventHandler _ItemRowChanged;
            
            public event _ItemRowChangeEventHandler _ItemRowChanging;
            
            public event _ItemRowChangeEventHandler _ItemRowDeleted;
            
            public event _ItemRowChangeEventHandler _ItemRowDeleting;
            
            public void Add_ItemRow(_ItemRow row) {
                this.Rows.Add(row);
            }
            
            public _ItemRow Add_ItemRow(string ItemId, string ProductId, System.Decimal ListPrice, System.Decimal UnitCost, int Supplier, string Status, string Attr1, string Attr2, string Attr3, string Attr4, string Attr5) {
                _ItemRow row_ItemRow = ((_ItemRow)(this.NewRow()));
                row_ItemRow.ItemArray = new object[] {
                        ItemId,
                        ProductId,
                        ListPrice,
                        UnitCost,
                        Supplier,
                        Status,
                        Attr1,
                        Attr2,
                        Attr3,
                        Attr4,
                        Attr5};
                this.Rows.Add(row_ItemRow);
                return row_ItemRow;
            }
            
            public _ItemRow FindByItemId(string ItemId) {
                return ((_ItemRow)(this.Rows.Find(new object[] {
                            ItemId})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                _ItemDataTable cln = ((_ItemDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new _ItemDataTable();
            }
            
            internal void InitVars() {
                this.columnItemId = this.Columns["ItemId"];
                this.columnProductId = this.Columns["ProductId"];
                this.columnListPrice = this.Columns["ListPrice"];
                this.columnUnitCost = this.Columns["UnitCost"];
                this.columnSupplier = this.Columns["Supplier"];
                this.columnStatus = this.Columns["Status"];
                this.columnAttr1 = this.Columns["Attr1"];
                this.columnAttr2 = this.Columns["Attr2"];
                this.columnAttr3 = this.Columns["Attr3"];
                this.columnAttr4 = this.Columns["Attr4"];
                this.columnAttr5 = this.Columns["Attr5"];
            }
            
            private void InitClass() {
                this.columnItemId = new DataColumn("ItemId", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnItemId);
                this.columnProductId = new DataColumn("ProductId", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnProductId);
                this.columnListPrice = new DataColumn("ListPrice", typeof(System.Decimal), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnListPrice);
                this.columnUnitCost = new DataColumn("UnitCost", typeof(System.Decimal), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnUnitCost);
                this.columnSupplier = new DataColumn("Supplier", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnSupplier);
                this.columnStatus = new DataColumn("Status", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnStatus);
                this.columnAttr1 = new DataColumn("Attr1", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAttr1);
                this.columnAttr2 = new DataColumn("Attr2", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAttr2);
                this.columnAttr3 = new DataColumn("Attr3", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAttr3);
                this.columnAttr4 = new DataColumn("Attr4", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAttr4);
                this.columnAttr5 = new DataColumn("Attr5", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAttr5);
                this.Constraints.Add(new UniqueConstraint("Dataset1Key1", new DataColumn[] {
                                this.columnItemId}, true));
                this.columnItemId.AllowDBNull = false;
                this.columnItemId.Unique = true;
                this.columnProductId.AllowDBNull = false;
            }
            
            public _ItemRow New_ItemRow() {
                return ((_ItemRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new _ItemRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(_ItemRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this._ItemRowChanged != null)) {
                    this._ItemRowChanged(this, new _ItemRowChangeEvent(((_ItemRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this._ItemRowChanging != null)) {
                    this._ItemRowChanging(this, new _ItemRowChangeEvent(((_ItemRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this._ItemRowDeleted != null)) {
                    this._ItemRowDeleted(this, new _ItemRowChangeEvent(((_ItemRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this._ItemRowDeleting != null)) {
                    this._ItemRowDeleting(this, new _ItemRowChangeEvent(((_ItemRow)(e.Row)), e.Action));
                }
            }
            
            public void Remove_ItemRow(_ItemRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class _ItemRow : DataRow {
            
            private _ItemDataTable table_Item;
            
            internal _ItemRow(DataRowBuilder rb) : 
                    base(rb) {
                this.table_Item = ((_ItemDataTable)(this.Table));
            }
            
            public string ItemId {
                get {
                    return ((string)(this[this.table_Item.ItemIdColumn]));
                }
                set {
                    this[this.table_Item.ItemIdColumn] = value;
                }
            }
            
            public string ProductId {
                get {
                    return ((string)(this[this.table_Item.ProductIdColumn]));
                }
                set {
                    this[this.table_Item.ProductIdColumn] = value;
                }
            }
            
            public System.Decimal ListPrice {
                get {
                    try {
                        return ((System.Decimal)(this[this.table_Item.ListPriceColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.ListPriceColumn] = value;
                }
            }
            
            public System.Decimal UnitCost {
                get {
                    try {
                        return ((System.Decimal)(this[this.table_Item.UnitCostColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.UnitCostColumn] = value;
                }
            }
            
            public int Supplier {
                get {
                    try {
                        return ((int)(this[this.table_Item.SupplierColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.SupplierColumn] = value;
                }
            }
            
            public string Status {
                get {
                    try {
                        return ((string)(this[this.table_Item.StatusColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.StatusColumn] = value;
                }
            }
            
            public string Attr1 {
                get {
                    try {
                        return ((string)(this[this.table_Item.Attr1Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.Attr1Column] = value;
                }
            }
            
            public string Attr2 {
                get {
                    try {
                        return ((string)(this[this.table_Item.Attr2Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.Attr2Column] = value;
                }
            }
            
            public string Attr3 {
                get {
                    try {
                        return ((string)(this[this.table_Item.Attr3Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.Attr3Column] = value;
                }
            }
            
            public string Attr4 {
                get {
                    try {
                        return ((string)(this[this.table_Item.Attr4Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.Attr4Column] = value;
                }
            }
            
            public string Attr5 {
                get {
                    try {
                        return ((string)(this[this.table_Item.Attr5Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.table_Item.Attr5Column] = value;
                }
            }
            
            public bool IsListPriceNull() {
                return this.IsNull(this.table_Item.ListPriceColumn);
            }
            
            public void SetListPriceNull() {
                this[this.table_Item.ListPriceColumn] = System.Convert.DBNull;
            }
            
            public bool IsUnitCostNull() {
                return this.IsNull(this.table_Item.UnitCostColumn);
            }
            
            public void SetUnitCostNull() {
                this[this.table_Item.UnitCostColumn] = System.Convert.DBNull;
            }
            
            public bool IsSupplierNull() {
                return this.IsNull(this.table_Item.SupplierColumn);
            }
            
            public void SetSupplierNull() {
                this[this.table_Item.SupplierColumn] = System.Convert.DBNull;
            }
            
            public bool IsStatusNull() {
                return this.IsNull(this.table_Item.StatusColumn);
            }
            
            public void SetStatusNull() {
                this[this.table_Item.StatusColumn] = System.Convert.DBNull;
            }
            
            public bool IsAttr1Null() {
                return this.IsNull(this.table_Item.Attr1Column);
            }
            
            public void SetAttr1Null() {
                this[this.table_Item.Attr1Column] = System.Convert.DBNull;
            }
            
            public bool IsAttr2Null() {
                return this.IsNull(this.table_Item.Attr2Column);
            }
            
            public void SetAttr2Null() {
                this[this.table_Item.Attr2Column] = System.Convert.DBNull;
            }
            
            public bool IsAttr3Null() {
                return this.IsNull(this.table_Item.Attr3Column);
            }
            
            public void SetAttr3Null() {
                this[this.table_Item.Attr3Column] = System.Convert.DBNull;
            }
            
            public bool IsAttr4Null() {
                return this.IsNull(this.table_Item.Attr4Column);
            }
            
            public void SetAttr4Null() {
                this[this.table_Item.Attr4Column] = System.Convert.DBNull;
            }
            
            public bool IsAttr5Null() {
                return this.IsNull(this.table_Item.Attr5Column);
            }
            
            public void SetAttr5Null() {
                this[this.table_Item.Attr5Column] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class _ItemRowChangeEvent : EventArgs {
            
            private _ItemRow eventRow;
            
            private DataRowAction eventAction;
            
            public _ItemRowChangeEvent(_ItemRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public _ItemRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}