General tidy.

This commit is contained in:
Andy Howard
2024-06-13 14:32:44 +01:00
parent 0c44e9ddd3
commit bf6bb966bc
159 changed files with 1166 additions and 972 deletions
+3 -4
View File
@@ -444,17 +444,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
// Id.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
// Item type.
if ((int)ItemType > 1 && ItemType != data.ItemType)
throw new NotSupportedException(fn + " Item Type cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Type cannot be changed");
// Item Id.
if (SysId.IsValid(ItemId) && SysId.ToInt(ItemId) != SysId.ToInt(data.ItemId))
throw new NotSupportedException(fn + " Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
// Populate individual properties to ensure that 'Changed' indicator is kept up to date.
this.data.PopulateFrom(data);
}