unit unitHouseparentSched;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, Buttons, ExtCtrls;

type
  THouseparentInfo = class(TForm)
    PageControl2: TPageControl;
    TabSheet2: TTabSheet;
    GroupBox3: TGroupBox;
    txtSearch1: TEdit;
    BitBtn1: TBitBtn;
    btnNew: TBitBtn;
    lvHouseparent: TListView;
    TabSheet4: TTabSheet;
    GroupBox2: TGroupBox;
    txtSearch: TEdit;
    btnGo: TBitBtn;
    lvSched: TListView;
    PageControl3: TPageControl;
    TabSheet3: TTabSheet;
    cmbBldg: TComboBox;
    txtLName: TEdit;
    txtFName: TEdit;
    Label4: TLabel;
    Label3: TLabel;
    Label6: TLabel;
    cboMon: TComboBox;
    cboTue: TComboBox;
    cboWed: TComboBox;
    cboThu: TComboBox;
    cboFri: TComboBox;
    Label1: TLabel;
    Label2: TLabel;
    Label5: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    cboSat: TComboBox;
    cboSun: TComboBox;
    btnCancel: TBitBtn;
    btnSave: TBitBtn;
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    lvTimeSched: TListView;
    StatusBar2: TStatusBar;
    btnCreate: TBitBtn;
    procedure btnCreateClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
   
  end;

var
  HouseparentInfo: THouseparentInfo;

implementation

{$R *.dfm}




procedure THouseparentInfo.btnCreateClick(Sender: TObject);
begin
      frmScheduling.ShowModal;
end;

procedure THouseparentInfo.FormShow(Sender: TObject);
begin
      
end;

end.



if DataModule1.tr.InTransaction then
          DataModule1.tr.Commit;

          DataModule1.query.SQL.Clear;
          DataModule1.query.SQL.Add('SELECT time_id from hp_schedule where par_id = :a');
          DataModule1.query.Params.AsString[0] := '50';
          DataModule1.query.Prepare;
          DataModule1.query.Open();
          lvSched.Columns.BeginUpdate;
          lvSched.Columns.Clear;

              if DataModule1.query.Fields.IsNull[0] then Exit;
                while not DataModule1.query.Eof do begin


                 //  lvSched.Columns.Add;

                    lvSched.Columns.Add.Caption := DataModule1.query.Fields.AsString[0];



                    lvSched.Columns.Add.Caption := DataModule1.query.Fields.AsString[1];
                //   name := lvSched.Columns.Add;
                 //  name.Columns.Add.Caption := DataModule1.query.Fields.AsString[0];
                    DataModule1.query.Next;
                    end;
                    if DataModule1.tr.InTransaction then
                      DataModule1.tr.Commit;

                      lvSched.Columns.EndUpdate;
