コード例 #1
0
ファイル: MapDAL.cs プロジェクト: RyanTankersley/XNATools
        /// <summary>
        /// Deletes from the database any Map Object that is no longer in this list, then calls insertupdate on each object
        /// </summary>
        /// <param name="os">The list of map objects to have in the database</param>
        /// <param name="parent">The parent of the map objects</param>
        private static void InsertUpdateMapObjects(MapObjects os, long parent)
        {
            MapObjects curr = GetMapObjects(parent);

            if (curr != null && curr.Count > 0 && os != null)
            {
                foreach (MapObject o in curr)
                {
                    if (os.FindByID(o.ID) == null)
                    {
                        DeleteMapObject(o.ID);
                    }
                }
            }

            foreach (MapObject o in os)
            {
                InsertUpdateMapObject(o, parent);
            }
        }