#pragma once

#include <vector>
#include "DllDefines.h"

#include <ado2.h>
#include <structure.h>

class MCCTRDLLCLASS CModuleRS
{
public:
    // Field/Param Data
    long m_ID{ 0 };
    std::string m_Module_Name{ "" };

public:
    ~CModuleRS();

    std::string GetDefaultDBName(); // Default database name
    std::string GetDefaultSQL();    // Default SQL for Recordset


    //  Close Recordset and close database
    void Close();

    int InitModule(std::vector<stModule>& modules);

private:
    bool Open(std::string sqlQuery);
    void GetAllFieldsValue();

    CADODatabase m_db;
    CADORecordset m_rs;
};
