Brought into line with LogMgr.

This commit is contained in:
Andy Howard
2019-10-03 16:42:35 +01:00
parent b8e01905c9
commit 17e9ca8796
2 changed files with 12 additions and 14 deletions
@@ -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
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
@@ -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;
}