From 17e9ca8796578e94eb73bce3f0e7be445a4c576c Mon Sep 17 00:00:00 2001 From: Andy Howard Date: Thu, 3 Oct 2019 16:42:35 +0100 Subject: [PATCH] Brought into line with LogMgr. --- .../Core/Bus/SlmItemChecklist_Mobile.cs | 5 +++-- .../SlmChecklistMgr_Mobile-ItemChecklists.cs | 21 ++++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/SaLogMgrMobCore/Mobile/Core/Bus/SlmItemChecklist_Mobile.cs b/SaLogMgrMobCore/Mobile/Core/Bus/SlmItemChecklist_Mobile.cs index 155dd9f..9fde20b 100644 --- a/SaLogMgrMobCore/Mobile/Core/Bus/SlmItemChecklist_Mobile.cs +++ b/SaLogMgrMobCore/Mobile/Core/Bus/SlmItemChecklist_Mobile.cs @@ -15,8 +15,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Bus //------------------------------------------------------------------- // Construction. - public SlmItemChecklist_Mobile (Slm.Site site, SysId id, SysId itemId, SysId checklistId, Slm.ChecklistItemType itemType, ushort flags) : - base(site, id, itemId, checklistId, itemType) + public SlmItemChecklist_Mobile (Slm.Site site, SysId id, ItemId itemId, SysId checklistId, ushort flags) : + base(site, id, itemId, checklistId) { Flags = flags; } @@ -27,6 +27,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Bus //------------------------------------------------------------------- // A s s o c i a t e d D a t a //------------------------------------------------------------------- + //------------------------------------------------------------------- } //======================================================================= diff --git a/SaLogMgrMobCore/Mobile/Core/Mgr/SlmChecklistMgr_Mobile-ItemChecklists.cs b/SaLogMgrMobCore/Mobile/Core/Mgr/SlmChecklistMgr_Mobile-ItemChecklists.cs index 4a8699f..31df3bb 100644 --- a/SaLogMgrMobCore/Mobile/Core/Mgr/SlmChecklistMgr_Mobile-ItemChecklists.cs +++ b/SaLogMgrMobCore/Mobile/Core/Mgr/SlmChecklistMgr_Mobile-ItemChecklists.cs @@ -30,10 +30,10 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr } // Create ItemChecklist. - public override SlmItemChecklist CreateItemChecklist (SysId itemId, SysId checklistId, Slm.ChecklistItemType itemType) + public override SlmItemChecklist CreateItemChecklist (ItemId itemId, SysId checklistId) { ClearErrorState(); - return new SlmItemChecklist_Mobile(Site, null, itemId, checklistId, itemType, 0); + return new SlmItemChecklist_Mobile(Site, null, itemId, checklistId, 0); } //------------------------------------------------------------------- @@ -98,8 +98,8 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr private void PopulateTo (XElement itemChecklistElement, SlmItemChecklist itemChecklist, DbUpdateInfo dbUpdateInfo) { itemChecklistElement.AppendElement("Id", SysId.ToString(itemChecklist.Id)); - itemChecklistElement.AppendElement("ItemChecklistType", itemChecklist.ItemType.ToString()); - itemChecklistElement.AppendElement("ItemId", SysId.ToString(itemChecklist.ItemId)); + itemChecklistElement.AppendElement("ItemType", itemChecklist.ItemId.Type.ToString()); + itemChecklistElement.AppendElement("ItemId", SysId.ToString(itemChecklist.ItemId.Id)); itemChecklistElement.AppendElement("ChecklistId", SysId.ToString(itemChecklist.ChecklistId)); itemChecklistElement.AppendElement("Name", itemChecklist.Name); itemChecklistElement.AppendElement("Actioned", DateUtil.FormatXmlDateTime(itemChecklist.Actioned)); @@ -159,7 +159,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr if (prm.ExcludedIds.Count > 0) filter.Add("ExcludedIds", prm.ExcludedIds.Concat(",")); // Item type: - if (prm.ItemType!= 0) filter.Add("ItemType", prm.ItemType.ToString()); + if (prm.ItemType != 0) filter.Add("ItemType", prm.ItemType.ToString()); // Item Id. if (SysId.IsValid(prm.ItemId)) filter.Add("ItemId", SysId.ToString(prm.ItemId)); @@ -167,9 +167,6 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr // Checklist Id. if (SysId.IsValid(prm.ChecklistId)) filter.Add("ChecklistId", SysId.ToString(prm.ChecklistId)); - // Active Only. - if (prm.ActiveOnly != false) filter.Add("ActiveOnly", prm.ActiveOnly.ToString()); - // Notes. if (!StringUtil.IsEmpty(prm.NotesPartial)) filter.Add("NotesPartial", prm.NotesPartial); @@ -220,7 +217,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr SlmItemChecklist.Column.ItemId, SlmItemChecklist.Column.ChecklistId, SlmItemChecklist.Column.Name, - SlmItemChecklist.Column.Actioned, + SlmItemChecklist.Column.ActionedOn, SlmItemChecklist.Column.Notes, SlmItemChecklist.Column.Flags, SlmItemChecklist.Column.Status @@ -232,12 +229,12 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr taskData.ThrowIfCancellationRequested(); // Item construction properties. SysId id = itemData.GetIdValue(SlmItemChecklist.Column.Id); + Slm.DataItemType itemType = EnumUtil.ParseEnum(itemData.GetValue(SlmItemChecklist.Column.ItemType),Slm.DataItemType.Unknown); SysId itemId = itemData.GetIdValue(SlmItemChecklist.Column.ItemId); SysId checklistId = itemData.GetIdValue(SlmItemChecklist.Column.ChecklistId); - Slm.ChecklistItemType itemType = EnumUtil.ParseEnum(itemData.GetValue(SlmItemChecklist.Column.ItemType), Slm.ChecklistItemType.Unknown); ushort flags = (ushort)itemData.GetIntValue(SlmItemChecklist.Column.Flags); // Create item. - SlmItemChecklist_Mobile itemChecklist = new SlmItemChecklist_Mobile(Site, id, itemId, checklistId, itemType, flags); + SlmItemChecklist_Mobile itemChecklist = new SlmItemChecklist_Mobile(Site, id, new ItemId((short)itemType, itemId), checklistId, flags); // Populate item properties. foreach (SlmItemChecklist.Column column in columns) { @@ -248,7 +245,7 @@ namespace Sarand.LogisticsMgr.Mobile.Core.Mgr //case SlmItemChecklist.Column.ItemId: itemChecklist.ItemId = itemData.GetIdValue(column); break; //case SlmItemChecklist.Column.ChecklistId: itemChecklist.ChecklistId = itemData.GetIdValue(column); break; case SlmItemChecklist.Column.Name: itemChecklist.Name = value; break; - case SlmItemChecklist.Column.Actioned: itemChecklist.Actioned = itemData.GetDateTimeValue(column); break; + case SlmItemChecklist.Column.ActionedOn: itemChecklist.Actioned = itemData.GetDateTimeValue(column); break; case SlmItemChecklist.Column.Notes: itemChecklist.Notes = value; break; case SlmItemChecklist.Column.Status: itemChecklist.Status = SacsSystem.GetStatusForCode(value); break; }