General tidy.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user