This is kind of a critical fix :(
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
using Swarmops.Common.Enums;
|
||||
using Swarmops.Frontend;
|
||||
using Swarmops.Logic.Financial;
|
||||
using WebSocketSharp;
|
||||
|
||||
namespace Swarmops.Controls.Financial
|
||||
{
|
||||
@@ -57,6 +60,27 @@ namespace Swarmops.Controls.Financial
|
||||
}
|
||||
}
|
||||
|
||||
public FinancialAccount SelectedAccount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
throw new InvalidOperationException("SelectedAccount can only be retrieved in postback");
|
||||
}
|
||||
|
||||
string accountIdString = Request.Form[this.ClientID + "_DropBudgets"];
|
||||
if (accountIdString.IsNullOrEmpty())
|
||||
{
|
||||
throw new InvalidOperationException("ComboBudgets control submitted a null value");
|
||||
}
|
||||
int accountId = Int32.Parse(accountIdString);
|
||||
FinancialAccount account = FinancialAccount.FromIdentity(accountId);
|
||||
|
||||
return account;
|
||||
}
|
||||
}
|
||||
|
||||
public string Localized_DropInit
|
||||
{
|
||||
get { return CommonV5.JavascriptEscape(Resources.Global.Global_DropInits_SelectFinancialAccount); }
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
DateTime dueDate = DateTime.Parse (this.TextDueDate.Text);
|
||||
|
||||
|
||||
FinancialAccount budget = FinancialAccount.FromIdentity (Int32.Parse (Request.Form["DropBudgets"]));
|
||||
FinancialAccount budget = this.ComboBudgets.SelectedAccount;
|
||||
|
||||
// sanity check
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
DateTime dueDate = DateTime.Parse (this.TextDueDate.Text);
|
||||
|
||||
|
||||
FinancialAccount budget = FinancialAccount.FromIdentity (Int32.Parse (Request.Form["DropBudgets"]));
|
||||
FinancialAccount budget = this.ComboBudgets.SelectedAccount;
|
||||
|
||||
// sanity check
|
||||
|
||||
|
||||
@@ -934,7 +934,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
|
||||
string description = this.TextPurpose.Text;
|
||||
|
||||
FinancialAccount budget = FinancialAccount.FromIdentity (Int32.Parse (Request.Form["ComboBudgets"]));
|
||||
FinancialAccount budget = this.ComboBudgets.SelectedAccount;
|
||||
|
||||
// sanity check
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
|
||||
string description = this.TextPurpose.Text;
|
||||
|
||||
FinancialAccount budget = FinancialAccount.FromIdentity (Int32.Parse (Request.Form["DropBudgets"]));
|
||||
FinancialAccount budget = this.ComboBudgets.SelectedAccount;
|
||||
|
||||
// sanity check
|
||||
|
||||
|
||||
Reference in New Issue
Block a user