Update: SignalR 2.0.3 Migration; Noticeboards

Migrate all SignalR 1.x Persistent Connections to SignalR 2.x Hubs.
Abstracts ScheduledTaskStatus with core interface and adds a Mock for
optional status reporting. Noticeboards rewritten (with new theme) to be
more resilient and accurate.
This commit is contained in:
Gary Sharp
2014-06-01 23:27:07 +10:00
parent f6fae26bc7
commit 4cd57f4a90
116 changed files with 9874 additions and 6462 deletions
@@ -1,44 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace Disco.Web.Areas.Public.Models.HeldDevices
{
public class HeldDeviceModel
{
public string DeviceSerialNumber { get; set; }
public string DeviceComputerName { get; set; }
public int DeviceProfileId { get; set; }
public string DeviceAddress { get; set; }
public string DeviceLocation { get; set; }
public string DeviceDescription
{
get
{
StringBuilder sb = new StringBuilder(this.DeviceComputerName);
if (UserId != null)
sb.Append(" - ").Append(this.UserDisplayName).Append(" (").Append(this.UserId).Append(")");
if (!string.IsNullOrWhiteSpace(this.DeviceLocation))
sb.Append(" - ").Append(this.DeviceLocation);
else if (UserId == null)
sb.Append(" - ").Append(this.DeviceSerialNumber);
return sb.ToString();
}
}
public string UserId { get; set; }
public string UserDisplayName { get; set; }
public bool WaitingForUserAction { get; set; }
public string WaitingForUserActionSince { get; set; }
public bool ReadyForReturn { get; set; }
public string EstimatedReturnTime { get; set; }
public string ReadyForReturnSince { get; set; }
public bool IsAlert { get; set; }
}
}
@@ -1,61 +0,0 @@
using Disco.Data.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.BI.Extensions;
namespace Disco.Web.Areas.Public.Models.HeldDevices
{
public class HeldDeviceQueryModel
{
public int JobId { get; set; }
public string DeviceSerialNumber { get; set; }
public string DeviceComputerName { get; set; }
public int DeviceProfileId { get; set; }
public int? DeviceAddressId { get; set; }
public string DeviceLocation { get; set; }
public string UserId { get; set; }
public string UserDisplayName { get; set; }
public bool ReadyForReturn { get; set; }
public bool WaitingForUserAction { get; set; }
public DateTime? EstimatedReturnTime { get; set; }
public DateTime? ReadyForReturnSince { get; set; }
public DateTime? WaitingForUserActionSince { get; set; }
public HeldDeviceModel ToUserHeldDeviceModel(DiscoDataContext Database)
{
var uhdm = new HeldDeviceModel()
{
DeviceSerialNumber = this.DeviceSerialNumber,
DeviceComputerName = this.DeviceComputerName,
DeviceLocation = this.DeviceLocation,
DeviceProfileId = this.DeviceProfileId,
DeviceAddress = (this.DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(this.DeviceAddressId.Value).ShortName : string.Empty),
UserId = this.UserId,
UserDisplayName = this.UserDisplayName,
ReadyForReturn = this.ReadyForReturn,
WaitingForUserAction = this.WaitingForUserAction
};
var n = DateTime.Now;
if (!this.ReadyForReturn && this.EstimatedReturnTime.HasValue && this.EstimatedReturnTime.Value > n)
{
uhdm.EstimatedReturnTime = this.EstimatedReturnTime.FromNow();
}
if (this.ReadyForReturn)
{
uhdm.ReadyForReturnSince = this.ReadyForReturnSince.FromNow();
uhdm.IsAlert = (this.ReadyForReturnSince.Value < DateTime.Now.AddDays(-3));
}
if (this.WaitingForUserAction)
{
uhdm.WaitingForUserActionSince = this.WaitingForUserActionSince.FromNow();
uhdm.IsAlert = (this.WaitingForUserActionSince.Value < n.AddDays(-6));
}
return uhdm;
}
}
}