public bool CreatePayment(string activityType, IMember thisMember, IActivity activity)
 {
     string realTtype = activityType.ToLower();
     if (realTtype == "sale")
     {
         ISale thisSale = activity as ISale;
         IPayment thisPayment = new Payment(thisSale, thisMember);
         thisPayment = PaymentPersistence.CreatePayment(thisPayment);
         if (thisPayment != null)
         {
             thisSale.PaymentList.Add(thisPayment);
             thisMember.PaymentList.Add(thisPayment);
             paymentList.Add(thisPayment);
             return true;
         }
     }
     else if (realTtype == "event")
     {
         IEvent thisEvent = activity as IEvent;
         IPayment thisPayment = new Payment(thisEvent, thisMember);
         thisPayment = PaymentPersistence.CreatePayment(thisPayment);
         if (thisPayment != null)
         {
             thisEvent.PaymentList.Add(thisPayment);
             thisMember.PaymentList.Add(thisPayment);
             paymentList.Add(thisPayment);
             return true;
         }
     }
     else if (realTtype == "team")
     {
         ITeam thisTeam = activity as ITeam;
         IPayment thisPayment = new Payment(thisTeam, thisMember);
         thisPayment = PaymentPersistence.CreatePayment(thisPayment);
         if (thisPayment != null)
         {
             thisTeam.PaymentList.Add(thisPayment);
             thisMember.PaymentList.Add(thisPayment);
             paymentList.Add(thisPayment);
             return true;
         }
     }
     return false;
 }
        public static List<IPayment> RetrievePayments()
        {
            List<IPayment> paymentList = new List<IPayment>();

            if (Connect())
            {
                try
                {
                    SqlCommand Command = Connection.CreateCommand();
                    Command.CommandType = CommandType.StoredProcedure;
                    Command.CommandText = "fif_payment_retrieve";

                    SqlDataReader dataReader = Command.ExecuteReader();

                    while (dataReader.Read())
                    {
                        int paymentId = int.Parse(dataReader["payment_id"].ToString());
                        int memberId = int.Parse(dataReader["member_id"].ToString());
                        int activityId = int.Parse(dataReader["activity_id"].ToString());
                        string activityType = dataReader["activity_type"].ToString();
                        DateTime date = DateTime.Parse(dataReader["date"].ToString());

                        IPayment thisPayment = new Payment(paymentId, memberId, activityId, activityType, date);

                        paymentList.Insert(0, thisPayment);
                    }
                    Disconnect();
                    return paymentList;
                }
                catch
                {
                    Disconnect();
                    return null;
                }
            }
            return null;
        }