chapperzUK Posted September 3, 2009 Share Posted September 3, 2009 How do you show can active player's information? I have this code but it has errors (in red) and I'm not sure if it works. Private Sub btnActive_Click(ByVal sender As Object, ByVal e As EventArgs) Dim filter As IEnumerable(Of Player) = fmDataContext.Players Dim player As Player = DirectCast(fmDataContext.ActiveObject, Player) If player IsNot Nothing Then filter = filter.Where(Function(p) p.ID.Equals(player.ID)) gridPlayers.AutoGenerateColumns = True gridPlayers.DataSource = (From p In filter Select New _ [color="red"][b]ID [/b][/color]= player.ID _ [b][color="red"]FullName [/color][/b]= player.ToString() _ NickName = player.Nickname _ CA = player.CurrentPlayingAbility _ PA = player.PotentialPlayingAbility _ Age = player.Age _ Value = String.Format("{0:€ #,##0;(€ #,##0)}", player.Value) _ SaleValue = String.Format("{0:€ #,##0;(€ #,##0)}", player.SaleValue) End If txtPlayerCorners.Text = ([color="Red"][b]currentPlayer[/b][/color].TechnicalSkills.Corners / 5).ToString(); End Sub Any help would be appreciated and you can be credited in the final piece. You can either PM me or email me. Link to post Share on other sites More sharing options...
nine_iron Posted September 3, 2009 Share Posted September 3, 2009 A little more info will be of help, or try programmers oracle in the main community section. I know a bit about stuff, what are you trying to get to talk in what? ( i am rather bemused by this, I am only an intermediate programmer with VB, SQL and HTML) http://community.sigames.com/forumdisplay.php?f=11 Link to post Share on other sites More sharing options...
neevesc Posted September 5, 2009 Share Posted September 5, 2009 How do you show can active player's information?I have this code but it has errors (in red) and I'm not sure if it works. Private Sub btnActive_Click(ByVal sender As Object, ByVal e As EventArgs) Dim filter As IEnumerable(Of Player) = fmDataContext.Players Dim player As Player = DirectCast(fmDataContext.ActiveObject, Player) If player IsNot Nothing Then filter = filter.Where(Function(p) p.ID.Equals(player.ID)) gridPlayers.AutoGenerateColumns = True gridPlayers.DataSource = (From p In filter Select New _ [color=red][b]ID [/b][/color]= player.ID _ [b][color=red]FullName [/color][/b]= player.ToString() _ NickName = player.Nickname _ CA = player.CurrentPlayingAbility _ PA = player.PotentialPlayingAbility _ Age = player.Age _ Value = String.Format("{0:€ #,##0;(€ #,##0)}", player.Value) _ SaleValue = String.Format("{0:€ #,##0;(€ #,##0)}", player.SaleValue) End If txtPlayerCorners.Text = ([color=red][b]currentPlayer[/b][/color].TechnicalSkills.Corners / 5).ToString(); End Sub Any help would be appreciated and you can be credited in the final piece. You can either PM me or email me. Using the FM Framework: In your button click event use this: If TypeOf (fmDataContext.ActiveObject) Is Player Then ' Details Me.lblName.Text = DirectCast(fmDataContext.ActiveObject, Player).ToString() Me.lblClub.Text = DirectCast(fmDataContext.ActiveObject, Player).Team.Club.Name Me.lblAge.Text = DirectCast(fmDataContext.ActiveObject, Player).Age.ToString Me.dtpDOB.Value = DirectCast(fmDataContext.ActiveObject, Player).DateOfBirth.ToShortDateString Me.lblCityofBirth.Text = DirectCast(fmDataContext.ActiveObject, Player).CityOfBirth.Name Me.numHapiness.Value = DirectCast(fmDataContext.ActiveObject, Player).Contract.Happiness Me.mtxtIntCaps.Text = DirectCast(fmDataContext.ActiveObject, Player).InternationalCaps.ToString Me.mtxtIntGoals.Text = DirectCast(fmDataContext.ActiveObject, Player).InternationalGoals.ToString Me.mtxtU21Caps.Text = DirectCast(fmDataContext.ActiveObject, Player).U21InternationalCaps Me.mtxtU21Goals.Text = DirectCast(fmDataContext.ActiveObject, Player).U21InternationalGoals End If Link to post Share on other sites More sharing options...
neevesc Posted September 5, 2009 Share Posted September 5, 2009 I have converted DrBernhard C# FM Framework to VB.Net some time ago, using FM version 9.0.2 I think. I also have included in the source code a small demo app (it's not very tidy). This will give you an idea on how it works. http://code.google.com/p/fm-framework-vbnet/ Link to post Share on other sites More sharing options...
nine_iron Posted September 6, 2009 Share Posted September 6, 2009 vb.net, something a little more in my language... LOL Link to post Share on other sites More sharing options...
chapperzUK Posted September 6, 2009 Author Share Posted September 6, 2009 I have converted DrBernhard C# FM Framework to VB.Net some time ago, using FM version 9.0.2 I think. I also have included in the source code a small demo app (it's not very tidy). This will give you an idea on how it works.http://code.google.com/p/fm-framework-vbnet/ Where is the source? Link to post Share on other sites More sharing options...
neevesc Posted September 7, 2009 Share Posted September 7, 2009 Where is the source? You need to download the source by using a subversion client. I use Tortoise http://tortoisesvn.net/. When you have that installed, in Windows Explorer with a folder where you want the source code checked out to, right click and select SVN Checkout and the URL will be http://scoutframeworkfm2009.googlecode.com/svn/trunk/. The source code will then be checked out, and you can then open up in VS. Link to post Share on other sites More sharing options...
chapperzUK Posted September 7, 2009 Author Share Posted September 7, 2009 Thanks neevesc Link to post Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.