Esempio n. 1
0
        // Exceptions:
        //	System.ArgumentException:
        public void Save(ItemBase itemBase)
        {
            if (itemBase.IsNull)
            {
                SaveInternal(itemBase);
                return;
                //throw new System.ArgumentException("itemBase is null when saving ItemBase", "itemBase");
            }

            if (ItemBaseExists(itemBase.UniqueID))
            {
                ItemBase upToDateItemBase = new ItemBase();

                try
                {
                    Load(upToDateItemBase, itemBase.UniqueID);
                }
                catch
                {
                    SaveInternal(itemBase);
                    return;
                }

                if (itemBase.CompareTo(upToDateItemBase) != 0)
                {
                    UpdateInternal(itemBase);
                }
            }
            else
            {
                SaveInternal(itemBase);
            }
        }