This commit is contained in:
Rick Falkvinge
2013-10-29 22:18:45 +00:00
parent d82b34dafa
commit 94d3ca2da1
2 changed files with 18 additions and 1 deletions
@@ -84,7 +84,7 @@
<asp:Content ID="Content5" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
<asp:HiddenField ID="TagSetIdentifiers" runat="server"/>
<asp:HiddenField ID="HiddenTagSetIdentifiers" runat="server"/>
<div class="entryFields">
<asp:TextBox runat="server" ID="TextAmount" CssClass="alignRight" />&nbsp;<br/>
<asp:TextBox runat="server" ID="TextPurpose" />&nbsp;<br/>
@@ -17,6 +17,8 @@ namespace Swarmops.Frontend.Pages.v5.Financial
string tagSetIdsString = Request.Form["HiddenTagSetIdentifiers"];
int[] tagSetIds;
// Find our tag ids, either from previously hidden var or load from org
if (String.IsNullOrEmpty(tagSetIdsString))
{
tagSetIds = FinancialTransactionTagSets.ForOrganization(this.CurrentOrganization).Identities;
@@ -32,6 +34,8 @@ namespace Swarmops.Frontend.Pages.v5.Financial
}
}
// Construct data source
List<TagSetDataSourceItem> dataSource = new List<TagSetDataSourceItem>();
foreach (int tagSetId in tagSetIds)
@@ -47,6 +51,8 @@ namespace Swarmops.Frontend.Pages.v5.Financial
dataSource.Add(item);
}
// Bind data
this.RepeaterTagLabels.DataSource = dataSource;
this.RepeaterTagDrop.DataSource = dataSource;
this.RepeaterTagDropScript.DataSource = dataSource;
@@ -54,6 +60,17 @@ namespace Swarmops.Frontend.Pages.v5.Financial
this.RepeaterTagLabels.DataBind();
this.RepeaterTagDrop.DataBind();
this.RepeaterTagDropScript.DataBind();
// Write set list back to hidden variable
List<string> tagSetIdStringList = new List<string>();
foreach (int tagSetId in tagSetIds)
{
tagSetIdStringList.Add(tagSetId.ToString(CultureInfo.InvariantCulture));
}
this.HiddenTagSetIdentifiers.Value = String.Join(",", tagSetIdStringList.ToArray());
}
protected void Page_Load(object sender, EventArgs e)