More work - testing live

This commit is contained in:
Rick Falkvinge
2012-01-14 05:45:31 +00:00
parent 1bdbcaae83
commit b3893d2232
3 changed files with 59 additions and 13 deletions
@@ -30,7 +30,6 @@ public partial class Controls_v5_PersonDetailPopup : ControlV5Base
private Person _person;
private Authority _authority;
public Person Person
@@ -67,15 +66,7 @@ public partial class Controls_v5_PersonDetailPopup : ControlV5Base
}
}
/*
public Authority Authority
{
set
{
_authority = value;
this.PersonNewOwner.Authority = value;
}
}*/
public FinancialAccount Account
+1 -1
View File
@@ -13,7 +13,7 @@
</div>
<div class="entryfields">
<strong>Budget, Owner [LOC]</strong><br/>
<asp:Repeater ID="RepeaterAccountBudgets" OnItemDataBound="RepeaterAccountBudgets_ItemDataBound" runat="server"><ItemTemplate><asp:TextBox ID="TextBudget" runat="server" Text="Not set" />&nbsp;<span style="border-bottom: dashed 1px #808080;cursor:pointer"><asp:Label ID="LabelBudgetOwner" runat="server" /></span><asp:HiddenField ID="HiddenAccountId" runat="server" /><telerik:RadToolTip ID="ToolTip" runat="server" AnimationDuration="150" AutoCloseDelay="200000" ShowDelay="0"
<asp:Repeater ID="RepeaterAccountBudgets" OnItemDataBound="RepeaterAccountBudgets_ItemDataBound" runat="server"><ItemTemplate><asp:HiddenField runat="server" ID="HiddenAccountId" /><asp:TextBox ID="TextBudget" runat="server" Text="Not set" />&nbsp;<span style="border-bottom: dashed 1px #808080;cursor:pointer"><asp:Label ID="LabelBudgetOwner" runat="server" /></span><telerik:RadToolTip ID="ToolTip" runat="server" AnimationDuration="150" AutoCloseDelay="200000" ShowDelay="0"
EnableShadow="true" HideDelay="1" Width="288px" Height="96px" HideEvent="ManualClose" OffsetX="30" OffsetY="0"
RelativeTo="Element" Animation="Slide" Position="TopCenter" ShowCallout="true" TargetControlID="LabelBudgetOwner" RenderInPageRoot="true" ShowEvent="OnClick"
Skin="Telerik"><act5:PersonDetailPopup runat="server" ID="PersonDetail" /></telerik:RadToolTip><br/></ItemTemplate></asp:Repeater>
+57 -2
View File
@@ -5,7 +5,9 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using Activizr.Basic.Enums;
using Activizr.Logic.Financial;
using Activizr.Logic.Pirates;
using Activizr.Logic.Security;
using Telerik.Web.UI;
public partial class Pages_v5_Ledgers_SetRootBudgets : PageV5Base
{
@@ -86,16 +88,50 @@ public partial class Pages_v5_Ledgers_SetRootBudgets : PageV5Base
textBudget.Style[HtmlTextWriterStyle.Width] = "80px";
Label labelOwnerName = (Label) e.Item.FindControl("LabelBudgetOwner");
if (account.Owner == null)
Person accountOwner = account.Owner;
if (accountOwner == null)
{
labelOwnerName.Text = "None [LOC]";
}
else
{
labelOwnerName.Text = account.Owner.Formal;
labelOwnerName.Text = accountOwner.Formal;
}
RadToolTip toolTip = (RadToolTip)e.Item.FindControl("ToolTip");
Controls_v5_PersonDetailPopup personDetail = (Controls_v5_PersonDetailPopup)toolTip.FindControl("PersonDetail");
personDetail.PersonChanged += new EventHandler(PersonDetail_PersonChanged);
if (!Page.IsPostBack && _authority != null)
{
personDetail.Person = accountOwner;
personDetail.Account = account;
}
HiddenField hiddenAccountId = (HiddenField) e.Item.FindControl("HiddenAccountId");
hiddenAccountId.Value = account.Identity.ToString();
// this.TooltipManager.TargetControls.Add(labelBudgetOwner.ClientID, line.AccountIdentity.ToString(), true);
}
void PersonDetail_PersonChanged(object sender, EventArgs e)
{
// Here, an owner has changed. We need to re-bind the owners column.
/*
FinancialAccounts accounts = _account.Children;
AccountBudgetLines childData = new AccountBudgetLines();
foreach (FinancialAccount account in accounts)
{
childData.Add(new AccountBudgetLine(account, _year));
}
this.RepeaterBudgetOwners.DataSource = childData;
this.RepeaterBudgetOwners.DataBind();
RebindTooltips();*/
}
protected void DropYears_SelectedIndexChanged(object sender, EventArgs e)
@@ -104,6 +140,8 @@ public partial class Pages_v5_Ledgers_SetRootBudgets : PageV5Base
this.RepeaterAccountBudgets.DataSource = accounts;
this.RepeaterAccountBudgets.DataBind();
this.RebindTooltips();
}
private FinancialAccounts GetRootLevelResultAccounts()
@@ -124,4 +162,21 @@ public partial class Pages_v5_Ledgers_SetRootBudgets : PageV5Base
return accounts;
}
protected void RebindTooltips()
{
foreach (RepeaterItem repeaterItem in this.RepeaterAccountBudgets.Items)
{
HiddenField hiddenAccountId = (HiddenField)repeaterItem.FindControl("HiddenAccountId");
FinancialAccount child = FinancialAccount.FromIdentity(Int32.Parse(hiddenAccountId.Value));
RadToolTip toolTip = (RadToolTip)repeaterItem.FindControl("ToolTip");
Controls_v5_PersonDetailPopup personDetail = (Controls_v5_PersonDetailPopup)toolTip.FindControl("PersonDetail");
FinancialAccount account = FinancialAccount.FromIdentity(Int32.Parse(hiddenAccountId.Value));
personDetail.Person = account.Owner;
personDetail.Account = account;
}
}
}