Пример #1
0
        /// <summary>
        /// Remove synced orders from current OrderList and SyncList simultaneously
        /// </summary>
        public static string RemoveSyncedOrders()
        {
            string removedItems = "";

            // Remove synced items from orders
            for (int i = OrderList.Count - 1; i >= 0; i--)
            {
                if (SyncList.Count(x => x.Contains(OrderList[i].OrderID) && x.Contains("[OR_SY_]=1")) > 0)
                {
                    removedItems += OrderList[i].OrderID + ", ";
                    OrderList.RemoveAt(i);
                }
            }

            // Remove synced items from SyncList
            SyncList = SyncList.Where(x => !x.Contains("[OR_SY_]=1")).ToList();

            return(removedItems);
        }