Esempio n. 1
0
        public PyDataType GetMembers(int corporationID, int startPos, int limit, SparseRowsetHeader header, Dictionary <PyDataType, int> rowsIndex)
        {
            // TODO: GENERATE PROPER FIELDS FOR THE FOLLOWING FIELDS
            // TODO: titleMask, grantableRoles, grantableRolesAtHQ, grantableRolesAtBase, grantableRolesAtOther
            // TODO: divisionID, squadronID
            // TODO: CHECK IF THIS startDateTime IS THE CORP'S MEMBERSHIP OR CHARACTER'S MEMBERSHIP
            MySqlConnection connection = null;
            MySqlDataReader reader     = Database.PrepareQuery(ref connection,
                                                               "SELECT" +
                                                               " characterID, title, startDateTime, corpRole AS roles, rolesAtHQ, rolesAtBase, rolesAtOther," +
                                                               " titleMask, 0 AS grantableRoles, 0 AS grantableRolesAtHQ, 0 AS grantableRolesAtBase," +
                                                               " 0 AS grantableRolesAtOther, 0 AS divisionID, 0 AS squadronID, 0 AS baseID, " +
                                                               " 0 AS blockRoles, gender " +
                                                               "FROM chrInformation " +
                                                               "WHERE corporationID=@corporationID " +
                                                               "LIMIT @startPos,@limit",
                                                               new Dictionary <string, object>()
            {
                { "@corporationID", corporationID },
                { "@startPos", startPos },
                { "@limit", limit }
            }
                                                               );

            using (connection)
                using (reader)
                {
                    return(header.DataFromMySqlReader(0, reader, rowsIndex));
                }
        }
Esempio n. 2
0
        public PyDataType GetMembers(PyList characterIDs, int corporationID, SparseRowsetHeader header, Dictionary <PyDataType, int> rowsIndex)
        {
            // TODO: GENERATE PROPER FIELDS FOR THE FOLLOWING FIELDS
            // TODO: titleMask, grantableRoles, grantableRolesAtHQ, grantableRolesAtBase, grantableRolesAtOther
            // TODO: divisionID, squadronID
            // TODO: CHECK IF THIS startDateTime IS THE CORP'S MEMBERSHIP OR CHARACTER'S MEMBERSHIP

            Dictionary <string, object> parameters = new Dictionary <string, object>();

            string query = "SELECT" +
                           " characterID, title, startDateTime, corpRole AS roles, rolesAtHQ, rolesAtBase, rolesAtOther," +
                           " titleMask, 0 AS grantableRoles, 0 AS grantableRolesAtHQ, 0 AS grantableRolesAtBase," +
                           " 0 AS grantableRolesAtOther, 0 AS divisionID, 0 AS squadronID, 0 AS baseID, " +
                           " 0 AS blockRoles, gender " +
                           "FROM chrInformation " +
                           "WHERE corporationID=@corporationID AND characterID IN (";

            foreach (PyDataType id in characterIDs)
            {
                parameters["@characterID" + parameters.Count.ToString("X")] = (int)(id as PyInteger);
            }

            // prepare the correct list of arguments
            query += String.Join(',', parameters.Keys) + ")";

            parameters["@corporationID"] = corporationID;
            MySqlConnection connection = null;
            MySqlDataReader reader     = Database.PrepareQuery(ref connection, query, parameters);

            using (connection)
                using (reader)
                {
                    return(header.DataFromMySqlReader(0, reader, rowsIndex));
                }
        }
Esempio n. 3
0
        public PyDataType GetOffices(PyList itemIDs, int corporationID, SparseRowsetHeader header, Dictionary <PyDataType, int> rowsIndex)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            string query = "SELECT" +
                           " itemID, stationID, typeID, officeFolderID " +
                           "FROM chrInformation " +
                           "LEFT JOIN invItems ON invItems.itemID = chrInformation.activeCloneID " +
                           "WHERE corporationID=@corporationID AND itemID IN (";

            foreach (PyDataType id in itemIDs)
            {
                parameters["@itemID" + parameters.Count.ToString("X")] = (int)(id as PyInteger);
            }

            // prepare the correct list of arguments
            query += String.Join(',', parameters.Keys) + ")";

            parameters["@corporationID"] = corporationID;

            // TODO: GENERATE PROPER FIELDS FOR THE FOLLOWING FIELDS
            // TODO: titleMask, grantableRoles, grantableRolesAtHQ, grantableRolesAtBase, grantableRolesAtOther
            // TODO: divisionID, squadronID
            // TODO: CHECK IF THIS startDateTime IS THE CORP'S MEMBERSHIP OR CHARACTER'S MEMBERSHIP
            MySqlConnection connection = null;
            MySqlDataReader reader     = Database.PrepareQuery(ref connection, query, parameters);

            using (connection)
                using (reader)
                {
                    return(header.DataFromMySqlReader(0, reader, rowsIndex));
                }
        }
Esempio n. 4
0
        public PyDataType GetOffices(int corporationID, int startPos, int limit, SparseRowsetHeader header, Dictionary <PyDataType, int> rowsIndex)
        {
            MySqlConnection connection = null;
            MySqlDataReader reader     = Database.PrepareQuery(ref connection,
                                                               "SELECT" +
                                                               " itemID, stationID, typeID, officeFolderID " +
                                                               "FROM crpOffices " +
                                                               "WHERE corporationID=@corporationID " +
                                                               "LIMIT @startPos,@limit",
                                                               new Dictionary <string, object>()
            {
                { "@corporationID", corporationID },
                { "@startPos", startPos },
                { "@limit", limit }
            }
                                                               );

            using (connection)
                using (reader)
                {
                    return(header.DataFromMySqlReader(0, reader, rowsIndex));
                }
        }