Exemplo n.º 1
0
        /// <summary>
        /// Refreshes the UserAccounts static property with the UserAccounts that are associated with
        /// the simulation identified by the supplied simId.
        /// </summary>
        /// <param name="simId">A long value containing the simulation id to compare user accounts against.</param>
        public static void refreshUserAccountPool(long simId)
        {
            if (MySqlHelper.connect() == false) return;

            DBConnection dbCon = MySqlHelper.dbCon;
            ArrayList response = dbCon.selectQuery(
                "SELECT * FROM tblUserAccount AS ua WHERE ua.id = (SELECT uap.user_id FROM tblUserAccountPool AS uap WHERE uap.user_id=ua.id AND uap.sim_id=" + simId + ")");

            MySqlHelper.disconnect();

            UserAccounts.Clear();

            foreach (ArrayList arrayList in response)
                UserAccounts.Add(fromArrayList(arrayList));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Refreshes the UserAccounts static property with the all UserAccounts that are Stations
        /// and not already bound to a simulation.
        /// </summary>
        public static void refreshUserAccounts()
        {
            if (MySqlHelper.connect() == false) return;

            DBConnection dbCon = MySqlHelper.dbCon;
            ArrayList response = dbCon.selectQuery(
                "SELECT * FROM tblUserAccount AS ua WHERE 0 = (SELECT COUNT(uap.user_id) FROM tblUserAccountPool AS uap WHERE uap.user_id=ua.id) AND ua.type=1");

            MySqlHelper.disconnect();

            UserAccounts.Clear();

            foreach (ArrayList arrayList in response)
                UserAccounts.Add(fromArrayList(arrayList));
        }