|
|
@@ -22,9 +22,9 @@ namespace Comal.Stores
|
|
|
var start = TimeSpan.FromMinutes(Math.Floor(entity.Created.TimeOfDay.Subtract(entity.Window).TotalMinutes / 15.0F) * 15.0F);
|
|
|
var finish = start.Add(new TimeSpan(0, 15, 0));
|
|
|
|
|
|
- var sDescription = entity.LostTime.IsValid() ? entity.Description : "Manufacturing Time";
|
|
|
+ var sDescription = entity.LostTime.IsValid() ? entity.Description : "Manufacturing Time" ?? "Manufacturing Time";
|
|
|
|
|
|
- var ass = Provider.Query(
|
|
|
+ var assrows = Provider.Query(
|
|
|
Filter<Assignment>.Where(x => x.Employee.ID).IsEqualTo(entity.Employee.ID)
|
|
|
.And(x => x.Date).IsEqualTo(entity.Date)
|
|
|
.And(x => x.Actual.Finish).IsGreaterThanOrEqualTo(start)
|
|
|
@@ -37,7 +37,9 @@ namespace Comal.Stores
|
|
|
x => x.Actual.Finish
|
|
|
),
|
|
|
new SortOrder<Assignment>(x => x.Actual.Finish, SortDirection.Descending)
|
|
|
- ).Rows.Where(r => r.Get<Assignment, string>(c => c.Description).StartsWith(sDescription)).FirstOrDefault()?.ToObject<Assignment>();
|
|
|
+ ).Rows;
|
|
|
+ var assrow = assrows.FirstOrDefault(r => (r.Get<Assignment, string>(c => c.Description) ?? "").StartsWith(sDescription));
|
|
|
+ var ass = assrow?.ToObject<Assignment>();
|
|
|
|
|
|
if (ass == null)
|
|
|
{
|