/// <summary>
        /// Gets the list of guids of busy markets.
        /// 
        /// Returns the guids for those markets with submissions at them. This is used to exclude them from the marketlist filter
        /// </summary>
        /// <returns>
        /// The list of guids of busy markets.
        /// </returns>
        public static List<string> GetListOfGuidsOfBusyMarkets(LayoutPanelBase CurrentLayout)
        {
            List<string> BusyMarkets = new List<string> ();
            List<string> result = CurrentLayout.GetListOfStringsFromSystemTable (TABLE_ReplyTypes, 1, String.Format ("2|{0}", CODE_NO_REPLY_YET), false);
            if (result != null && result.Count > 0) {
                List<TransactionBase> allsubs = LayoutDetails.Instance.TransactionsList.GetEventsForLayoutGuid
                    ("*", String.Format (" and data7='{0}' and {1}='{2}'", result[0], TransactionsTable.TYPE,  TransactionSubmission.T_SUBMISSION));

                // this should give us a list of EVERY submission that has not received a VALID REPLY.
                // HENCE> Every market on this list would be BUSY

                foreach (TransactionBase sub in allsubs) {
                //	if (sub is TransactionSubmission)
                    {
                //		NewMessage.Show ("Adding " + sub.Display);
                    BusyMarkets.Add (((TransactionSubmission)sub).MarketGuid);
                    }
            //					else
            //					{
            //						NewMessage.Show ("Not adding " + sub.Display);
            //					}
                }
            }
            return BusyMarkets;
        }
 /// <summary>
 /// Returns the number of acceptances
 /// </summary>
 /// <returns>
 /// The acceptances.
 /// </returns>
 public static int CountAcceptances(LayoutPanelBase CurrentLayout, string ProjectGUID)
 {
     int count = 0;
     string filter= "";
     List<string> result = CurrentLayout.GetListOfStringsFromSystemTable (TABLE_ReplyTypes, 1, String.Format ("2|{0}", CODE_ACCEPTANCE), false);
     if (result != null && result.Count > 0) {
         foreach (string s in result)
         {
             string SPACE ="";
             if (filter != "")
             {
                 SPACE = " or ";
             }
             filter = filter + SPACE + String.Format ("data7='{0}'", s);
         }
         //NewMessage.Show (filter);
         List<TransactionBase> allsubs = LayoutDetails.Instance.TransactionsList.GetEventsForLayoutGuid
             ("*",String.Format(" and ({0}) and {1}='{2}' and {3}='{4}'", filter, TransactionsTable.TYPE,  TransactionSubmission.T_SUBMISSION,
                                TransactionsTable.DATA1_LAYOUTGUID, ProjectGUID));
         if (allsubs != null)
         {
             count = allsubs.Count;
         }
     }
     return count;
 }