Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
cleaning up design of PositionsForm
Browse files Browse the repository at this point in the history
  • Loading branch information
sbohlen committed Oct 24, 2011
1 parent 0e2b2a0 commit a03e84c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -19,10 +19,7 @@ public partial class PositionsForm : Form

public PositionsForm(string accountName)
{
//in some future sample, use this to get the positions for just this one account,
// but for now just store it for future use
_accountName = accountName;

InitializeComponent();
}

Expand All @@ -33,12 +30,14 @@ private void closeButton_Click(object sender, EventArgs e)

private void PositionsForm_Load(object sender, EventArgs e)
{
accountLabel.Text = string.Format("Position Report for Account {0}", _accountName);

var repository = ContextRegistry.GetContext().GetObject("PositionRepository") as PositionRepository;
var shares = repository.GetAllShares();

foreach (var share in shares)
foreach (var position in shares)
{
currentPositionsListBox.Items.Add(string.Format("{0}: {1}", share.Symbol, share.Shares));
currentPositionsListBox.Items.Add(string.Format("{0}: {1}", position.Symbol, position.Shares));
}

}
Expand Down

0 comments on commit a03e84c

Please sign in to comment.