Unit9.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:49k
- unit Unit9;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, ExtCtrls, DBCtrls, ComCtrls, Mask, Grids,
- DBGrids, DB, DBTables;
- type
- Treadproform = class(TForm)
- PageControl2: TPageControl;
- TabSheet4: TTabSheet;
- TabSheet5: TTabSheet;
- Label1: TLabel;
- Label2: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- DBMemo1: TDBMemo;
- DBEdit1: TDBEdit;
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- DBMemo2: TDBMemo;
- DBEdit2: TDBEdit;
- DBEdit3: TDBEdit;
- DBEdit4: TDBEdit;
- DBEdit5: TDBEdit;
- DBRadioGroup1: TDBRadioGroup;
- TabSheet2: TTabSheet;
- Label10: TLabel;
- Label11: TLabel;
- Label12: TLabel;
- Label13: TLabel;
- Label14: TLabel;
- DBMemo3: TDBMemo;
- DBEdit8: TDBEdit;
- DBEdit9: TDBEdit;
- DBEdit10: TDBEdit;
- DBEdit11: TDBEdit;
- DBRadioGroup2: TDBRadioGroup;
- TabSheet3: TTabSheet;
- Label15: TLabel;
- Label16: TLabel;
- Label17: TLabel;
- Label18: TLabel;
- Label19: TLabel;
- DBMemo4: TDBMemo;
- DBEdit12: TDBEdit;
- DBEdit13: TDBEdit;
- DBEdit14: TDBEdit;
- DBEdit15: TDBEdit;
- DBRadioGroup3: TDBRadioGroup;
- DBEdit6: TDBEdit;
- // DBEdit7: TDBEdit;
- Panel1: TPanel;
- DBNavigator1: TDBNavigator;
- BitBtn1: TBitBtn;
- DBGrid1: TDBGrid;
- DBMemo5: TDBMemo;
- DBMemo6: TDBMemo;
- DBMemo7: TDBMemo;
- DBMemo8: TDBMemo;
- Query1: TQuery;
- DBNavigator2: TDBNavigator;
- DataSource1: TDataSource;
- TreeView1: TTreeView;
- BitBtn2: TBitBtn;
- BitBtn3: TBitBtn;
- Query2: TQuery;
- DBComboBox1: TDBComboBox;
- Label20: TLabel;
- Label21: TLabel;
- Label22: TLabel;
- Label23: TLabel;
- Label24: TLabel;
- function checknewreadpro:boolean;
- procedure DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
- procedure FormActivate(Sender: TObject);
- procedure TabSheet4Show(Sender: TObject);
- procedure TabSheet5Show(Sender: TObject);
- procedure TreeView1Click(Sender: TObject);
- procedure BitBtn3Click(Sender: TObject);
- procedure BitBtn2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure TreeView1MouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
- procedure DBEdit1Change(Sender: TObject);
- private
- { Private declarations }
- public
- temp:integer;
- { Public declarations }
- end;
- var
- readproform: Treadproform;
- addreadpro:boolean;
- implementation
- uses Unit4, Unit3;
- {$R *.dfm}
- function Treadproform.checknewreadpro:boolean;
- var
- success:boolean;
- begin
- success:=true;
- with DataModule4.Table_readpro do
- begin
- if DBEdit1.Text='' then
- success:=false;
- if DBEdit2.Text='' then
- success:=false;
- if DBEdit3.Text='' then
- success:=false;
- if DBEdit4.Text='' then
- success:=false;
- if DBEdit5.Text='' then
- success:=false;
- if DBComboBox1.Text='' then
- success:=false;
- if DBMemo1.Text='' then
- success:=false;
- if DBMemo2.Text='' then
- success:=false;
- if DBRadioGroup1.Value='' then
- success:=false;
- //if DBRadioGroup1.
- //if DBRadioGroup1.
- if not success then
- begin
- showmessage('红色项必须填写,请补上未填的红色项!');
- end;
- checknewreadpro:=success;
- end;
- end;
- procedure Treadproform.DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
- begin
- DBMemo1.DataSource:=DataModule4.DataSource_readpro;
- DBEdit1.DataSource:=DataModule4.DataSource_readpro;
- DBEdit6.DataSource:=DataModule4.DataSource_readpro ;
- DBComboBox1.DataSource:=DataModule4.DataSource_readpro;
- DBMemo2.DataSource:=DataModule4.DataSource_readpro;
- DBEdit2.DataSource:=DataModule4.DataSource_readpro;
- DBEdit3.DataSource:=DataModule4.DataSource_readpro ;
- DBEdit4.DataSource:=DataModule4.DataSource_readpro;
- DBEdit5.DataSource:=DataModule4.DataSource_readpro;
- DBRadioGroup1.DataSource:=DataModule4.DataSource_readpro;
- DBMemo3.DataSource:=DataModule4.DataSource_readpro;
- DBEdit8.DataSource:=DataModule4.DataSource_readpro ;
- DBEdit9.DataSource:=DataModule4.DataSource_readpro;
- DBEdit10.DataSource:=DataModule4.DataSource_readpro;
- DBEdit11.DataSource:=DataModule4.DataSource_readpro;
- DBRadioGroup2.DataSource:=DataModule4.DataSource_readpro;
- DBMemo4.DataSource:=DataModule4.DataSource_readpro;
- DBEdit12.DataSource:=DataModule4.DataSource_readpro ;
- DBEdit13.DataSource:=DataModule4.DataSource_readpro;
- DBEdit14.DataSource:=DataModule4.DataSource_readpro;
- DBEdit15.DataSource:=DataModule4.DataSource_readpro;
- DBRadioGroup3.DataSource:=DataModule4.DataSource_readpro;
- // DBEdit4.DataSource:=DataModule4.DataSource_filltext;
- // DBEdit5.DataSource:=DataModule4.DataSource_filltext;
- // DBEdit6.DataSource:=DataModule4.DataSource_filltext ;
- // DBRadioGroup1.DataSource:=DataModule4.DataSource_judge ;
- case button of
- nbDelete:
- begin
-
- if Treeview1.Focused=false then
- begin
- DBNavigator2.BtnClick(nbCancel);
- showmessage('请选择一个章节点') ;
- DBNavigator2.BtnClick(nbCancel);
- DBNavigator2.Enabled:=false;
- end
- else
-
- query2.close;
- query2.sql.clear;
- query2.sql.text:='delete ti_readpro where tno='''+inttostr(mainform.updateno)+''' ';
- query2.ExecSQL;
- query2.close;
- query2.sql.clear;
- query2.sql.text:='update ti_readpro set tno=tno-1 where tno>'''+inttostr(mainform.updateno)+''' and tno like '''+inttostr(mainform.updateno div 10)+'%''';
- query2.ExecSQL;
- DBNavigator2.DataSource:=DataModule4.DataSource_readpro;
- showmessage(inttostr(DataModule4.Table_readpro.FieldValues['tno']));
- end;
- end;
- case button of
- nbInsert:
- begin
- addreadpro:=true;
- if Treeview1.Focused=false then
- begin
- showmessage('请选择一个章节点') ;
- DBNavigator2.BtnClick(nbCancel);
- DBNavigator2.Enabled:=false;
- end
- else
- if treeview1.Focused=true then
- begin
- DBNavigator2.Enabled:=false;
- if (temp mod 10)=0 then
- begin
- showmessage('本章知识点已满!');
- DBNavigator2.BtnClick(nbCancel);
- end
- else
- begin
- DBEdit1.text:=inttostr(temp);
- end;
- end;
- end;
- end;
- case button of
- nbPost:
- begin
- DataModule4.Table_readpro.Close;
- DataModule4.Table_readpro.Open;
- end;
- end;
- end;
- procedure Treadproform.FormActivate(Sender: TObject);
- begin
- DBNavigator1.DataSource:=DataModule4.DataSource_readpro;
- DBNavigator2.Enabled:=false;
- end;
- procedure Treadproform.TabSheet4Show(Sender: TObject);
- begin
- DBNavigator2.Enabled:=true;
- DBNavigator2.DataSource:=DataModule4.DataSource_readpro;
- end;
- procedure Treadproform.TabSheet5Show(Sender: TObject);
- begin
- DBNavigator2.Enabled:=false;
- DBNavigator1.DataSource:=DataModule4.DataSource_readpro;
- end;
- procedure Treadproform.TreeView1Click(Sender: TObject);
- begin
- {
- if TreeView1.Selected.text='C语言' then //总节点
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose');
- query1.Open;
- end;
- end; }
- {
- if TreeView1.Selected.text='第一章 C语言基础知识' then //第一章
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''1%%%''');
- query1.Open;
- end;
- end;
- }
- {
- if TreeView1.Selected.text='第一节' then //第一章第一节
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''11%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 C语言的特点' then //第一章第一节第一知识点
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''111%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=1111;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节' then //第一章第二节
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''12%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 C语言的标识符和保留字' then //第一章第二节第一知识点
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''121%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=1211;
- end;
- end;
- end;
- end;
- {
-
- if TreeView1.Selected.text='第三节' then //第一章第三节
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''13%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 C程序的结构' then //第一章第三节第一知识点
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''131%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=1311;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第四节' then //第一章第四节
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''14%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 C程序的开发过程' then //第一章第四节第一知识点
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''141%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=1411;
- end;
- end;
- end;
- end;
- //-----------------------------------------------------------------
- {
- if TreeView1.Selected.text='第二章 数据类型、运算符与表达式' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''2%%%''');
- query1.Open;
- end;
- end;
- }
- {
- if TreeView1.Selected.text='第一节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''21%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 C语言数据类型' then //第二章第一节第一知识点
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''211%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2111;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 整型数据' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''212%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2121;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第三知识点 实型数据' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''213%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2131;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第四知识点 字符型数据' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''214%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2141;
- end;
- end;
- end;
- end;
- //---------------------------------------
- {
- if TreeView1.Selected.text='第二节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''22%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 运算符' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''221%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2211;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 位运算' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''222%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2221;
- end;
- end;
- end;
- end;
- //-----------------------------------
- {
- if TreeView1.Selected.text='第三节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''23%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 表达式' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''231%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2311;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 类型转换' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''232%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=2321;
- end;
- end;
- end;
- end;
- //-------------------------------------------------------------
- {
- if TreeView1.Selected.text='第三章 顺序结构' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''3%%%''');
- query1.Open;
- end;
- end;
- if TreeView1.Selected.text='第一节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''31%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 字符数据的输入输出' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''311%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=3111;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''32%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 格式输入与输出' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''321%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=3211;
- end;
- end;
- end;
- end;
- //------------------------------------------------------------
- {
- if TreeView1.Selected.text='第四章 选择结构 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''4%%%''');
- query1.Open;
- end;
- end;
- }
- {
- if TreeView1.Selected.text='第一节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''41%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 if语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''411%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=4111;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''42%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 条件表达式' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''421%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=4211;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第三节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''43%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 switch(开关)语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''431%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=4311;
- end;
- end;
- end;
- end;
- //-------------------------------------------------------
- {
- if TreeView1.Selected.text='第五章 循环控制 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''5%%%''');
- query1.Open;
- end;
- end;
- if TreeView1.Selected.text='第一节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''51%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 while循环语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''511%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=5111;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 do-while循环语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''512%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=5121;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''52%%''');
- query1.Open;
- end;
- end;
- }
- if TreeView1.Selected.text='第一知识点 for循环语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''521%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=5211;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第三节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''53%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 break语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''531%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=5311;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 continue语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''532%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=5321;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第四节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_filltext where tno like ''54%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 goto语句' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''541%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=5411;
- end;
- end;
- end;
- end;
- //-----------------------------------------------------
- {
- if TreeView1.Selected.text='第六章 数组指针 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''6%%%''');
- query1.Open;
- end;
- end;
- if TreeView1.Selected.text='第一节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''61%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 一维数组' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''611%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6111;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 二维数组' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''612%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6121;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第三知识点 字符数组' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''613%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6131;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''62%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 指针的说明和初始化' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''621%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6211;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 指针运算' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''622%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6221;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第三知识点 一维数组和运算' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''623%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6231;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第四知识点 二维数组和运算' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''624%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6241;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第五知识点 字符指针和字符串' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''625%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6251;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第六知识点 多级指针' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''626%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6261;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第七知识点 指针型函数' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''627%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6271;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第八知识点 指向函数的指针' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''628%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=6281;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第七章 函数 结构体与共用体 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''7%%%''');
- query1.Open;
- end;
- end;
- if TreeView1.Selected.text='第一节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''71%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 函数设计' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''711%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7111;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 函数的存储类型' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''712%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7121;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第三知识点 变量的作用域和存储类型' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''713%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7131;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第四知识点 函数的数据传递' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''714%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7141;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第五知识点 数组在函数间的传递' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''715%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7151;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第六知识点 递归函数' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''716%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7161;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第七知识点 传递main()函数的参数' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''717%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7171;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''72%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 结构体定义和变量说明' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''721%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7211;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 结构体变量的引用和初始化' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''722%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7221;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第三知识点 结构体数组' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''723%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7231;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第四知识点 结构体指针' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''724%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7241;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第五知识点 函数之间结构体变量的数据传递' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''725%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7251;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第六知识点 结构体嵌套' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''726%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7261;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第七知识点 链表' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''727%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7271;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第八知识点 共用体' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''728%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7281;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第九知识点 枚举类型' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''729%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=7291;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第八章 预处理命令 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''8%%%''');
- query1.Open;
- end;
- end;
- if TreeView1.Selected.text='第一节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''81%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 宏' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''811%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=8111;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 条件编译' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''812%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=8121;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第三知识点 文件包含' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''813%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=8131;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''82%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 文件概述' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''821%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=8211;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第二知识点 文件的输入输出' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''822%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=8221;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第三知识点 文件的定位操作' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''823%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=8231;
- end;
- end;
- end;
- end;
- if TreeView1.Selected.text='第四知识点 文件的检测' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''824%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=8241;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第九章 常用算法设计 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''9%%%''');
- query1.Open;
- end;
- end;
- if TreeView1.Selected.text='第一节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''91%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 排序' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''911%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=9111;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第二节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''92%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 查找' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''921%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=9211;
- end;
- end;
- end;
- end;
- {
- if TreeView1.Selected.text='第三节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''93%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 枚举法' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''931%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=9311;
- end;
- end;
- end;
- end; {
- if TreeView1.Selected.text='第四节 ' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_choose where tno like ''94%%''');
- query1.Open;
- end;
- end; }
- if TreeView1.Selected.text='第一知识点 递归法' then
- begin
- query1.Active:=false;
- query1.Active:=true;
- if(query1.Active=true)then
- begin
- query1.Close;
- query1.SQL.Clear;
- query1.SQL.Add('select * from ti_readpro where tno like ''941%'' order by tno');
- query1.Open;
- begin
- if query1.RecordCount<>0 then
- begin
- query1.Last;
- temp:=query1.FieldValues['tno']+1;
- end
- else if query1.RecordCount=0 then
- begin
- temp:=9411;
- end;
- end;
- end;
- end;
- DBMemo1.DataSource:=DataSource1;
- DBEdit1.DataSource:=DataSource1;
- DBEdit6.DataSource:=DataSource1 ;
- DBComboBox1.DataSource:=DataSource1;
- DBMemo2.DataSource:=DataSource1;
- DBEdit2.DataSource:=DataSource1;
- DBEdit3.DataSource:=DataSource1 ;
- DBEdit4.DataSource:=DataSource1;
- DBEdit5.DataSource:=DataSource1;
- DBRadioGroup1.DataSource:=DataSource1;
- DBMemo3.DataSource:=DataSource1;
- DBEdit8.DataSource:=DataSource1 ;
- DBEdit9.DataSource:=DataSource1;
- DBEdit10.DataSource:=DataSource1;
- DBEdit11.DataSource:=DataSource1;
- DBRadioGroup2.DataSource:=DataSource1;
- DBMemo4.DataSource:=DataSource1;
- DBEdit12.DataSource:=DataSource1 ;
- DBEdit13.DataSource:=DataSource1;
- DBEdit14.DataSource:=DataSource1;
- DBEdit15.DataSource:=DataSource1;
- DBRadioGroup3.DataSource:=DataSource1;
- DBNavigator1.DataSource:=DataSource1;
- end;
- procedure Treadproform.BitBtn3Click(Sender: TObject);
- begin
- DBNavigator2.BtnClick(nbCancel);
- end;
- procedure Treadproform.BitBtn2Click(Sender: TObject);
- begin
- if addreadpro then
- begin
- if checknewreadpro then
- begin
- DataModule4.Table_readpro.Post;
- DataModule4.Table_readpro.Close;
- DataModule4.Table_readpro.Open;
- showmessage('添加成功!');
- addreadpro:=false;
- // inc(newshijuanhao);
- // DataModule4.Table_shijuan.UpdateRecord;
- // DBNavigator1.CanFocus;
- DBNavigator2.Enabled:=true;
- end
- else
- exit;
- end;
- end;
- procedure Treadproform.FormCreate(Sender: TObject);
- begin
- addreadpro:=false;
- end;
- procedure Treadproform.TreeView1MouseDown(Sender: TObject;
- Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- DBNavigator2.Enabled:=true;
- end;
- procedure Treadproform.DBNavigator1Click(Sender: TObject;
- Button: TNavigateBtn);
- begin
- case button of
- nbFirst:
- begin
- DataModule4.Table_readpro.First;
- end;
- end;
- end;
- procedure Treadproform.DBEdit1Change(Sender: TObject);
- begin
- if DBEdit1.Text='' then
- begin
- DBNavigator2.VisibleButtons:=[nbInsert];
- DBNavigator2.Width:=28;
- end;
- if DBEdit1.Text<>'' then
- begin
- DBNavigator2.Width:=56;
- DBNavigator2.VisibleButtons:=[nbInsert,nbDelete];
- end;
- end;
- end.