yuck poo Russell Butek [EMAIL PROTECTED]
Davanum Srinivas <[EMAIL PROTECTED]> on 03/15/2002 01:22:38 PM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Russell Butek/Austin/IBM@IBMUS Subject: Re: XSD Am ok with not using Vector. See enclosed C# code generated by Microsoft's tools for some "inspiration". Thanks, dims --- R J Scheuerle Jr <[EMAIL PROTECTED]> wrote: > I don't want to use a Vector. Whatever mapping is chosen should be simple, > complete and "roundtrippable", > > Looking at the spec, maxOccurs can also be applied to sequence and all > groups, too. This is important to remember. > > So here are some questions to ask to decide how to map this. > > How would the user expect to access the Author and Title values ? > Would they want to access them as separate properties getAuthor(int > i) & getTitle(int i) ? > Or would they expect to access them as separate choice items > getChoice(int i) and then inspect the choice to see if it was an > Author or Title ? > How can we represent the structures in a way that we can do > roundtripping ? > > So I don't think we should support this format for rpc encoded. > > Rich Scheuerle > XML & Web Services Development > 512-838-5115 (IBM TL 678-5115) > > > > > Davanum Srinivas > > <[EMAIL PROTECTED]> To: R J Scheuerle Jr/Austin/IBM@IBMUS, > Russell Butek/Austin/IBM@IBMUS > cc: > > 03/15/2002 12:50 Subject: Re: XSD > > PM > > Please respond to > > dims > > > > > > > > > Rich, > > Yes, That is definitely a possibility. Another option is to generate a > Vector that can be filled > with either Author's or Title's. This way we preserve the order in which > they occured in the SOAP > Response. Of course, this is not the usual way a Bean works. > > Thanks, > dims > > --- R J Scheuerle Jr <[EMAIL PROTECTED]> wrote: > > Dims, > > > > I assume this means allow an unbounded number of choice elements, > > where an individual choice could be either an author or title. > > > > Thus you could have author, author, title > > or you could have title, author, title. > > > > Of course the axis runtime does not have any checking for choice. > > But I suppose you are asking for WSDL2Java to understand that > > maxOccurs applies to both author and title...thus author and title should > > be modeled as indexed bean properties versus regular bean properties. > > > > Am I correct ? > > > > > > Rich Scheuerle > > XML & Web Services Development > > 512-838-5115 (IBM TL 678-5115) > > > > > > > > > > > Russell Butek > > > > > To: R J Scheuerle > Jr/Austin/IBM > > > > 03/15/2002 11:34 cc: > > > > > AM From: Russell > Butek/Austin/IBM@IBMUS > > > > Subject: XSD > > > > > > > > > > > > > > > > > > > > > > > > > > From dims. He expects NewDataSet to allow you to provide any number of > > Authors and Titles. > > > > Russell Butek > > [EMAIL PROTECTED] > > ---------------------- Forwarded by Russell Butek/Austin/IBM on > 03/15/2002 > > 11:28 AM --------------------------- > > > > > > > > Davanum Srinivas <[EMAIL PROTECTED]> on 03/15/2002 11:26:08 AM > > > > Please respond to [EMAIL PROTECTED] > > > > To: [EMAIL PROTECTED] > > cc: Russell Butek/Austin/IBM@IBMUS > > > > Subject: XSD > > > > > > > > > > > > > > > > ===== > > Davanum Srinivas - http://xml.apache.org/~dims/ > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! Sports - live college hoops coverage > > http://sports.yahoo.com/ > > <?xml version="1.0" encoding="utf-8"?> > > <xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id > > ="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema"> > > <xs:element msdata:IsDataSet="true" name="NewDataSet"> > > <xs:complexType> > > <xs:choice maxOccurs="unbounded"> > > <xs:element name="Authors"> > > <xs:complexType> > > <xs:sequence> > > <xs:element minOccurs="0" name="au_id" type="xs:string" /> > > <xs:element minOccurs="0" name="au_lname" type ="xs:string" > /> > > <xs:element minOccurs="0" name="au_fname" type ="xs:string" > /> > > <xs:element minOccurs="0" name="phone" type="xs:string" /> > > <xs:element minOccurs="0" name="address" type="xs:string" > /> > > <xs:element minOccurs="0" name="city" type="xs:string" /> > > <xs:element minOccurs="0" name="state" type="xs:string" /> > > <xs:element minOccurs="0" name="zip" type="xs:string" /> > > <xs:element minOccurs="0" name="contract" type ="xs:boolean" > > /> > > </xs:sequence> > > </xs:complexType> > > </xs:element> > > <xs:element name="Titles"> > > <xs:complexType> > > <xs:sequence> > > <xs:element minOccurs="0" name="title_id" type ="xs:string" > /> > > <xs:element minOccurs="0" name="title" type="xs:string" /> > > <xs:element minOccurs="0" name="type" type="xs:string" /> > > <xs:element minOccurs="0" name="pub_id" type="xs:string" /> > > <xs:element minOccurs="0" name="price" type="xs:decimal" /> > > <xs:element minOccurs="0" name="advance" type ="xs:decimal" > /> > > <xs:element minOccurs="0" name="royalty" type="xs:int" /> > > <xs:element minOccurs="0" name="ytd_sales" type="xs:int" /> > > <xs:element minOccurs="0" name="notes" type="xs:string" /> > > <xs:element minOccurs="0" name="pubdate" type ="xs:dateTime" > > /> > > </xs:sequence> > > </xs:complexType> > > </xs:element> > > </xs:choice> > > </xs:complexType> > > </xs:element> > > </xs:schema> > > > > > > > > > > > ===== > Davanum Srinivas - http://xml.apache.org/~dims/ > > __________________________________________________ > === message truncated === ===== Davanum Srinivas - http://xml.apache.org/~dims/ __________________________________________________ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/ ï» ¿//------------------------------------------------------------------------------ // <autogenerated> // This code was generated by a tool. // Runtime Version: 1.0.3705.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </autogenerated> //------------------------------------------------------------------------------ // // This source code was auto-generated by wsdl, Version=1.0.3705.0. // using System.Diagnostics; using System.Xml.Serialization; using System; using System.Web.Services.Protocols; using System.ComponentModel; using System.Web.Services; using System.Data; using System.Xml; using System.Runtime.Serialization; using System.Data.SqlClient; using System.IO; using System.Xml.Xsl; using System.Xml.XPath; /// <remarks/> [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="DataServiceSoap", Namespace="http://tempuri.org/")] public class DataService : System.Web.Services.Protocols.SoapHttpClientProtocol { public static void Main() { DataService dataService = new DataService(); Console.WriteLine("Calling GetTitleAuthors"); NewDataSet ds = dataService.GetTitleAuthors(); Console.WriteLine("Writing the output to to {0} ...", "output.xml"); StreamWriter writer = writer = new StreamWriter("output.xml"); ds.WriteXml(writer); } /// <remarks/> public DataService() { this.Url = "http://localhost:9090/quickstart/dims/DataService.asmx "; } /// <remarks/> [System.Web.Services.Protocols.SoapDocumentMethodAttribute(" http://tempuri.org/GetTitleAuthors", RequestNamespace=" http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public NewDataSet GetTitleAuthors() { object[] results = this.Invoke("GetTitleAuthors", new object[0]); return ((NewDataSet)(results[0])); } /// <remarks/> public System.IAsyncResult BeginGetTitleAuthors(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetTitleAuthors", new object[0], callback, asyncState); } /// <remarks/> public NewDataSet EndGetTitleAuthors(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((NewDataSet)(results[0])); } /// <remarks/> [System.Web.Services.Protocols.SoapDocumentMethodAttribute(" http://tempuri.org/PutTitleAuthors", RequestNamespace=" http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public int PutTitleAuthors(NewDataSet ds) { object[] results = this.Invoke("PutTitleAuthors", new object[] { ds}); return ((int)(results[0])); } /// <remarks/> public System.IAsyncResult BeginPutTitleAuthors(NewDataSet ds, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("PutTitleAuthors", new object[] { ds}, callback, asyncState); } /// <remarks/> public int EndPutTitleAuthors(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } } [Serializable()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Diagnostics.DebuggerStepThrough()] [System.ComponentModel.ToolboxItem(true)] public class NewDataSet : DataSet { private AuthorsDataTable tableAuthors; private TitlesDataTable tableTitles; public NewDataSet() { this.InitClass(); System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); this.Tables.CollectionChanged += schemaChangedHandler; this.Relations.CollectionChanged += schemaChangedHandler; } protected NewDataSet(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["Authors"] != null)) { this.Tables.Add(new AuthorsDataTable(ds.Tables ["Authors"])); } if ((ds.Tables["Titles"] != null)) { this.Tables.Add(new TitlesDataTable(ds.Tables["Titles"])); } 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 AuthorsDataTable Authors { get { return this.tableAuthors; } } [System.ComponentModel.Browsable(false)] [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)] public TitlesDataTable Titles { get { return this.tableTitles; } } public override DataSet Clone() { NewDataSet cln = ((NewDataSet)(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["Authors"] != null)) { this.Tables.Add(new AuthorsDataTable(ds.Tables["Authors"])); } if ((ds.Tables["Titles"] != null)) { this.Tables.Add(new TitlesDataTable(ds.Tables["Titles"])); } 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.tableAuthors = ((AuthorsDataTable)(this.Tables["Authors"])); if ((this.tableAuthors != null)) { this.tableAuthors.InitVars(); } this.tableTitles = ((TitlesDataTable)(this.Tables["Titles"])); if ((this.tableTitles != null)) { this.tableTitles.InitVars(); } } private void InitClass() { this.DataSetName = "NewDataSet"; this.Prefix = ""; this.Namespace = ""; this.Locale = new System.Globalization.CultureInfo("en-US"); this.CaseSensitive = false; this.EnforceConstraints = true; this.tableAuthors = new AuthorsDataTable(); this.Tables.Add(this.tableAuthors); this.tableTitles = new TitlesDataTable(); this.Tables.Add(this.tableTitles); } private bool ShouldSerializeAuthors() { return false; } private bool ShouldSerializeTitles() { return false; } private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) { if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) { this.InitVars(); } } public delegate void AuthorsRowChangeEventHandler(object sender, AuthorsRowChangeEvent e); public delegate void TitlesRowChangeEventHandler(object sender, TitlesRowChangeEvent e); [System.Diagnostics.DebuggerStepThrough()] public class AuthorsDataTable : DataTable, System.Collections.IEnumerable { private DataColumn columnau_id; private DataColumn columnau_lname; private DataColumn columnau_fname; private DataColumn columnphone; private DataColumn columnaddress; private DataColumn columncity; private DataColumn columnstate; private DataColumn columnzip; private DataColumn columncontract; internal AuthorsDataTable() : base("Authors") { this.InitClass(); } internal AuthorsDataTable(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 au_idColumn { get { return this.columnau_id; } } internal DataColumn au_lnameColumn { get { return this.columnau_lname; } } internal DataColumn au_fnameColumn { get { return this.columnau_fname; } } internal DataColumn phoneColumn { get { return this.columnphone; } } internal DataColumn addressColumn { get { return this.columnaddress; } } internal DataColumn cityColumn { get { return this.columncity; } } internal DataColumn stateColumn { get { return this.columnstate; } } internal DataColumn zipColumn { get { return this.columnzip; } } internal DataColumn contractColumn { get { return this.columncontract; } } public AuthorsRow this[int index] { get { return ((AuthorsRow)(this.Rows[index])); } } public event AuthorsRowChangeEventHandler AuthorsRowChanged; public event AuthorsRowChangeEventHandler AuthorsRowChanging; public event AuthorsRowChangeEventHandler AuthorsRowDeleted; public event AuthorsRowChangeEventHandler AuthorsRowDeleting; public void AddAuthorsRow(AuthorsRow row) { this.Rows.Add(row); } public AuthorsRow AddAuthorsRow(string au_id, string au_lname, string au_fname, string phone, string address, string city, string state, string zip, bool contract) { AuthorsRow rowAuthorsRow = ((AuthorsRow)(this.NewRow())); rowAuthorsRow.ItemArray = new object[] { au_id, au_lname, au_fname, phone, address, city, state, zip, contract}; this.Rows.Add(rowAuthorsRow); return rowAuthorsRow; } public System.Collections.IEnumerator GetEnumerator() { return this.Rows.GetEnumerator(); } public override DataTable Clone() { AuthorsDataTable cln = ((AuthorsDataTable)(base.Clone())); cln.InitVars(); return cln; } protected override DataTable CreateInstance() { return new AuthorsDataTable(); } internal void InitVars() { this.columnau_id = this.Columns["au_id"]; this.columnau_lname = this.Columns["au_lname"]; this.columnau_fname = this.Columns["au_fname"]; this.columnphone = this.Columns["phone"]; this.columnaddress = this.Columns["address"]; this.columncity = this.Columns["city"]; this.columnstate = this.Columns["state"]; this.columnzip = this.Columns["zip"]; this.columncontract = this.Columns["contract"]; } private void InitClass() { this.columnau_id = new DataColumn("au_id", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnau_id); this.columnau_lname = new DataColumn("au_lname", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnau_lname); this.columnau_fname = new DataColumn("au_fname", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnau_fname); this.columnphone = new DataColumn("phone", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnphone); this.columnaddress = new DataColumn("address", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnaddress); this.columncity = new DataColumn("city", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columncity); this.columnstate = new DataColumn("state", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnstate); this.columnzip = new DataColumn("zip", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnzip); this.columncontract = new DataColumn("contract", typeof(bool), null, System.Data.MappingType.Element); this.Columns.Add(this.columncontract); } public AuthorsRow NewAuthorsRow() { return ((AuthorsRow)(this.NewRow())); } protected override DataRow NewRowFromBuilder(DataRowBuilder builder) { return new AuthorsRow(builder); } protected override System.Type GetRowType() { return typeof(AuthorsRow); } protected override void OnRowChanged(DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.AuthorsRowChanged != null)) { this.AuthorsRowChanged(this, new AuthorsRowChangeEvent (((AuthorsRow)(e.Row)), e.Action)); } } protected override void OnRowChanging(DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.AuthorsRowChanging != null)) { this.AuthorsRowChanging(this, new AuthorsRowChangeEvent (((AuthorsRow)(e.Row)), e.Action)); } } protected override void OnRowDeleted(DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.AuthorsRowDeleted != null)) { this.AuthorsRowDeleted(this, new AuthorsRowChangeEvent (((AuthorsRow)(e.Row)), e.Action)); } } protected override void OnRowDeleting(DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.AuthorsRowDeleting != null)) { this.AuthorsRowDeleting(this, new AuthorsRowChangeEvent (((AuthorsRow)(e.Row)), e.Action)); } } public void RemoveAuthorsRow(AuthorsRow row) { this.Rows.Remove(row); } } [System.Diagnostics.DebuggerStepThrough()] public class AuthorsRow : DataRow { private AuthorsDataTable tableAuthors; internal AuthorsRow(DataRowBuilder rb) : base(rb) { this.tableAuthors = ((AuthorsDataTable)(this.Table)); } public string au_id { get { try { return ((string)(this[this.tableAuthors.au_idColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.au_idColumn] = value; } } public string au_lname { get { try { return ((string)(this[this.tableAuthors.au_lnameColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.au_lnameColumn] = value; } } public string au_fname { get { try { return ((string)(this[this.tableAuthors.au_fnameColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.au_fnameColumn] = value; } } public string phone { get { try { return ((string)(this[this.tableAuthors.phoneColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.phoneColumn] = value; } } public string address { get { try { return ((string)(this[this.tableAuthors.addressColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.addressColumn] = value; } } public string city { get { try { return ((string)(this[this.tableAuthors.cityColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.cityColumn] = value; } } public string state { get { try { return ((string)(this[this.tableAuthors.stateColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.stateColumn] = value; } } public string zip { get { try { return ((string)(this[this.tableAuthors.zipColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.zipColumn] = value; } } public bool contract { get { try { return ((bool)(this[this.tableAuthors.contractColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableAuthors.contractColumn] = value; } } public bool Isau_idNull() { return this.IsNull(this.tableAuthors.au_idColumn); } public void Setau_idNull() { this[this.tableAuthors.au_idColumn] = System.Convert.DBNull; } public bool Isau_lnameNull() { return this.IsNull(this.tableAuthors.au_lnameColumn); } public void Setau_lnameNull() { this[this.tableAuthors.au_lnameColumn] = System.Convert.DBNull; } public bool Isau_fnameNull() { return this.IsNull(this.tableAuthors.au_fnameColumn); } public void Setau_fnameNull() { this[this.tableAuthors.au_fnameColumn] = System.Convert.DBNull; } public bool IsphoneNull() { return this.IsNull(this.tableAuthors.phoneColumn); } public void SetphoneNull() { this[this.tableAuthors.phoneColumn] = System.Convert.DBNull; } public bool IsaddressNull() { return this.IsNull(this.tableAuthors.addressColumn); } public void SetaddressNull() { this[this.tableAuthors.addressColumn] = System.Convert.DBNull; } public bool IscityNull() { return this.IsNull(this.tableAuthors.cityColumn); } public void SetcityNull() { this[this.tableAuthors.cityColumn] = System.Convert.DBNull; } public bool IsstateNull() { return this.IsNull(this.tableAuthors.stateColumn); } public void SetstateNull() { this[this.tableAuthors.stateColumn] = System.Convert.DBNull; } public bool IszipNull() { return this.IsNull(this.tableAuthors.zipColumn); } public void SetzipNull() { this[this.tableAuthors.zipColumn] = System.Convert.DBNull; } public bool IscontractNull() { return this.IsNull(this.tableAuthors.contractColumn); } public void SetcontractNull() { this[this.tableAuthors.contractColumn] = System.Convert.DBNull; } } [System.Diagnostics.DebuggerStepThrough()] public class AuthorsRowChangeEvent : EventArgs { private AuthorsRow eventRow; private DataRowAction eventAction; public AuthorsRowChangeEvent(AuthorsRow row, DataRowAction action) { this.eventRow = row; this.eventAction = action; } public AuthorsRow Row { get { return this.eventRow; } } public DataRowAction Action { get { return this.eventAction; } } } [System.Diagnostics.DebuggerStepThrough()] public class TitlesDataTable : DataTable, System.Collections.IEnumerable { private DataColumn columntitle_id; private DataColumn columntitle; private DataColumn columntype; private DataColumn columnpub_id; private DataColumn columnprice; private DataColumn columnadvance; private DataColumn columnroyalty; private DataColumn columnytd_sales; private DataColumn columnnotes; private DataColumn columnpubdate; internal TitlesDataTable() : base("Titles") { this.InitClass(); } internal TitlesDataTable(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 title_idColumn { get { return this.columntitle_id; } } internal DataColumn titleColumn { get { return this.columntitle; } } internal DataColumn typeColumn { get { return this.columntype; } } internal DataColumn pub_idColumn { get { return this.columnpub_id; } } internal DataColumn priceColumn { get { return this.columnprice; } } internal DataColumn advanceColumn { get { return this.columnadvance; } } internal DataColumn royaltyColumn { get { return this.columnroyalty; } } internal DataColumn ytd_salesColumn { get { return this.columnytd_sales; } } internal DataColumn notesColumn { get { return this.columnnotes; } } internal DataColumn pubdateColumn { get { return this.columnpubdate; } } public TitlesRow this[int index] { get { return ((TitlesRow)(this.Rows[index])); } } public event TitlesRowChangeEventHandler TitlesRowChanged; public event TitlesRowChangeEventHandler TitlesRowChanging; public event TitlesRowChangeEventHandler TitlesRowDeleted; public event TitlesRowChangeEventHandler TitlesRowDeleting; public void AddTitlesRow(TitlesRow row) { this.Rows.Add(row); } public TitlesRow AddTitlesRow(string title_id, string title, string type, string pub_id, System.Decimal price, System.Decimal advance, int royalty, int ytd_sales, string notes, System.DateTime pubdate) { TitlesRow rowTitlesRow = ((TitlesRow)(this.NewRow())); rowTitlesRow.ItemArray = new object[] { title_id, title, type, pub_id, price, advance, royalty, ytd_sales, notes, pubdate}; this.Rows.Add(rowTitlesRow); return rowTitlesRow; } public System.Collections.IEnumerator GetEnumerator() { return this.Rows.GetEnumerator(); } public override DataTable Clone() { TitlesDataTable cln = ((TitlesDataTable)(base.Clone())); cln.InitVars(); return cln; } protected override DataTable CreateInstance() { return new TitlesDataTable(); } internal void InitVars() { this.columntitle_id = this.Columns["title_id"]; this.columntitle = this.Columns["title"]; this.columntype = this.Columns["type"]; this.columnpub_id = this.Columns["pub_id"]; this.columnprice = this.Columns["price"]; this.columnadvance = this.Columns["advance"]; this.columnroyalty = this.Columns["royalty"]; this.columnytd_sales = this.Columns["ytd_sales"]; this.columnnotes = this.Columns["notes"]; this.columnpubdate = this.Columns["pubdate"]; } private void InitClass() { this.columntitle_id = new DataColumn("title_id", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columntitle_id); this.columntitle = new DataColumn("title", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columntitle); this.columntype = new DataColumn("type", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columntype); this.columnpub_id = new DataColumn("pub_id", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnpub_id); this.columnprice = new DataColumn("price", typeof(System.Decimal), null, System.Data.MappingType.Element); this.Columns.Add(this.columnprice); this.columnadvance = new DataColumn("advance", typeof(System.Decimal), null, System.Data.MappingType.Element); this.Columns.Add(this.columnadvance); this.columnroyalty = new DataColumn("royalty", typeof(int), null, System.Data.MappingType.Element); this.Columns.Add(this.columnroyalty); this.columnytd_sales = new DataColumn("ytd_sales", typeof(int), null, System.Data.MappingType.Element); this.Columns.Add(this.columnytd_sales); this.columnnotes = new DataColumn("notes", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnnotes); this.columnpubdate = new DataColumn("pubdate", typeof(System.DateTime), null, System.Data.MappingType.Element); this.Columns.Add(this.columnpubdate); } public TitlesRow NewTitlesRow() { return ((TitlesRow)(this.NewRow())); } protected override DataRow NewRowFromBuilder(DataRowBuilder builder) { return new TitlesRow(builder); } protected override System.Type GetRowType() { return typeof(TitlesRow); } protected override void OnRowChanged(DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.TitlesRowChanged != null)) { this.TitlesRowChanged(this, new TitlesRowChangeEvent (((TitlesRow)(e.Row)), e.Action)); } } protected override void OnRowChanging(DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.TitlesRowChanging != null)) { this.TitlesRowChanging(this, new TitlesRowChangeEvent (((TitlesRow)(e.Row)), e.Action)); } } protected override void OnRowDeleted(DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.TitlesRowDeleted != null)) { this.TitlesRowDeleted(this, new TitlesRowChangeEvent (((TitlesRow)(e.Row)), e.Action)); } } protected override void OnRowDeleting(DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.TitlesRowDeleting != null)) { this.TitlesRowDeleting(this, new TitlesRowChangeEvent (((TitlesRow)(e.Row)), e.Action)); } } public void RemoveTitlesRow(TitlesRow row) { this.Rows.Remove(row); } } [System.Diagnostics.DebuggerStepThrough()] public class TitlesRow : DataRow { private TitlesDataTable tableTitles; internal TitlesRow(DataRowBuilder rb) : base(rb) { this.tableTitles = ((TitlesDataTable)(this.Table)); } public string title_id { get { try { return ((string)(this[this.tableTitles.title_idColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.title_idColumn] = value; } } public string title { get { try { return ((string)(this[this.tableTitles.titleColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.titleColumn] = value; } } public string type { get { try { return ((string)(this[this.tableTitles.typeColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.typeColumn] = value; } } public string pub_id { get { try { return ((string)(this[this.tableTitles.pub_idColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.pub_idColumn] = value; } } public System.Decimal price { get { try { return ((System.Decimal)(this[this.tableTitles.priceColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.priceColumn] = value; } } public System.Decimal advance { get { try { return ((System.Decimal)(this[this.tableTitles.advanceColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.advanceColumn] = value; } } public int royalty { get { try { return ((int)(this[this.tableTitles.royaltyColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.royaltyColumn] = value; } } public int ytd_sales { get { try { return ((int)(this[this.tableTitles.ytd_salesColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.ytd_salesColumn] = value; } } public string notes { get { try { return ((string)(this[this.tableTitles.notesColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.notesColumn] = value; } } public System.DateTime pubdate { get { try { return ((System.DateTime)(this[this.tableTitles.pubdateColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("Cannot get value because it is DBNull.", e); } } set { this[this.tableTitles.pubdateColumn] = value; } } public bool Istitle_idNull() { return this.IsNull(this.tableTitles.title_idColumn); } public void Settitle_idNull() { this[this.tableTitles.title_idColumn] = System.Convert.DBNull; } public bool IstitleNull() { return this.IsNull(this.tableTitles.titleColumn); } public void SettitleNull() { this[this.tableTitles.titleColumn] = System.Convert.DBNull; } public bool IstypeNull() { return this.IsNull(this.tableTitles.typeColumn); } public void SettypeNull() { this[this.tableTitles.typeColumn] = System.Convert.DBNull; } public bool Ispub_idNull() { return this.IsNull(this.tableTitles.pub_idColumn); } public void Setpub_idNull() { this[this.tableTitles.pub_idColumn] = System.Convert.DBNull; } public bool IspriceNull() { return this.IsNull(this.tableTitles.priceColumn); } public void SetpriceNull() { this[this.tableTitles.priceColumn] = System.Convert.DBNull; } public bool IsadvanceNull() { return this.IsNull(this.tableTitles.advanceColumn); } public void SetadvanceNull() { this[this.tableTitles.advanceColumn] = System.Convert.DBNull; } public bool IsroyaltyNull() { return this.IsNull(this.tableTitles.royaltyColumn); } public void SetroyaltyNull() { this[this.tableTitles.royaltyColumn] = System.Convert.DBNull; } public bool Isytd_salesNull() { return this.IsNull(this.tableTitles.ytd_salesColumn); } public void Setytd_salesNull() { this[this.tableTitles.ytd_salesColumn] = System.Convert.DBNull; } public bool IsnotesNull() { return this.IsNull(this.tableTitles.notesColumn); } public void SetnotesNull() { this[this.tableTitles.notesColumn] = System.Convert.DBNull; } public bool IspubdateNull() { return this.IsNull(this.tableTitles.pubdateColumn); } public void SetpubdateNull() { this[this.tableTitles.pubdateColumn] = System.Convert.DBNull; } } [System.Diagnostics.DebuggerStepThrough()] public class TitlesRowChangeEvent : EventArgs { private TitlesRow eventRow; private DataRowAction eventAction; public TitlesRowChangeEvent(TitlesRow row, DataRowAction action) { this.eventRow = row; this.eventAction = action; } public TitlesRow Row { get { return this.eventRow; } } public DataRowAction Action { get { return this.eventAction; } } } }