More code for live profit
This commit is contained in:
@@ -308,9 +308,9 @@ namespace Swarmops.Frontend.Socket
|
||||
Int64 annualProfitLossCents = GetOrganizationProfitLossCents(organization);
|
||||
|
||||
JObject json = new JObject();
|
||||
json["messageType"] = "AnnualProfitLossCents";
|
||||
json["profitLossCents"] = annualProfitLossCents.ToString();
|
||||
json["organizationId"] = organization.Identity;
|
||||
json["MessageType"] = "AnnualProfitLossCents";
|
||||
json["ProfitLossCents"] = annualProfitLossCents.ToString();
|
||||
json["OrganizationId"] = organization.Identity;
|
||||
|
||||
BroadcastToOrganization(organization, json);
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ namespace Swarmops.Frontend.Socket
|
||||
base.OnOpen();
|
||||
|
||||
JObject json = new JObject();
|
||||
json ["messageType"] = json["messageType"] = "AnnualProfitLossCents";
|
||||
json["profitLossCents"] = FrontendLoop.GetOrganizationProfitLossCents(this._authority.Organization).ToString();
|
||||
json["organizationId"] = this._authority.Organization.Identity;
|
||||
json ["MessageType"] = json["messageType"] = "AnnualProfitLossCents";
|
||||
json["ProfitLossCents"] = FrontendLoop.GetOrganizationProfitLossCents(this._authority.Organization).ToString();
|
||||
json["OrganizationId"] = this._authority.Organization.Identity;
|
||||
|
||||
this.Send(json.ToString());
|
||||
}
|
||||
|
||||
@@ -105,6 +105,12 @@ function _masterInitializeSocket(authenticationTicket) {
|
||||
else if (message.MessageType == "Malfunctions") {
|
||||
_master_updateMalfunctions (message.MalfunctionsList);
|
||||
}
|
||||
else if (message.MessageType == "AnnualProfitLossCents") {
|
||||
if (odoProfitLossToDate != undefined) // if there's a P&L odometer on the current page
|
||||
{
|
||||
odoProfitLossToDate.innerHTML = (message.ProfitLossCents / 100.0) + 0.001; // update it; +0.001 needed for %.2f
|
||||
}
|
||||
}
|
||||
else if (message.MessageType == "SandboxUpdate") {
|
||||
if (odoLocalParticipation != undefined) { // Real ugly accessing specific page elements here, but it's temporary
|
||||
odoLocalParticipation.innerHTML = message.Local;
|
||||
|
||||
Reference in New Issue
Block a user