Ejemplo n.º 1
0
        /// <summary>
        /// Deletes records in the deleteList
        /// </summary>
        public void ProcessDeletedItems()
        {
            foreach (ItemType item in _deleteList)
            {
                ActiveRecord <ItemType> .Delete(item.GetPrimaryKeyValue());
            }

            _deleteList.Clear();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Finds the specified primary key value.
        /// </summary>
        /// <param name="primaryKeyValue">The primary key value.</param>
        /// <returns></returns>
        public ActiveRecord <ItemType> Find(object primaryKeyValue)
        {
            ActiveRecord <ItemType> result = null;

            foreach (ItemType item in this)
            {
                if (item.GetPrimaryKeyValue().Equals(primaryKeyValue))
                {
                    result = item;
                    break;
                }
            }

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the delete commands.
        /// </summary>
        /// <returns></returns>
        public QueryCommandCollection GetDeleteCommands()
        {
            QueryCommandCollection commands = new QueryCommandCollection();

            foreach (ItemType item in _deleteList)
            {
                QueryCommand dcmd = ActiveRecord <ItemType> .GetDeleteCommand(item.GetPrimaryKeyValue());

                if (dcmd != null)
                {
                    commands.Add(dcmd);
                }
            }

            return(commands);
        }