﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum / StrataFrame Application Framework / WinForms (How do I?)  / Entering data in a form with different BO at runtime / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Sun, 07 Sep 2008 17:10:55 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Entering data in a form with different BO at runtime</title><link>http://forum.strataframe.net/Topic15958-7-1.aspx</link><description>Hi Trent,&lt;P&gt;Thanks a lot for the ideas.&lt;/P&gt;&lt;P&gt;I took another approach by passing the NoteType and ParentPK values as a parameter to the Note Manager form and then created a method [&lt;FONT size=2&gt;FillByTypeAndPK(pFK_NoteType, pFK_ParentRecord)&lt;/FONT&gt;] in the the BO to get the correct note records. :P&lt;/P&gt;&lt;P&gt;Then in the parent form I have this code to call the Note Management form:&lt;/P&gt;&lt;P&gt;[quote][codesnippet]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; loNoteForm &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; frmHistoryAndNotes(IBS_BOL.IBSEnums.HistoryAndNoteType.InsuredCustomer, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.InsuredCustomerBO1.PK_InsuredCustomer)&lt;/P&gt;&lt;P&gt;loNoteForm.ShowDialog(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;P&gt;loNoteForm.Dispose()&lt;/P&gt;&lt;P&gt;loNoteForm = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Nothing&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet][/quote]&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt; &lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 05 May 2008 17:50:08 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Entering data in a form with different BO at runtime</title><link>http://forum.strataframe.net/Topic15958-7-1.aspx</link><description>[quote]Does the Phone type table have a field to hold the Parent Table Name which will be used to relate the Parent PK?[/quote]&lt;/P&gt;&lt;P&gt;No, just the primary key value (i.e. BigInt, Guid, etc.)  Then you will have a type field which is an integer and you will create an Enum for within your application and assign to this as a Custom Data Type in the BO Mapper.  This is how you will identify to which table the record belongs.  You will not want to use a string and the table name as this will be much slower on queries and it prevents you from changing table names, etc. if the need arises.&lt;/P&gt;&lt;P&gt;[quote]The Parent PK field, is this field automatically related to the Parent Table in the BO or is this handle manually whenever you add a phone from each particular form?[/quote]&lt;/P&gt;&lt;P&gt;You can automatically manage this on your manager class.  You will create two properties on your class.&lt;/P&gt;&lt;P&gt;ParentBusinessObject As BusinessLayer - The Parent table reference&lt;BR&gt;BusinessObject As BusinessLayer - The Notes table&lt;/P&gt;&lt;P&gt;You will also have a property of the enum value that you create that identifies the parent table:&lt;/P&gt;&lt;P&gt;ParentType As MyNotesEnum&lt;/P&gt;&lt;P&gt;This will tell you how to treat the ParentBusinessObject property and pull the PK.  You could do this by using the PrimarykeyField property on the BO as well, but you will still need the enum property so that you can set this value on the NoteItems record when created so you know how to get it back out of the database.</description><pubDate>Mon, 05 May 2008 09:51:39 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Entering data in a form with different BO at runtime</title><link>http://forum.strataframe.net/Topic15958-7-1.aspx</link><description>[quote][b]Trent L. Taylor (04/28/2008)[/b][hr][quote]We have a PhoneNumbers manager in our medical application with a common PhoneNumbers table that is used anywhere that we have a phone number with a type indicator that determines to which table and then a parent PK for the direct identification of the parent.  You need both (type and parent PK) to create a unique record.[/quote]&lt;/P&gt;&lt;P&gt;Hi Trent,&lt;/P&gt;&lt;P&gt;I am creating a Note Management form that may benefic from your Phone Management approach. I have a couple of questions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Does the Phone type table have a field to hold the Parent Table Name which will be used to relate the Parent PK?&lt;/LI&gt;&lt;LI&gt;The Parent PK field, is this field automatically related to the Parent Table in the BO or is this handle manually whenever you add a phone from each particular form?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Basically what I would like to do is have one single Note tables to handle Notes for several tables, which is what you are doing with the PhoneNumbers manager.</description><pubDate>Mon, 05 May 2008 07:52:37 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Entering data in a form with different BO at runtime</title><link>http://forum.strataframe.net/Topic15958-7-1.aspx</link><description>Edhy...you misunderstood what I was getting at.  You could create a common table if you wanted.  But I would be more inclined to create a common control (user control) that gets dropped on unique forms.  That is a much more normalized environment...but you can go any way you want.  If you want to have one form with a lot of BOs on it, then just programatically create the BO translations.</description><pubDate>Mon, 28 Apr 2008 15:13:29 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Entering data in a form with different BO at runtime</title><link>http://forum.strataframe.net/Topic15958-7-1.aspx</link><description>[quote][b]Trent L. Taylor (04/28/2008)[/b][hr][quote]a PhoneNumbers manager in our medical application with a common PhoneNumbers table that is used anywhere that we have a phone number with a type indicator that determines to which table and then a parent PK for the direct identification of the parent.  You need both (type and parent PK) to create a unique record.[/quote] &lt;P&gt;Hummm, I don't have a common address table, all tables have their own address fields, I was thinking on just using a common Address Form manager to handle the address entry, is this still possible possible? if not then I could change my structure to use a common address table as you do with your PhoneNumbers manager.</description><pubDate>Mon, 28 Apr 2008 15:07:51 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Entering data in a form with different BO at runtime</title><link>http://forum.strataframe.net/Topic15958-7-1.aspx</link><description>[quote]How to programmatically update the CFD properties to use the correct BO to be translated[/quote]&lt;/P&gt;&lt;P&gt;You can programmatically add a BO translation.  I do this quite a bit.  If you want to know what the object looks like, just open the designer file on a form that you have defined a translation.  Just remember that you will define the _BoName instead of the BoName.  The field is what gets reflected and translated not the component object.&lt;/P&gt;&lt;P&gt;[quote]Should I create a generic BO with the Address fields to be used in the ChildForm and then translate this BO with all other BO?[/quote]&lt;/P&gt;&lt;P&gt;This is up to you.  We have a PhoneNumbers manager in our medical application with a common PhoneNumbers table that is used anywhere that we have a phone number with a type indicator that determines to which table and then a parent PK for the direct identification of the parent.  You need both (type and parent PK) to create a unique record.</description><pubDate>Mon, 28 Apr 2008 14:59:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>Entering data in a form with different BO at runtime</title><link>http://forum.strataframe.net/Topic15958-7-1.aspx</link><description>I have a several tables which has the same Address fields (Street, City, State, ZipCode), I would like to have use a generic ChildFormDialog to allow end user to enter the data for each table based on the calling form.  &lt;/P&gt;&lt;P&gt;Can this be done with the ChildFormDialog? if so:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;How to programmatically update the CFD properties to use the correct BO to be translated.&lt;/LI&gt;&lt;LI&gt;Should I create a generic BO with the Address fields to be used in the ChildForm and then translate this BO with all other BO?&lt;/LI&gt;&lt;/UL&gt;</description><pubDate>Mon, 28 Apr 2008 13:58:13 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>