Example #1
0
        /// <summary>
        /// Execute list logic on a pair of persisted list objects & store results in current list for user
        /// </summary>
        /// <param name="list1InternalName"></param>
        /// <param name="list2InternalName"></param>
        /// <param name="op"></param>
        /// <returns>Number of results from logic operation</returns>

        public static int ExecuteListLogic(
            string list1InternalName,
            string list2InternalName,
            ListLogicType op)
        {
            CidList list1 = Read(list1InternalName);

            if (list1 == null)
            {
                throw new Exception("List not found: " + list1InternalName);
            }

            CidList list2 = Read(list2InternalName);

            if (list2 == null)
            {
                throw new Exception("List not found: " + list2InternalName);
            }

            list1.ApplyListLogic(list2, op);

            CidListDao.Write(list1, "Current");             // write new current list
            return(list1.Count);
        }