Filling BO


Author
Message
Ian Johnston
Ian Johnston
StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
I am trying to fill a BO with filtered data , can anyone tell me what I need to change ?

public void pdt_data(string lic)

{

string s = "select * from truck where truck_license = "+lic;

FillDataTable(s);

}


Replies
Ian Johnston
Ian Johnston
StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
So in the light of day I modified the code to be

private string getTrk_lic()

{

//-- Only show one panel, and put the browse results in the visible panel

this.browseDialogtruck.AdvancedOptions = false;

this.browseDialogtruck.AllowHideResults = false;

this.browseDialogtruck.AllowSearchFieldsButton = false;

this.browseDialogtruck.SearchFields["FK_customer"].InitialValue = certificateBO1.FK_Customer2.ToString();

// '-- Show the browse dialog  From the lookup control sample by Ivan

// If CustomersBrowseDialog1.ShowDialog() = DialogResult.OK Then

// Me.txtCode.Text = CustomersBO1.cust_pk.ToString

// End If

if (this.browseDialogtruck.ShowDialog(true).Equals(DialogResult.OK))

{

return truckBO2.truck_license;

}

else

{

return "";

}

}

this now works and returns the value but the form still wants to start over, how do I get the focus back to the forms main BO (certificateBO1) and back to the textbox that calls this browsedialog?


Ian Johnston
Ian Johnston
StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)StrataFrame User (221 reputation)
Group: StrataFrame Users
Posts: 77, Visits: 470
OK the fog is clearing. I had the tab control that textbox is on disabled in the FormEditingStaeChanged event - Don't know why but at some point it must have been a good idea! Code is now working great if there is only one value to assign it is assigned, if there are more than one value the BrowseDialog appears popualted with valid choices and choice selected is entered in the textbox or if there is no selection textbox is blank and allows entry as this may be a one time transaction using this license number.
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ian Johnston (08/30/2010)
OK the fog is clearing.


Pretty good Ian, congratulations!!!

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Glad you are getting it going. While programming can be frustrating, I love those "fog is clearing" moments. BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ian Johnston - 15 Years Ago
Edhy Rijo - 15 Years Ago
Ian Johnston - 15 Years Ago
Greg McGuffey - 15 Years Ago
Ian Johnston - 15 Years Ago
                         Hi Ian,
I am not a C# developer but there are a lot places in the...
Edhy Rijo - 15 Years Ago
                             Edhy is batting a 1000. :D

You don't want to refill the BO...
Greg McGuffey - 15 Years Ago
                                 Thanks to both of you for your help.
Ian Johnston - 15 Years Ago
                                     Glad to help Ian.
Greg McGuffey - 15 Years Ago
                                         OK so I have written the following code to look up the truck license...
Ian Johnston - 15 Years Ago
                                             So in the light of day I modified the code to be private...
Ian Johnston - 15 Years Ago
                                                 OK the fog is clearing. I had the tab control that textbox is...
Ian Johnston - 15 Years Ago
                                                     [quote][b]Ian Johnston (08/30/2010)[/b][hr]OK the fog is...
Edhy Rijo - 15 Years Ago
                                                         Glad you are getting it going. While programming can be frustrating, I...
Greg McGuffey - 15 Years Ago
Jimmy D Cook - 13 Years Ago
Edhy Rijo - 13 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search