//------------------------------------------------------------------------------
// <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 BillOfPrescriptions : DataSet {
        
        private t_BillOfPrescritpionDataTable tablet_BillOfPrescritpion;
        
        public BillOfPrescriptions() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected BillOfPrescriptions(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_BillOfPrescritpion"] != null)) {
                    this.Tables.Add(new t_BillOfPrescritpionDataTable(ds.Tables["t_BillOfPrescritpion"]));
                }
                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_BillOfPrescritpionDataTable t_BillOfPrescritpion {
            get {
                return this.tablet_BillOfPrescritpion;
            }
        }
        
        public override DataSet Clone() {
            BillOfPrescriptions cln = ((BillOfPrescriptions)(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_BillOfPrescritpion"] != null)) {
                this.Tables.Add(new t_BillOfPrescritpionDataTable(ds.Tables["t_BillOfPrescritpion"]));
            }
            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_BillOfPrescritpion = ((t_BillOfPrescritpionDataTable)(this.Tables["t_BillOfPrescritpion"]));
            if ((this.tablet_BillOfPrescritpion != null)) {
                this.tablet_BillOfPrescritpion.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "BillOfPrescriptions";
            this.Prefix = "";
            this.Namespace = "http://tempuri.org/BillOfPrescriptions.xsd";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tablet_BillOfPrescritpion = new t_BillOfPrescritpionDataTable();
            this.Tables.Add(this.tablet_BillOfPrescritpion);
        }
        
        private bool ShouldSerializet_BillOfPrescritpion() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void t_BillOfPrescritpionRowChangeEventHandler(object sender, t_BillOfPrescritpionRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class t_BillOfPrescritpionDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnBillOfRxID;
            
            private DataColumn columnCashierID;
            
            private DataColumn columnCashierName;
            
            private DataColumn columnBillDate;
            
            private DataColumn columnPaymentAmount;
            
            internal t_BillOfPrescritpionDataTable() : 
                    base("t_BillOfPrescritpion") {
                this.InitClass();
            }
            
            internal t_BillOfPrescritpionDataTable(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 BillOfRxIDColumn {
                get {
                    return this.columnBillOfRxID;
                }
            }
            
            internal DataColumn CashierIDColumn {
                get {
                    return this.columnCashierID;
                }
            }
            
            internal DataColumn CashierNameColumn {
                get {
                    return this.columnCashierName;
                }
            }
            
            internal DataColumn BillDateColumn {
                get {
                    return this.columnBillDate;
                }
            }
            
            internal DataColumn PaymentAmountColumn {
                get {
                    return this.columnPaymentAmount;
                }
            }
            
            public t_BillOfPrescritpionRow this[int index] {
                get {
                    return ((t_BillOfPrescritpionRow)(this.Rows[index]));
                }
            }
            
            public event t_BillOfPrescritpionRowChangeEventHandler t_BillOfPrescritpionRowChanged;
            
            public event t_BillOfPrescritpionRowChangeEventHandler t_BillOfPrescritpionRowChanging;
            
            public event t_BillOfPrescritpionRowChangeEventHandler t_BillOfPrescritpionRowDeleted;
            
            public event t_BillOfPrescritpionRowChangeEventHandler t_BillOfPrescritpionRowDeleting;
            
            public void Addt_BillOfPrescritpionRow(t_BillOfPrescritpionRow row) {
                this.Rows.Add(row);
            }
            
            public t_BillOfPrescritpionRow Addt_BillOfPrescritpionRow(int CashierID, string CashierName, System.DateTime BillDate, System.Decimal PaymentAmount) {
                t_BillOfPrescritpionRow rowt_BillOfPrescritpionRow = ((t_BillOfPrescritpionRow)(this.NewRow()));
                rowt_BillOfPrescritpionRow.ItemArray = new object[] {
                        null,
                        CashierID,
                        CashierName,
                        BillDate,
                        PaymentAmount};
                this.Rows.Add(rowt_BillOfPrescritpionRow);
                return rowt_BillOfPrescritpionRow;
            }
            
            public t_BillOfPrescritpionRow FindByBillOfRxID(long BillOfRxID) {
                return ((t_BillOfPrescritpionRow)(this.Rows.Find(new object[] {
                            BillOfRxID})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                t_BillOfPrescritpionDataTable cln = ((t_BillOfPrescritpionDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new t_BillOfPrescritpionDataTable();
            }
            
            internal void InitVars() {
                this.columnBillOfRxID = this.Columns["BillOfRxID"];
                this.columnCashierID = this.Columns["CashierID"];
                this.columnCashierName = this.Columns["CashierName"];
                this.columnBillDate = this.Columns["BillDate"];
                this.columnPaymentAmount = this.Columns["PaymentAmount"];
            }
            
            private void InitClass() {
                this.columnBillOfRxID = new DataColumn("BillOfRxID", typeof(long), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBillOfRxID);
                this.columnCashierID = new DataColumn("CashierID", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCashierID);
                this.columnCashierName = new DataColumn("CashierName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCashierName);
                this.columnBillDate = new DataColumn("BillDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBillDate);
                this.columnPaymentAmount = new DataColumn("PaymentAmount", typeof(System.Decimal), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnPaymentAmount);
                this.Constraints.Add(new UniqueConstraint("BillOfPrescriptionsKey1", new DataColumn[] {
                                this.columnBillOfRxID}, true));
                this.columnBillOfRxID.AutoIncrement = true;
                this.columnBillOfRxID.AllowDBNull = false;
                this.columnBillOfRxID.ReadOnly = true;
                this.columnBillOfRxID.Unique = true;
                this.columnCashierID.AllowDBNull = false;
                this.columnCashierName.AllowDBNull = false;
                this.columnPaymentAmount.AllowDBNull = false;
            }
            
            public t_BillOfPrescritpionRow Newt_BillOfPrescritpionRow() {
                return ((t_BillOfPrescritpionRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new t_BillOfPrescritpionRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(t_BillOfPrescritpionRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.t_BillOfPrescritpionRowChanged != null)) {
                    this.t_BillOfPrescritpionRowChanged(this, new t_BillOfPrescritpionRowChangeEvent(((t_BillOfPrescritpionRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.t_BillOfPrescritpionRowChanging != null)) {
                    this.t_BillOfPrescritpionRowChanging(this, new t_BillOfPrescritpionRowChangeEvent(((t_BillOfPrescritpionRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.t_BillOfPrescritpionRowDeleted != null)) {
                    this.t_BillOfPrescritpionRowDeleted(this, new t_BillOfPrescritpionRowChangeEvent(((t_BillOfPrescritpionRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.t_BillOfPrescritpionRowDeleting != null)) {
                    this.t_BillOfPrescritpionRowDeleting(this, new t_BillOfPrescritpionRowChangeEvent(((t_BillOfPrescritpionRow)(e.Row)), e.Action));
                }
            }
            
            public void Removet_BillOfPrescritpionRow(t_BillOfPrescritpionRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class t_BillOfPrescritpionRow : DataRow {
            
            private t_BillOfPrescritpionDataTable tablet_BillOfPrescritpion;
            
            internal t_BillOfPrescritpionRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tablet_BillOfPrescritpion = ((t_BillOfPrescritpionDataTable)(this.Table));
            }
            
            public long BillOfRxID {
                get {
                    return ((long)(this[this.tablet_BillOfPrescritpion.BillOfRxIDColumn]));
                }
                set {
                    this[this.tablet_BillOfPrescritpion.BillOfRxIDColumn] = value;
                }
            }
            
            public int CashierID {
                get {
                    return ((int)(this[this.tablet_BillOfPrescritpion.CashierIDColumn]));
                }
                set {
                    this[this.tablet_BillOfPrescritpion.CashierIDColumn] = value;
                }
            }
            
            public string CashierName {
                get {
                    return ((string)(this[this.tablet_BillOfPrescritpion.CashierNameColumn]));
                }
                set {
                    this[this.tablet_BillOfPrescritpion.CashierNameColumn] = value;
                }
            }
            
            public System.DateTime BillDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tablet_BillOfPrescritpion.BillDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tablet_BillOfPrescritpion.BillDateColumn] = value;
                }
            }
            
            public System.Decimal PaymentAmount {
                get {
                    return ((System.Decimal)(this[this.tablet_BillOfPrescritpion.PaymentAmountColumn]));
                }
                set {
                    this[this.tablet_BillOfPrescritpion.PaymentAmountColumn] = value;
                }
            }
            
            public bool IsBillDateNull() {
                return this.IsNull(this.tablet_BillOfPrescritpion.BillDateColumn);
            }
            
            public void SetBillDateNull() {
                this[this.tablet_BillOfPrescritpion.BillDateColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class t_BillOfPrescritpionRowChangeEvent : EventArgs {
            
            private t_BillOfPrescritpionRow eventRow;
            
            private DataRowAction eventAction;
            
            public t_BillOfPrescritpionRowChangeEvent(t_BillOfPrescritpionRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public t_BillOfPrescritpionRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
