//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop

#include "PlanKlasse.h"
//---------------------------------------------------------------------------
bool Plan::HentListeOverPlaner(stack<string>& Stack)
{
    bool ok = true;
    string s;
    int n;

    if(Kilde == 'd')
      s = "select PlanID_P as PlanID from Plan";
    else
      s = "PlanListe2.txt";

    if(db->StartIndlaesning(s))
    {
      while(ok && db->FindString(PlanID, "PlanID"))
      {
        Stack.push(PlanID);
        ok = db->FindNaeste();
      }
      return true;
    }
    return false;
}
bool Plan::VaelgPlan(const string& PlanID, string& TimeFagFordelingsID, int& col, int& row)
{
    string s;

    if(Kilde == 'd')
      s = "select TimeFagFordelingID_P AS TFF, Kolonne_P as c, Raekke_P as r from Plan where PlanID_P ='" + PlanID + "'";
    else
      s = "PlanListe3.txt";

    if(db->StartIndlaesning(s) &&
       db->FindString(TimeFagFordelingsID, "TFF") &&
       db->FindInt(col, "c") && db->FindInt(row, "r"))
      return true; 
    return false;
}