Skip to content

Commit 6b7da55

Browse files
authored
Merge pull request #209 from Resgrid/develop
CU-868d85dv8 Fixed Email address error and time error.
2 parents cd4eaa8 + 5d71368 commit 6b7da55

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

Core/Resgrid.Services/EmailService.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public async Task<bool> SendCallAsync(Call call, CallDispatch dispatch, UserProf
184184

185185
string subject = string.Empty;
186186
string priority = string.Empty;
187-
string address = string.Empty;
187+
string address = "No Address Supplied";
188188

189189
if (call.IsCritical)
190190
{
@@ -199,9 +199,12 @@ public async Task<bool> SendCallAsync(Call call, CallDispatch dispatch, UserProf
199199

200200
string coordinates = "No Coordinates Supplied";
201201
if (!string.IsNullOrEmpty(call.GeoLocationData) && call.GeoLocationData.Length > 1)
202-
{
203202
coordinates = call.GeoLocationData;
204203

204+
if (!string.IsNullOrEmpty(call.Address))
205+
address = call.Address;
206+
else if (!string.IsNullOrEmpty(call.GeoLocationData) && call.GeoLocationData.Length > 1)
207+
{
205208
string[] points = call.GeoLocationData.Split(char.Parse(","));
206209

207210
if (points != null && points.Length == 2)
@@ -216,15 +219,10 @@ public async Task<bool> SendCallAsync(Call call, CallDispatch dispatch, UserProf
216219
}
217220
}
218221

219-
if (!string.IsNullOrEmpty(call.Address) && string.IsNullOrWhiteSpace(address))
220-
address = call.Address;
221-
else
222-
address = "No Address Supplied";
223-
224222
string dispatchedOn = String.Empty;
225223

226224
if (call.Department != null)
227-
dispatchedOn = call.LoggedOn.FormatForDepartment(call.Department);
225+
dispatchedOn = call.LoggedOn.TimeConverterToString(call.Department);
228226
else
229227
dispatchedOn = call.LoggedOn.ToString("G") + " UTC";
230228

Workers/Resgrid.Workers.Framework/Logic/CallBroadcast.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ public static async Task<bool> ProcessCallQueueItem(CallQueueItem cqi)
6464

6565
var dispatchedUsers = new HashSet<string>();
6666

67+
if (_departmentsService == null)
68+
_departmentsService = Bootstrapper.GetKernel().Resolve<IDepartmentsService>();
69+
70+
var department = await _departmentsService.GetDepartmentByIdAsync(cqi.Call.DepartmentId);
71+
cqi.Call.Department = department;
72+
6773
// Dispatch Personnel
6874
if (cqi.Call.Dispatches != null && cqi.Call.Dispatches.Any())
6975
{
@@ -90,12 +96,6 @@ public static async Task<bool> ProcessCallQueueItem(CallQueueItem cqi)
9096
if (_departmentGroupsService == null)
9197
_departmentGroupsService = Bootstrapper.GetKernel().Resolve<IDepartmentGroupsService>();
9298

93-
if (_departmentsService == null)
94-
_departmentsService = Bootstrapper.GetKernel().Resolve<IDepartmentsService>();
95-
96-
var department = await _departmentsService.GetDepartmentByIdAsync(cqi.Call.DepartmentId);
97-
cqi.Call.Department = department;
98-
9999
// Dispatch Groups
100100
if (cqi.Call.GroupDispatches != null && cqi.Call.GroupDispatches.Any())
101101
{

0 commit comments

Comments
 (0)