Two dumbfixes
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Swarmops.Frontend.Automation
|
||||
return input.ToString("N2");
|
||||
}
|
||||
|
||||
|
||||
[WebMethod]
|
||||
public static AjaxInputCallResult FormatCurrencyString(string input)
|
||||
{
|
||||
double outParse = 0.0;
|
||||
|
||||
@@ -29,15 +29,17 @@
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
var currencyText = $('#<%=this.ClientID%>_TextInput').val();
|
||||
|
||||
var jsonData = {};
|
||||
jsonData.input = currencyText;
|
||||
$('#<%=this.ClientID%>_TextInput').blur(function () {
|
||||
|
||||
if (currencyText.trim().indexOf(' ') >= 0) {
|
||||
// the text contains at least one space, so try to interpret it and convert it to presentation currency
|
||||
var currencyText = $('#<%=this.ClientID%>_TextInput').val();
|
||||
|
||||
var jsonData = {};
|
||||
jsonData.input = currencyText;
|
||||
|
||||
if (currencyText.trim().indexOf(' ') >= 0) {
|
||||
// the text contains at least one space, so try to interpret it and convert it to presentation currency
|
||||
|
||||
$('#<%=this.ClientID%>_TextInput').blur(function() {
|
||||
SwarmopsJS.ajaxCall('/Automation/FinancialFunctions.aspx/InterpretCurrency',
|
||||
jsonData,
|
||||
function(data) {
|
||||
@@ -45,19 +47,19 @@
|
||||
alert("PresentationAmount:" + data.DisplayAmount + "\r\nUsed Currency:" + data.CurrencyCode + "\r\nEntered Amount:" + data.EnteredAmount);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// the text does NOT contain at least one space, so we should format it for presentation currency
|
||||
$('#<%=this.ClientID%>_TextInput').blur(function() {
|
||||
SwarmopsJS.ajaxCall('/Automation/Formatting.aspx/FormatCurrencyString',
|
||||
jsonData,
|
||||
function(data) {
|
||||
if (data.Success) {
|
||||
$('#<%=this.ClientID%>_TextInput').val(data.Result);
|
||||
}
|
||||
} else {
|
||||
// the text does NOT contain at least one space, so we should format it for presentation currency
|
||||
$('#<%=this.ClientID%>_TextInput').blur(function() {
|
||||
SwarmopsJS.ajaxCall('/Automation/Formatting.aspx/FormatCurrencyString',
|
||||
jsonData,
|
||||
function(data) {
|
||||
if (data.Success) {
|
||||
$('#<%=this.ClientID%>_TextInput').val(data.Result);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user