Unit9.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:49k
源码类别:

教育系统应用

开发平台:

Delphi

  1. unit Unit9;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, Buttons, ExtCtrls, DBCtrls, ComCtrls, Mask, Grids,
  6.   DBGrids, DB, DBTables;
  7. type
  8.   Treadproform = class(TForm)
  9.     PageControl2: TPageControl;
  10.     TabSheet4: TTabSheet;
  11.     TabSheet5: TTabSheet;
  12.     Label1: TLabel;
  13.     Label2: TLabel;
  14.     Label8: TLabel;
  15.     Label9: TLabel;
  16.     DBMemo1: TDBMemo;
  17.     DBEdit1: TDBEdit;
  18.     PageControl1: TPageControl;
  19.     TabSheet1: TTabSheet;
  20.     Label3: TLabel;
  21.     Label4: TLabel;
  22.     Label5: TLabel;
  23.     Label6: TLabel;
  24.     Label7: TLabel;
  25.     DBMemo2: TDBMemo;
  26.     DBEdit2: TDBEdit;
  27.     DBEdit3: TDBEdit;
  28.     DBEdit4: TDBEdit;
  29.     DBEdit5: TDBEdit;
  30.     DBRadioGroup1: TDBRadioGroup;
  31.     TabSheet2: TTabSheet;
  32.     Label10: TLabel;
  33.     Label11: TLabel;
  34.     Label12: TLabel;
  35.     Label13: TLabel;
  36.     Label14: TLabel;
  37.     DBMemo3: TDBMemo;
  38.     DBEdit8: TDBEdit;
  39.     DBEdit9: TDBEdit;
  40.     DBEdit10: TDBEdit;
  41.     DBEdit11: TDBEdit;
  42.     DBRadioGroup2: TDBRadioGroup;
  43.     TabSheet3: TTabSheet;
  44.     Label15: TLabel;
  45.     Label16: TLabel;
  46.     Label17: TLabel;
  47.     Label18: TLabel;
  48.     Label19: TLabel;
  49.     DBMemo4: TDBMemo;
  50.     DBEdit12: TDBEdit;
  51.     DBEdit13: TDBEdit;
  52.     DBEdit14: TDBEdit;
  53.     DBEdit15: TDBEdit;
  54.     DBRadioGroup3: TDBRadioGroup;
  55.     DBEdit6: TDBEdit;
  56.   //  DBEdit7: TDBEdit;
  57.     Panel1: TPanel;
  58.     DBNavigator1: TDBNavigator;
  59.     BitBtn1: TBitBtn;
  60.     DBGrid1: TDBGrid;
  61.     DBMemo5: TDBMemo;
  62.     DBMemo6: TDBMemo;
  63.     DBMemo7: TDBMemo;
  64.     DBMemo8: TDBMemo;
  65.     Query1: TQuery;
  66.     DBNavigator2: TDBNavigator;
  67.     DataSource1: TDataSource;
  68.     TreeView1: TTreeView;
  69.     BitBtn2: TBitBtn;
  70.     BitBtn3: TBitBtn;
  71.     Query2: TQuery;
  72.     DBComboBox1: TDBComboBox;
  73.     Label20: TLabel;
  74.     Label21: TLabel;
  75.     Label22: TLabel;
  76.     Label23: TLabel;
  77.     Label24: TLabel;
  78.     function checknewreadpro:boolean;
  79.     procedure DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
  80.     procedure FormActivate(Sender: TObject);
  81.     procedure TabSheet4Show(Sender: TObject);
  82.     procedure TabSheet5Show(Sender: TObject);
  83.     procedure TreeView1Click(Sender: TObject);
  84.     procedure BitBtn3Click(Sender: TObject);
  85.     procedure BitBtn2Click(Sender: TObject);
  86.     procedure FormCreate(Sender: TObject);
  87.     procedure TreeView1MouseDown(Sender: TObject; Button: TMouseButton;
  88.       Shift: TShiftState; X, Y: Integer);
  89.     procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
  90.     procedure DBEdit1Change(Sender: TObject);
  91.   private
  92.     { Private declarations }
  93.   public
  94.   temp:integer;
  95.     { Public declarations }
  96.   end;
  97. var
  98.   readproform: Treadproform;
  99.   addreadpro:boolean;
  100. implementation
  101. uses Unit4, Unit3;
  102. {$R *.dfm}
  103. function Treadproform.checknewreadpro:boolean;
  104. var
  105. success:boolean;
  106. begin
  107. success:=true;
  108. with DataModule4.Table_readpro do
  109. begin
  110. if DBEdit1.Text='' then
  111. success:=false;
  112. if DBEdit2.Text='' then
  113. success:=false;
  114.  if DBEdit3.Text='' then
  115. success:=false;
  116. if DBEdit4.Text='' then
  117. success:=false;
  118. if DBEdit5.Text='' then
  119. success:=false;
  120. if DBComboBox1.Text='' then
  121. success:=false;
  122. if DBMemo1.Text='' then
  123. success:=false;
  124. if DBMemo2.Text='' then
  125. success:=false;
  126. if DBRadioGroup1.Value='' then
  127. success:=false;
  128. //if DBRadioGroup1.
  129. //if DBRadioGroup1.
  130. if not success then
  131. begin
  132. showmessage('红色项必须填写,请补上未填的红色项!');
  133. end;
  134.   checknewreadpro:=success;
  135. end;
  136. end;
  137. procedure Treadproform.DBNavigator2Click(Sender: TObject; Button: TNavigateBtn);
  138. begin
  139.  DBMemo1.DataSource:=DataModule4.DataSource_readpro;
  140.   DBEdit1.DataSource:=DataModule4.DataSource_readpro;
  141.   DBEdit6.DataSource:=DataModule4.DataSource_readpro ;
  142.   DBComboBox1.DataSource:=DataModule4.DataSource_readpro;
  143.   DBMemo2.DataSource:=DataModule4.DataSource_readpro;
  144.   DBEdit2.DataSource:=DataModule4.DataSource_readpro;
  145.   DBEdit3.DataSource:=DataModule4.DataSource_readpro ;
  146.   DBEdit4.DataSource:=DataModule4.DataSource_readpro;
  147.    DBEdit5.DataSource:=DataModule4.DataSource_readpro;
  148.    DBRadioGroup1.DataSource:=DataModule4.DataSource_readpro;
  149.    DBMemo3.DataSource:=DataModule4.DataSource_readpro;
  150.   DBEdit8.DataSource:=DataModule4.DataSource_readpro ;
  151.   DBEdit9.DataSource:=DataModule4.DataSource_readpro;
  152.    DBEdit10.DataSource:=DataModule4.DataSource_readpro;
  153.     DBEdit11.DataSource:=DataModule4.DataSource_readpro;
  154.     DBRadioGroup2.DataSource:=DataModule4.DataSource_readpro;
  155.        DBMemo4.DataSource:=DataModule4.DataSource_readpro;
  156.   DBEdit12.DataSource:=DataModule4.DataSource_readpro ;
  157.   DBEdit13.DataSource:=DataModule4.DataSource_readpro;
  158.    DBEdit14.DataSource:=DataModule4.DataSource_readpro;
  159.     DBEdit15.DataSource:=DataModule4.DataSource_readpro;
  160.     DBRadioGroup3.DataSource:=DataModule4.DataSource_readpro;
  161. //  DBEdit4.DataSource:=DataModule4.DataSource_filltext;
  162.  // DBEdit5.DataSource:=DataModule4.DataSource_filltext;
  163. //  DBEdit6.DataSource:=DataModule4.DataSource_filltext ;
  164.  // DBRadioGroup1.DataSource:=DataModule4.DataSource_judge ;
  165.    case button of
  166.    nbDelete:
  167.    begin
  168.    
  169. if Treeview1.Focused=false then
  170. begin
  171. DBNavigator2.BtnClick(nbCancel);
  172. showmessage('请选择一个章节点') ;
  173.   DBNavigator2.BtnClick(nbCancel);
  174.   DBNavigator2.Enabled:=false;
  175. end
  176. else
  177.   
  178. query2.close;
  179. query2.sql.clear;
  180. query2.sql.text:='delete ti_readpro where tno='''+inttostr(mainform.updateno)+''' ';
  181. query2.ExecSQL;
  182. query2.close;
  183. query2.sql.clear;
  184. query2.sql.text:='update ti_readpro set tno=tno-1 where tno>'''+inttostr(mainform.updateno)+''' and tno like '''+inttostr(mainform.updateno div 10)+'%''';
  185. query2.ExecSQL;
  186. DBNavigator2.DataSource:=DataModule4.DataSource_readpro;
  187.   showmessage(inttostr(DataModule4.Table_readpro.FieldValues['tno']));
  188.    end;
  189.    end;
  190. case button of
  191. nbInsert:
  192. begin
  193. addreadpro:=true;
  194. if Treeview1.Focused=false then
  195. begin
  196. showmessage('请选择一个章节点') ;
  197.   DBNavigator2.BtnClick(nbCancel);
  198.    DBNavigator2.Enabled:=false;
  199. end
  200. else
  201. if treeview1.Focused=true then
  202. begin
  203.  DBNavigator2.Enabled:=false;
  204. if (temp mod 10)=0 then
  205. begin
  206. showmessage('本章知识点已满!');
  207. DBNavigator2.BtnClick(nbCancel);
  208. end
  209. else
  210. begin
  211. DBEdit1.text:=inttostr(temp);
  212. end;
  213. end;
  214. end;
  215. end;
  216.  case button of
  217. nbPost:
  218. begin
  219. DataModule4.Table_readpro.Close;
  220. DataModule4.Table_readpro.Open;
  221. end;
  222. end;
  223. end;
  224. procedure Treadproform.FormActivate(Sender: TObject);
  225. begin
  226. DBNavigator1.DataSource:=DataModule4.DataSource_readpro;
  227. DBNavigator2.Enabled:=false;
  228. end;
  229. procedure Treadproform.TabSheet4Show(Sender: TObject);
  230. begin
  231.      DBNavigator2.Enabled:=true;
  232. DBNavigator2.DataSource:=DataModule4.DataSource_readpro;
  233. end;
  234. procedure Treadproform.TabSheet5Show(Sender: TObject);
  235. begin
  236. DBNavigator2.Enabled:=false;
  237.  DBNavigator1.DataSource:=DataModule4.DataSource_readpro;
  238. end;
  239. procedure Treadproform.TreeView1Click(Sender: TObject);
  240. begin
  241. {
  242. if TreeView1.Selected.text='C语言' then    //总节点
  243.    begin
  244.   query1.Active:=false;
  245.   query1.Active:=true;
  246. if(query1.Active=true)then
  247. begin
  248. query1.Close;
  249. query1.SQL.Clear;
  250. query1.SQL.Add('select * from ti_choose');
  251. query1.Open;
  252.  end;
  253.  end;           }
  254.                    {
  255.  if TreeView1.Selected.text='第一章 C语言基础知识' then   //第一章
  256.    begin
  257.   query1.Active:=false;
  258.   query1.Active:=true;
  259. if(query1.Active=true)then
  260. begin
  261. query1.Close;
  262. query1.SQL.Clear;
  263. query1.SQL.Add('select * from ti_choose where tno like ''1%%%''');
  264. query1.Open;
  265.  end;
  266.  end;
  267.                        }
  268.                        {
  269.      if TreeView1.Selected.text='第一节' then         //第一章第一节
  270.    begin
  271.   query1.Active:=false;
  272.   query1.Active:=true;
  273. if(query1.Active=true)then
  274. begin
  275. query1.Close;
  276. query1.SQL.Clear;
  277. query1.SQL.Add('select * from ti_choose where tno like ''11%%''');
  278. query1.Open;
  279.  end;
  280.  end;
  281.                         }
  282.  if TreeView1.Selected.text='第一知识点 C语言的特点' then  //第一章第一节第一知识点
  283.    begin
  284.   query1.Active:=false;
  285.   query1.Active:=true;
  286. if(query1.Active=true)then
  287. begin
  288. query1.Close;
  289. query1.SQL.Clear;
  290. query1.SQL.Add('select * from ti_readpro where tno like ''111%'' order by tno');
  291. query1.Open;
  292. begin
  293.   if query1.RecordCount<>0 then
  294.   begin
  295.   query1.Last;
  296.   temp:=query1.FieldValues['tno']+1;
  297.   end
  298.   else if query1.RecordCount=0 then
  299.   begin
  300.      temp:=1111;
  301.   end;
  302. end;
  303.  end;
  304.  end;
  305.                           {
  306.  if TreeView1.Selected.text='第二节' then      //第一章第二节
  307.    begin
  308.   query1.Active:=false;
  309.   query1.Active:=true;
  310. if(query1.Active=true)then
  311. begin
  312. query1.Close;
  313. query1.SQL.Clear;
  314. query1.SQL.Add('select * from ti_choose where tno like ''12%%''');
  315. query1.Open;
  316.  end;
  317.  end;
  318.                               }
  319.  if TreeView1.Selected.text='第一知识点 C语言的标识符和保留字' then  //第一章第二节第一知识点
  320.    begin
  321.   query1.Active:=false;
  322.   query1.Active:=true;
  323. if(query1.Active=true)then
  324. begin
  325. query1.Close;
  326. query1.SQL.Clear;
  327. query1.SQL.Add('select * from ti_readpro where tno like ''121%'' order by tno');
  328. query1.Open;
  329. begin
  330.   if query1.RecordCount<>0 then
  331.   begin
  332.   query1.Last;
  333.   temp:=query1.FieldValues['tno']+1;
  334.   end
  335.   else if query1.RecordCount=0 then
  336.   begin
  337.      temp:=1211;
  338.   end;
  339. end;
  340.  end;
  341.  end;
  342.  {
  343.  
  344.      if TreeView1.Selected.text='第三节' then    //第一章第三节
  345.    begin
  346.   query1.Active:=false;
  347.   query1.Active:=true;
  348. if(query1.Active=true)then
  349. begin
  350. query1.Close;
  351. query1.SQL.Clear;
  352. query1.SQL.Add('select * from ti_readpro where tno like ''13%%''');
  353. query1.Open;
  354.  end;
  355.  end;
  356.                            }
  357. if TreeView1.Selected.text='第一知识点 C程序的结构' then      //第一章第三节第一知识点
  358.    begin
  359.   query1.Active:=false;
  360.   query1.Active:=true;
  361. if(query1.Active=true)then
  362. begin
  363. query1.Close;
  364. query1.SQL.Clear;
  365. query1.SQL.Add('select * from ti_readpro where tno like ''131%'' order by tno');
  366. query1.Open;
  367. begin
  368.   if query1.RecordCount<>0 then
  369.   begin
  370.   query1.Last;
  371.   temp:=query1.FieldValues['tno']+1;
  372.   end
  373.   else if query1.RecordCount=0 then
  374.   begin
  375.      temp:=1311;
  376.   end;
  377. end;
  378.  end;
  379.  end;
  380.                         {
  381.  if TreeView1.Selected.text='第四节' then             //第一章第四节
  382.    begin
  383.   query1.Active:=false;
  384.   query1.Active:=true;
  385. if(query1.Active=true)then
  386. begin
  387. query1.Close;
  388. query1.SQL.Clear;
  389. query1.SQL.Add('select * from ti_choose where tno like ''14%%''');
  390. query1.Open;
  391.  end;
  392.  end;
  393.                             }
  394. if TreeView1.Selected.text='第一知识点 C程序的开发过程' then     //第一章第四节第一知识点
  395.    begin
  396.   query1.Active:=false;
  397.   query1.Active:=true;
  398. if(query1.Active=true)then
  399. begin
  400. query1.Close;
  401. query1.SQL.Clear;
  402. query1.SQL.Add('select * from ti_readpro where tno like ''141%'' order by tno');
  403. query1.Open;
  404. begin
  405.   if query1.RecordCount<>0 then
  406.   begin
  407.   query1.Last;
  408.   temp:=query1.FieldValues['tno']+1;
  409.   end
  410.   else if query1.RecordCount=0 then
  411.   begin
  412.      temp:=1411;
  413.   end;
  414. end;
  415.  end;
  416.  end;
  417.  //-----------------------------------------------------------------
  418.  {
  419.  if TreeView1.Selected.text='第二章 数据类型、运算符与表达式' then
  420.    begin
  421.   query1.Active:=false;
  422.   query1.Active:=true;
  423. if(query1.Active=true)then
  424. begin
  425. query1.Close;
  426. query1.SQL.Clear;
  427. query1.SQL.Add('select * from ti_choose where tno like ''2%%%''');
  428. query1.Open;
  429.  end;
  430.  end;
  431.                      }
  432.                      {
  433. if TreeView1.Selected.text='第一节' then
  434.    begin
  435.   query1.Active:=false;
  436.   query1.Active:=true;
  437. if(query1.Active=true)then
  438. begin
  439. query1.Close;
  440. query1.SQL.Clear;
  441. query1.SQL.Add('select * from ti_choose where tno like ''21%%''');
  442. query1.Open;
  443.  end;
  444.  end;
  445.                              }
  446. if TreeView1.Selected.text='第一知识点 C语言数据类型' then   //第二章第一节第一知识点
  447.    begin
  448.   query1.Active:=false;
  449.   query1.Active:=true;
  450. if(query1.Active=true)then
  451. begin
  452. query1.Close;
  453. query1.SQL.Clear;
  454. query1.SQL.Add('select * from ti_readpro where tno like ''211%'' order by tno');
  455. query1.Open;
  456. begin
  457.   if query1.RecordCount<>0 then
  458.   begin
  459.   query1.Last;
  460.   temp:=query1.FieldValues['tno']+1;
  461.   end
  462.   else if query1.RecordCount=0 then
  463.   begin
  464.      temp:=2111;
  465.   end;
  466. end;
  467.  end;
  468.  end;
  469. if TreeView1.Selected.text='第二知识点 整型数据' then
  470.    begin
  471.   query1.Active:=false;
  472.   query1.Active:=true;
  473. if(query1.Active=true)then
  474. begin
  475. query1.Close;
  476. query1.SQL.Clear;
  477. query1.SQL.Add('select * from ti_readpro where tno like ''212%'' order by tno');
  478. query1.Open;
  479. begin
  480.   if query1.RecordCount<>0 then
  481.   begin
  482.   query1.Last;
  483.   temp:=query1.FieldValues['tno']+1;
  484.   end
  485.   else if query1.RecordCount=0 then
  486.   begin
  487.      temp:=2121;
  488.   end;
  489. end;
  490.  end;
  491.  end;
  492. if TreeView1.Selected.text='第三知识点 实型数据' then
  493.    begin
  494.   query1.Active:=false;
  495.   query1.Active:=true;
  496. if(query1.Active=true)then
  497. begin
  498. query1.Close;
  499. query1.SQL.Clear;
  500. query1.SQL.Add('select * from ti_readpro where tno like ''213%'' order by tno');
  501. query1.Open;
  502. begin
  503.   if query1.RecordCount<>0 then
  504.   begin
  505.   query1.Last;
  506.   temp:=query1.FieldValues['tno']+1;
  507.   end
  508.   else if query1.RecordCount=0 then
  509.   begin
  510.      temp:=2131;
  511.   end;
  512. end;
  513.  end;
  514.  end;
  515. if TreeView1.Selected.text='第四知识点 字符型数据' then
  516.    begin
  517.   query1.Active:=false;
  518.   query1.Active:=true;
  519. if(query1.Active=true)then
  520. begin
  521. query1.Close;
  522. query1.SQL.Clear;
  523. query1.SQL.Add('select * from ti_readpro where tno like ''214%'' order by tno');
  524. query1.Open;
  525. begin
  526.   if query1.RecordCount<>0 then
  527.   begin
  528.   query1.Last;
  529.   temp:=query1.FieldValues['tno']+1;
  530.   end
  531.   else if query1.RecordCount=0 then
  532.   begin
  533.      temp:=2141;
  534.   end;
  535. end;
  536.  end;
  537.  end;
  538.                       //---------------------------------------
  539.                       {
  540. if TreeView1.Selected.text='第二节' then
  541.    begin
  542.   query1.Active:=false;
  543.   query1.Active:=true;
  544. if(query1.Active=true)then
  545. begin
  546. query1.Close;
  547. query1.SQL.Clear;
  548. query1.SQL.Add('select * from ti_choose where tno like ''22%%''');
  549. query1.Open;
  550.  end;
  551.  end;
  552.                              }
  553. if TreeView1.Selected.text='第一知识点 运算符' then
  554.    begin
  555.   query1.Active:=false;
  556.   query1.Active:=true;
  557. if(query1.Active=true)then
  558. begin
  559. query1.Close;
  560. query1.SQL.Clear;
  561. query1.SQL.Add('select * from ti_readpro where tno like ''221%'' order by tno');
  562. query1.Open;
  563. begin
  564.   if query1.RecordCount<>0 then
  565.   begin
  566.   query1.Last;
  567.   temp:=query1.FieldValues['tno']+1;
  568.   end
  569.   else if query1.RecordCount=0 then
  570.   begin
  571.      temp:=2211;
  572.   end;
  573. end;
  574.  end;
  575.  end;
  576. if TreeView1.Selected.text='第二知识点 位运算' then
  577.    begin
  578.   query1.Active:=false;
  579.   query1.Active:=true;
  580. if(query1.Active=true)then
  581. begin
  582. query1.Close;
  583. query1.SQL.Clear;
  584. query1.SQL.Add('select * from ti_readpro where tno like ''222%'' order by tno');
  585. query1.Open;
  586. begin
  587.   if query1.RecordCount<>0 then
  588.   begin
  589.   query1.Last;
  590.   temp:=query1.FieldValues['tno']+1;
  591.   end
  592.   else if query1.RecordCount=0 then
  593.   begin
  594.      temp:=2221;
  595.   end;
  596. end;
  597.  end;
  598.  end;
  599.  //-----------------------------------
  600.  {
  601. if TreeView1.Selected.text='第三节' then
  602.    begin
  603.   query1.Active:=false;
  604.   query1.Active:=true;
  605. if(query1.Active=true)then
  606. begin
  607. query1.Close;
  608. query1.SQL.Clear;
  609. query1.SQL.Add('select * from ti_choose where tno like ''23%%''');
  610. query1.Open;
  611.  end;
  612.  end;
  613.                          }
  614. if TreeView1.Selected.text='第一知识点 表达式' then
  615.    begin
  616.   query1.Active:=false;
  617.   query1.Active:=true;
  618. if(query1.Active=true)then
  619. begin
  620. query1.Close;
  621. query1.SQL.Clear;
  622. query1.SQL.Add('select * from ti_readpro where tno like ''231%'' order by tno');
  623. query1.Open;
  624. begin
  625.   if query1.RecordCount<>0 then
  626.   begin
  627.   query1.Last;
  628.   temp:=query1.FieldValues['tno']+1;
  629.   end
  630.   else if query1.RecordCount=0 then
  631.   begin
  632.      temp:=2311;
  633.   end;
  634. end;
  635.  end;
  636.  end;
  637. if TreeView1.Selected.text='第二知识点 类型转换' then
  638.    begin
  639.   query1.Active:=false;
  640.   query1.Active:=true;
  641. if(query1.Active=true)then
  642. begin
  643. query1.Close;
  644. query1.SQL.Clear;
  645. query1.SQL.Add('select * from ti_readpro where tno like ''232%'' order by tno');
  646. query1.Open;
  647. begin
  648.   if query1.RecordCount<>0 then
  649.   begin
  650.   query1.Last;
  651.   temp:=query1.FieldValues['tno']+1;
  652.   end
  653.   else if query1.RecordCount=0 then
  654.   begin
  655.      temp:=2321;
  656.   end;
  657. end;
  658.  end;
  659.  end;
  660.  //-------------------------------------------------------------
  661.  {
  662. if TreeView1.Selected.text='第三章 顺序结构' then
  663.    begin
  664.   query1.Active:=false;
  665.   query1.Active:=true;
  666. if(query1.Active=true)then
  667. begin
  668. query1.Close;
  669. query1.SQL.Clear;
  670. query1.SQL.Add('select * from ti_choose where tno like ''3%%%''');
  671. query1.Open;
  672.  end;
  673.  end;
  674. if TreeView1.Selected.text='第一节' then
  675.    begin
  676.   query1.Active:=false;
  677.   query1.Active:=true;
  678. if(query1.Active=true)then
  679. begin
  680. query1.Close;
  681. query1.SQL.Clear;
  682. query1.SQL.Add('select * from ti_choose where tno like ''31%%''');
  683. query1.Open;
  684.  end;
  685. end;                         }
  686. if TreeView1.Selected.text='第一知识点 字符数据的输入输出' then
  687.    begin
  688.   query1.Active:=false;
  689.   query1.Active:=true;
  690. if(query1.Active=true)then
  691. begin
  692. query1.Close;
  693. query1.SQL.Clear;
  694. query1.SQL.Add('select * from ti_readpro where tno like ''311%'' order by tno');
  695. query1.Open;
  696. begin
  697.   if query1.RecordCount<>0 then
  698.   begin
  699.   query1.Last;
  700.   temp:=query1.FieldValues['tno']+1;
  701.   end
  702.   else if query1.RecordCount=0 then
  703.   begin
  704.      temp:=3111;
  705.   end;
  706. end;
  707.  end;
  708.  end;
  709.  {
  710. if TreeView1.Selected.text='第二节' then
  711.    begin
  712.   query1.Active:=false;
  713.   query1.Active:=true;
  714. if(query1.Active=true)then
  715. begin
  716. query1.Close;
  717. query1.SQL.Clear;
  718. query1.SQL.Add('select * from ti_choose where tno like ''32%%''');
  719. query1.Open;
  720.  end;
  721. end;                         }
  722. if TreeView1.Selected.text='第一知识点 格式输入与输出' then
  723.    begin
  724.   query1.Active:=false;
  725.   query1.Active:=true;
  726. if(query1.Active=true)then
  727. begin
  728. query1.Close;
  729. query1.SQL.Clear;
  730. query1.SQL.Add('select * from ti_readpro where tno like ''321%'' order by tno');
  731. query1.Open;
  732. begin
  733.   if query1.RecordCount<>0 then
  734.   begin
  735.   query1.Last;
  736.   temp:=query1.FieldValues['tno']+1;
  737.   end
  738.   else if query1.RecordCount=0 then
  739.   begin
  740.      temp:=3211;
  741.   end;
  742. end;
  743.  end;
  744.  end;
  745.  //------------------------------------------------------------
  746.  {
  747. if TreeView1.Selected.text='第四章 选择结构 ' then
  748.    begin
  749.   query1.Active:=false;
  750.   query1.Active:=true;
  751. if(query1.Active=true)then
  752. begin
  753. query1.Close;
  754. query1.SQL.Clear;
  755. query1.SQL.Add('select * from ti_choose where tno like ''4%%%''');
  756. query1.Open;
  757.  end;
  758.  end;
  759.                         }
  760.               {
  761. if TreeView1.Selected.text='第一节' then
  762.    begin
  763.   query1.Active:=false;
  764.   query1.Active:=true;
  765. if(query1.Active=true)then
  766. begin
  767. query1.Close;
  768. query1.SQL.Clear;
  769. query1.SQL.Add('select * from ti_choose where tno like ''41%%''');
  770. query1.Open;
  771.  end;
  772. end;
  773.                       }
  774. if TreeView1.Selected.text='第一知识点 if语句' then
  775.    begin
  776.   query1.Active:=false;
  777.   query1.Active:=true;
  778. if(query1.Active=true)then
  779. begin
  780. query1.Close;
  781. query1.SQL.Clear;
  782. query1.SQL.Add('select * from ti_readpro where tno like ''411%'' order by tno');
  783. query1.Open;
  784. begin
  785.   if query1.RecordCount<>0 then
  786.   begin
  787.   query1.Last;
  788.   temp:=query1.FieldValues['tno']+1;
  789.   end
  790.   else if query1.RecordCount=0 then
  791.   begin
  792.      temp:=4111;
  793.   end;
  794. end;
  795.  end;
  796.  end;
  797.  {
  798. if TreeView1.Selected.text='第二节' then
  799.    begin
  800.   query1.Active:=false;
  801.   query1.Active:=true;
  802. if(query1.Active=true)then
  803. begin
  804. query1.Close;
  805. query1.SQL.Clear;
  806. query1.SQL.Add('select * from ti_choose where tno like ''42%%''');
  807. query1.Open;
  808.  end;
  809. end;
  810.                             }
  811. if TreeView1.Selected.text='第一知识点 条件表达式' then
  812.    begin
  813.   query1.Active:=false;
  814.   query1.Active:=true;
  815. if(query1.Active=true)then
  816. begin
  817. query1.Close;
  818. query1.SQL.Clear;
  819. query1.SQL.Add('select * from ti_readpro where tno like ''421%'' order by tno');
  820. query1.Open;
  821. begin
  822.   if query1.RecordCount<>0 then
  823.   begin
  824.   query1.Last;
  825.   temp:=query1.FieldValues['tno']+1;
  826.   end
  827.   else if query1.RecordCount=0 then
  828.   begin
  829.      temp:=4211;
  830.   end;
  831. end;
  832.  end;
  833.  end;
  834.  {
  835. if TreeView1.Selected.text='第三节' then
  836.    begin
  837.   query1.Active:=false;
  838.   query1.Active:=true;
  839. if(query1.Active=true)then
  840. begin
  841. query1.Close;
  842. query1.SQL.Clear;
  843. query1.SQL.Add('select * from ti_choose where tno like ''43%%''');
  844. query1.Open;
  845.  end;
  846. end;
  847.                            }
  848. if TreeView1.Selected.text='第一知识点 switch(开关)语句' then
  849.    begin
  850.   query1.Active:=false;
  851.   query1.Active:=true;
  852. if(query1.Active=true)then
  853. begin
  854. query1.Close;
  855. query1.SQL.Clear;
  856. query1.SQL.Add('select * from ti_readpro where tno like ''431%'' order by tno');
  857. query1.Open;
  858. begin
  859.   if query1.RecordCount<>0 then
  860.   begin
  861.   query1.Last;
  862.   temp:=query1.FieldValues['tno']+1;
  863.   end
  864.   else if query1.RecordCount=0 then
  865.   begin
  866.      temp:=4311;
  867.   end;
  868. end;
  869.  end;
  870.  end;
  871.  //-------------------------------------------------------
  872.  {
  873. if TreeView1.Selected.text='第五章 循环控制  ' then
  874.    begin
  875.   query1.Active:=false;
  876.   query1.Active:=true;
  877. if(query1.Active=true)then
  878. begin
  879. query1.Close;
  880. query1.SQL.Clear;
  881. query1.SQL.Add('select * from ti_choose where tno like ''5%%%''');
  882. query1.Open;
  883.  end;
  884.  end;
  885. if TreeView1.Selected.text='第一节' then
  886.    begin
  887.   query1.Active:=false;
  888.   query1.Active:=true;
  889. if(query1.Active=true)then
  890. begin
  891. query1.Close;
  892. query1.SQL.Clear;
  893. query1.SQL.Add('select * from ti_choose where tno like ''51%%''');
  894. query1.Open;
  895.  end;
  896. end;
  897.                          }
  898. if TreeView1.Selected.text='第一知识点 while循环语句' then
  899.    begin
  900.   query1.Active:=false;
  901.   query1.Active:=true;
  902. if(query1.Active=true)then
  903. begin
  904. query1.Close;
  905. query1.SQL.Clear;
  906. query1.SQL.Add('select * from ti_readpro where tno like ''511%'' order by tno');
  907. query1.Open;
  908. begin
  909.   if query1.RecordCount<>0 then
  910.   begin
  911.   query1.Last;
  912.   temp:=query1.FieldValues['tno']+1;
  913.   end
  914.   else if query1.RecordCount=0 then
  915.   begin
  916.      temp:=5111;
  917.   end;
  918. end;
  919.  end;
  920.  end;
  921. if TreeView1.Selected.text='第二知识点 do-while循环语句' then
  922.    begin
  923.   query1.Active:=false;
  924.   query1.Active:=true;
  925. if(query1.Active=true)then
  926. begin
  927. query1.Close;
  928. query1.SQL.Clear;
  929. query1.SQL.Add('select * from ti_readpro where tno like ''512%'' order by tno');
  930. query1.Open;
  931. begin
  932.   if query1.RecordCount<>0 then
  933.   begin
  934.   query1.Last;
  935.   temp:=query1.FieldValues['tno']+1;
  936.   end
  937.   else if query1.RecordCount=0 then
  938.   begin
  939.      temp:=5121;
  940.   end;
  941. end;
  942.  end;
  943.  end;
  944.  {
  945. if TreeView1.Selected.text='第二节' then
  946.    begin
  947.   query1.Active:=false;
  948.   query1.Active:=true;
  949. if(query1.Active=true)then
  950. begin
  951. query1.Close;
  952. query1.SQL.Clear;
  953. query1.SQL.Add('select * from ti_choose where tno like ''52%%''');
  954. query1.Open;
  955.  end;
  956. end;
  957.                       }
  958. if TreeView1.Selected.text='第一知识点 for循环语句' then
  959.    begin
  960.   query1.Active:=false;
  961.   query1.Active:=true;
  962. if(query1.Active=true)then
  963. begin
  964. query1.Close;
  965. query1.SQL.Clear;
  966. query1.SQL.Add('select * from ti_readpro where tno like ''521%'' order by tno');
  967. query1.Open;
  968. begin
  969.   if query1.RecordCount<>0 then
  970.   begin
  971.   query1.Last;
  972.   temp:=query1.FieldValues['tno']+1;
  973.   end
  974.   else if query1.RecordCount=0 then
  975.   begin
  976.      temp:=5211;
  977.   end;
  978. end;
  979.  end;
  980.  end;
  981.                       {
  982. if TreeView1.Selected.text='第三节' then
  983.    begin
  984.   query1.Active:=false;
  985.   query1.Active:=true;
  986. if(query1.Active=true)then
  987. begin
  988. query1.Close;
  989. query1.SQL.Clear;
  990. query1.SQL.Add('select * from ti_choose where tno like ''53%%''');
  991. query1.Open;
  992.  end;
  993. end;                  }
  994. if TreeView1.Selected.text='第一知识点 break语句' then
  995.    begin
  996.   query1.Active:=false;
  997.   query1.Active:=true;
  998. if(query1.Active=true)then
  999. begin
  1000. query1.Close;
  1001. query1.SQL.Clear;
  1002. query1.SQL.Add('select * from ti_readpro where tno like ''531%'' order by tno');
  1003. query1.Open;
  1004. begin
  1005.   if query1.RecordCount<>0 then
  1006.   begin
  1007.   query1.Last;
  1008.   temp:=query1.FieldValues['tno']+1;
  1009.   end
  1010.   else if query1.RecordCount=0 then
  1011.   begin
  1012.      temp:=5311;
  1013.   end;
  1014. end;
  1015.  end;
  1016.  end;
  1017. if TreeView1.Selected.text='第二知识点 continue语句' then
  1018.    begin
  1019.   query1.Active:=false;
  1020.   query1.Active:=true;
  1021. if(query1.Active=true)then
  1022. begin
  1023. query1.Close;
  1024. query1.SQL.Clear;
  1025. query1.SQL.Add('select * from ti_readpro where tno like ''532%'' order by tno');
  1026. query1.Open;
  1027. begin
  1028.   if query1.RecordCount<>0 then
  1029.   begin
  1030.   query1.Last;
  1031.   temp:=query1.FieldValues['tno']+1;
  1032.   end
  1033.   else if query1.RecordCount=0 then
  1034.   begin
  1035.      temp:=5321;
  1036.   end;
  1037. end;
  1038.  end;
  1039.  end;
  1040.  {
  1041. if TreeView1.Selected.text='第四节' then
  1042.    begin
  1043.   query1.Active:=false;
  1044.   query1.Active:=true;
  1045. if(query1.Active=true)then
  1046. begin
  1047. query1.Close;
  1048. query1.SQL.Clear;
  1049. query1.SQL.Add('select * from ti_filltext where tno like ''54%%''');
  1050. query1.Open;
  1051.  end;
  1052. end;                }
  1053. if TreeView1.Selected.text='第一知识点 goto语句' then
  1054.    begin
  1055.   query1.Active:=false;
  1056.   query1.Active:=true;
  1057. if(query1.Active=true)then
  1058. begin
  1059. query1.Close;
  1060. query1.SQL.Clear;
  1061. query1.SQL.Add('select * from ti_readpro where tno like ''541%'' order by tno');
  1062. query1.Open;
  1063. begin
  1064.   if query1.RecordCount<>0 then
  1065.   begin
  1066.   query1.Last;
  1067.   temp:=query1.FieldValues['tno']+1;
  1068.   end
  1069.   else if query1.RecordCount=0 then
  1070.   begin
  1071.      temp:=5411;
  1072.   end;
  1073. end;
  1074.  end;
  1075.  end;
  1076.  //-----------------------------------------------------
  1077.  {
  1078. if TreeView1.Selected.text='第六章 数组指针  ' then
  1079.    begin
  1080.   query1.Active:=false;
  1081.   query1.Active:=true;
  1082. if(query1.Active=true)then
  1083. begin
  1084. query1.Close;
  1085. query1.SQL.Clear;
  1086. query1.SQL.Add('select * from ti_choose where tno like ''6%%%''');
  1087. query1.Open;
  1088.  end;
  1089.  end;
  1090. if TreeView1.Selected.text='第一节' then
  1091.    begin
  1092.   query1.Active:=false;
  1093.   query1.Active:=true;
  1094. if(query1.Active=true)then
  1095. begin
  1096. query1.Close;
  1097. query1.SQL.Clear;
  1098. query1.SQL.Add('select * from ti_choose where tno like ''61%%''');
  1099. query1.Open;
  1100.  end;
  1101. end;                  }
  1102. if TreeView1.Selected.text='第一知识点 一维数组' then
  1103.    begin
  1104.   query1.Active:=false;
  1105.   query1.Active:=true;
  1106. if(query1.Active=true)then
  1107. begin
  1108. query1.Close;
  1109. query1.SQL.Clear;
  1110. query1.SQL.Add('select * from ti_readpro where tno like ''611%'' order by tno');
  1111. query1.Open;
  1112. begin
  1113.   if query1.RecordCount<>0 then
  1114.   begin
  1115.   query1.Last;
  1116.   temp:=query1.FieldValues['tno']+1;
  1117.   end
  1118.   else if query1.RecordCount=0 then
  1119.   begin
  1120.      temp:=6111;
  1121.   end;
  1122. end;
  1123.  end;
  1124.  end;
  1125. if TreeView1.Selected.text='第二知识点 二维数组' then
  1126.    begin
  1127.   query1.Active:=false;
  1128.   query1.Active:=true;
  1129. if(query1.Active=true)then
  1130. begin
  1131. query1.Close;
  1132. query1.SQL.Clear;
  1133. query1.SQL.Add('select * from ti_readpro where tno like ''612%'' order by tno');
  1134. query1.Open;
  1135. begin
  1136.   if query1.RecordCount<>0 then
  1137.   begin
  1138.   query1.Last;
  1139.   temp:=query1.FieldValues['tno']+1;
  1140.   end
  1141.   else if query1.RecordCount=0 then
  1142.   begin
  1143.      temp:=6121;
  1144.   end;
  1145. end;
  1146.  end;
  1147.  end;
  1148. if TreeView1.Selected.text='第三知识点 字符数组' then
  1149.    begin
  1150.   query1.Active:=false;
  1151.   query1.Active:=true;
  1152. if(query1.Active=true)then
  1153. begin
  1154. query1.Close;
  1155. query1.SQL.Clear;
  1156. query1.SQL.Add('select * from ti_readpro where tno like ''613%'' order by tno');
  1157. query1.Open;
  1158. begin
  1159.   if query1.RecordCount<>0 then
  1160.   begin
  1161.   query1.Last;
  1162.   temp:=query1.FieldValues['tno']+1;
  1163.   end
  1164.   else if query1.RecordCount=0 then
  1165.   begin
  1166.      temp:=6131;
  1167.   end;
  1168. end;
  1169.  end;
  1170.  end;
  1171.  {
  1172. if TreeView1.Selected.text='第二节' then
  1173.    begin
  1174.   query1.Active:=false;
  1175.   query1.Active:=true;
  1176. if(query1.Active=true)then
  1177. begin
  1178. query1.Close;
  1179. query1.SQL.Clear;
  1180. query1.SQL.Add('select * from ti_choose where tno like ''62%%''');
  1181. query1.Open;
  1182.  end;
  1183. end;                    }
  1184. if TreeView1.Selected.text='第一知识点 指针的说明和初始化' then
  1185.    begin
  1186.   query1.Active:=false;
  1187.   query1.Active:=true;
  1188. if(query1.Active=true)then
  1189. begin
  1190. query1.Close;
  1191. query1.SQL.Clear;
  1192. query1.SQL.Add('select * from ti_readpro where tno like ''621%'' order by tno');
  1193. query1.Open;
  1194. begin
  1195.   if query1.RecordCount<>0 then
  1196.   begin
  1197.   query1.Last;
  1198.   temp:=query1.FieldValues['tno']+1;
  1199.   end
  1200.   else if query1.RecordCount=0 then
  1201.   begin
  1202.      temp:=6211;
  1203.   end;
  1204. end;
  1205.  end;
  1206.  end;
  1207. if TreeView1.Selected.text='第二知识点 指针运算' then
  1208.    begin
  1209.   query1.Active:=false;
  1210.   query1.Active:=true;
  1211. if(query1.Active=true)then
  1212. begin
  1213. query1.Close;
  1214. query1.SQL.Clear;
  1215. query1.SQL.Add('select * from ti_readpro where tno like ''622%'' order by tno');
  1216. query1.Open;
  1217. begin
  1218.   if query1.RecordCount<>0 then
  1219.   begin
  1220.   query1.Last;
  1221.   temp:=query1.FieldValues['tno']+1;
  1222.   end
  1223.   else if query1.RecordCount=0 then
  1224.   begin
  1225.      temp:=6221;
  1226.   end;
  1227. end;
  1228.  end;
  1229.  end;
  1230. if TreeView1.Selected.text='第三知识点 一维数组和运算' then
  1231.    begin
  1232.   query1.Active:=false;
  1233.   query1.Active:=true;
  1234. if(query1.Active=true)then
  1235. begin
  1236. query1.Close;
  1237. query1.SQL.Clear;
  1238. query1.SQL.Add('select * from ti_readpro where tno like ''623%'' order by tno');
  1239. query1.Open;
  1240. begin
  1241.   if query1.RecordCount<>0 then
  1242.   begin
  1243.   query1.Last;
  1244.   temp:=query1.FieldValues['tno']+1;
  1245.   end
  1246.   else if query1.RecordCount=0 then
  1247.   begin
  1248.      temp:=6231;
  1249.   end;
  1250. end;
  1251.  end;
  1252.  end;
  1253. if TreeView1.Selected.text='第四知识点 二维数组和运算' then
  1254.    begin
  1255.   query1.Active:=false;
  1256.   query1.Active:=true;
  1257. if(query1.Active=true)then
  1258. begin
  1259. query1.Close;
  1260. query1.SQL.Clear;
  1261. query1.SQL.Add('select * from ti_readpro where tno like ''624%'' order by tno');
  1262. query1.Open;
  1263. begin
  1264.   if query1.RecordCount<>0 then
  1265.   begin
  1266.   query1.Last;
  1267.   temp:=query1.FieldValues['tno']+1;
  1268.   end
  1269.   else if query1.RecordCount=0 then
  1270.   begin
  1271.      temp:=6241;
  1272.   end;
  1273. end;
  1274.  end;
  1275.  end;
  1276. if TreeView1.Selected.text='第五知识点 字符指针和字符串' then
  1277.    begin
  1278.   query1.Active:=false;
  1279.   query1.Active:=true;
  1280. if(query1.Active=true)then
  1281. begin
  1282. query1.Close;
  1283. query1.SQL.Clear;
  1284. query1.SQL.Add('select * from ti_readpro where tno like ''625%'' order by tno');
  1285. query1.Open;
  1286. begin
  1287.   if query1.RecordCount<>0 then
  1288.   begin
  1289.   query1.Last;
  1290.   temp:=query1.FieldValues['tno']+1;
  1291.   end
  1292.   else if query1.RecordCount=0 then
  1293.   begin
  1294.      temp:=6251;
  1295.   end;
  1296. end;
  1297.  end;
  1298.  end;
  1299. if TreeView1.Selected.text='第六知识点 多级指针' then
  1300.    begin
  1301.   query1.Active:=false;
  1302.   query1.Active:=true;
  1303. if(query1.Active=true)then
  1304. begin
  1305. query1.Close;
  1306. query1.SQL.Clear;
  1307. query1.SQL.Add('select * from ti_readpro where tno like ''626%'' order by tno');
  1308. query1.Open;
  1309. begin
  1310.   if query1.RecordCount<>0 then
  1311.   begin
  1312.   query1.Last;
  1313.   temp:=query1.FieldValues['tno']+1;
  1314.   end
  1315.   else if query1.RecordCount=0 then
  1316.   begin
  1317.      temp:=6261;
  1318.   end;
  1319. end;
  1320.  end;
  1321.  end;
  1322. if TreeView1.Selected.text='第七知识点 指针型函数' then
  1323.    begin
  1324.   query1.Active:=false;
  1325.   query1.Active:=true;
  1326. if(query1.Active=true)then
  1327. begin
  1328. query1.Close;
  1329. query1.SQL.Clear;
  1330. query1.SQL.Add('select * from ti_readpro where tno like ''627%'' order by tno');
  1331. query1.Open;
  1332. begin
  1333.   if query1.RecordCount<>0 then
  1334.   begin
  1335.   query1.Last;
  1336.   temp:=query1.FieldValues['tno']+1;
  1337.   end
  1338.   else if query1.RecordCount=0 then
  1339.   begin
  1340.      temp:=6271;
  1341.   end;
  1342. end;
  1343.  end;
  1344.  end;
  1345. if TreeView1.Selected.text='第八知识点 指向函数的指针' then
  1346.    begin
  1347.   query1.Active:=false;
  1348.   query1.Active:=true;
  1349. if(query1.Active=true)then
  1350. begin
  1351. query1.Close;
  1352. query1.SQL.Clear;
  1353. query1.SQL.Add('select * from ti_readpro where tno like ''628%'' order by tno');
  1354. query1.Open;
  1355. begin
  1356.   if query1.RecordCount<>0 then
  1357.   begin
  1358.   query1.Last;
  1359.   temp:=query1.FieldValues['tno']+1;
  1360.   end
  1361.   else if query1.RecordCount=0 then
  1362.   begin
  1363.      temp:=6281;
  1364.   end;
  1365. end;
  1366.  end;
  1367.  end;
  1368.                   {
  1369. if TreeView1.Selected.text='第七章 函数  结构体与共用体  ' then
  1370.    begin
  1371.   query1.Active:=false;
  1372.   query1.Active:=true;
  1373. if(query1.Active=true)then
  1374. begin
  1375. query1.Close;
  1376. query1.SQL.Clear;
  1377. query1.SQL.Add('select * from ti_choose where tno like ''7%%%''');
  1378. query1.Open;
  1379.  end;
  1380.  end;
  1381. if TreeView1.Selected.text='第一节 ' then
  1382.    begin
  1383.   query1.Active:=false;
  1384.   query1.Active:=true;
  1385. if(query1.Active=true)then
  1386. begin
  1387. query1.Close;
  1388. query1.SQL.Clear;
  1389. query1.SQL.Add('select * from ti_choose where tno like ''71%%''');
  1390. query1.Open;
  1391.  end;
  1392. end;                 }
  1393. if TreeView1.Selected.text='第一知识点 函数设计' then
  1394.    begin
  1395.   query1.Active:=false;
  1396.   query1.Active:=true;
  1397. if(query1.Active=true)then
  1398. begin
  1399. query1.Close;
  1400. query1.SQL.Clear;
  1401. query1.SQL.Add('select * from ti_readpro where tno like ''711%'' order by tno');
  1402. query1.Open;
  1403. begin
  1404.   if query1.RecordCount<>0 then
  1405.   begin
  1406.   query1.Last;
  1407.   temp:=query1.FieldValues['tno']+1;
  1408.   end
  1409.   else if query1.RecordCount=0 then
  1410.   begin
  1411.      temp:=7111;
  1412.   end;
  1413. end;
  1414.  end;
  1415.  end;
  1416. if TreeView1.Selected.text='第二知识点 函数的存储类型' then
  1417.    begin
  1418.   query1.Active:=false;
  1419.   query1.Active:=true;
  1420. if(query1.Active=true)then
  1421. begin
  1422. query1.Close;
  1423. query1.SQL.Clear;
  1424. query1.SQL.Add('select * from ti_readpro where tno like ''712%'' order by tno');
  1425. query1.Open;
  1426. begin
  1427.   if query1.RecordCount<>0 then
  1428.   begin
  1429.   query1.Last;
  1430.   temp:=query1.FieldValues['tno']+1;
  1431.   end
  1432.   else if query1.RecordCount=0 then
  1433.   begin
  1434.      temp:=7121;
  1435.   end;
  1436. end;
  1437.  end;
  1438.  end;
  1439. if TreeView1.Selected.text='第三知识点 变量的作用域和存储类型' then
  1440.    begin
  1441.   query1.Active:=false;
  1442.   query1.Active:=true;
  1443. if(query1.Active=true)then
  1444. begin
  1445. query1.Close;
  1446. query1.SQL.Clear;
  1447. query1.SQL.Add('select * from ti_readpro where tno like ''713%'' order by tno');
  1448. query1.Open;
  1449. begin
  1450.   if query1.RecordCount<>0 then
  1451.   begin
  1452.   query1.Last;
  1453.   temp:=query1.FieldValues['tno']+1;
  1454.   end
  1455.   else if query1.RecordCount=0 then
  1456.   begin
  1457.      temp:=7131;
  1458.   end;
  1459. end;
  1460.  end;
  1461.  end;
  1462. if TreeView1.Selected.text='第四知识点 函数的数据传递' then
  1463.    begin
  1464.   query1.Active:=false;
  1465.   query1.Active:=true;
  1466. if(query1.Active=true)then
  1467. begin
  1468. query1.Close;
  1469. query1.SQL.Clear;
  1470. query1.SQL.Add('select * from ti_readpro where tno like ''714%'' order by tno');
  1471. query1.Open;
  1472. begin
  1473.   if query1.RecordCount<>0 then
  1474.   begin
  1475.   query1.Last;
  1476.   temp:=query1.FieldValues['tno']+1;
  1477.   end
  1478.   else if query1.RecordCount=0 then
  1479.   begin
  1480.      temp:=7141;
  1481.   end;
  1482. end;
  1483.  end;
  1484.  end;
  1485. if TreeView1.Selected.text='第五知识点 数组在函数间的传递' then
  1486.    begin
  1487.   query1.Active:=false;
  1488.   query1.Active:=true;
  1489. if(query1.Active=true)then
  1490. begin
  1491. query1.Close;
  1492. query1.SQL.Clear;
  1493. query1.SQL.Add('select * from ti_readpro where tno like ''715%'' order by tno');
  1494. query1.Open;
  1495. begin
  1496.   if query1.RecordCount<>0 then
  1497.   begin
  1498.   query1.Last;
  1499.   temp:=query1.FieldValues['tno']+1;
  1500.   end
  1501.   else if query1.RecordCount=0 then
  1502.   begin
  1503.      temp:=7151;
  1504.   end;
  1505. end;
  1506.  end;
  1507.  end;
  1508. if TreeView1.Selected.text='第六知识点 递归函数' then
  1509.    begin
  1510.   query1.Active:=false;
  1511.   query1.Active:=true;
  1512. if(query1.Active=true)then
  1513. begin
  1514. query1.Close;
  1515. query1.SQL.Clear;
  1516. query1.SQL.Add('select * from ti_readpro where tno like ''716%'' order by tno');
  1517. query1.Open;
  1518. begin
  1519.   if query1.RecordCount<>0 then
  1520.   begin
  1521.   query1.Last;
  1522.   temp:=query1.FieldValues['tno']+1;
  1523.   end
  1524.   else if query1.RecordCount=0 then
  1525.   begin
  1526.      temp:=7161;
  1527.   end;
  1528. end;
  1529.  end;
  1530.  end;
  1531. if TreeView1.Selected.text='第七知识点 传递main()函数的参数' then
  1532.    begin
  1533.   query1.Active:=false;
  1534.   query1.Active:=true;
  1535. if(query1.Active=true)then
  1536. begin
  1537. query1.Close;
  1538. query1.SQL.Clear;
  1539. query1.SQL.Add('select * from ti_readpro where tno like ''717%'' order by tno');
  1540. query1.Open;
  1541. begin
  1542.   if query1.RecordCount<>0 then
  1543.   begin
  1544.   query1.Last;
  1545.   temp:=query1.FieldValues['tno']+1;
  1546.   end
  1547.   else if query1.RecordCount=0 then
  1548.   begin
  1549.      temp:=7171;
  1550.   end;
  1551. end;
  1552.  end;
  1553.  end;
  1554.  {
  1555. if TreeView1.Selected.text='第二节 ' then
  1556.    begin
  1557.   query1.Active:=false;
  1558.   query1.Active:=true;
  1559. if(query1.Active=true)then
  1560. begin
  1561. query1.Close;
  1562. query1.SQL.Clear;
  1563. query1.SQL.Add('select * from ti_choose where tno like ''72%%''');
  1564. query1.Open;
  1565.  end;
  1566. end;                             }
  1567. if TreeView1.Selected.text='第一知识点 结构体定义和变量说明' then
  1568.    begin
  1569.   query1.Active:=false;
  1570.   query1.Active:=true;
  1571. if(query1.Active=true)then
  1572. begin
  1573. query1.Close;
  1574. query1.SQL.Clear;
  1575. query1.SQL.Add('select * from ti_readpro where tno like ''721%'' order by tno');
  1576. query1.Open;
  1577. begin
  1578.   if query1.RecordCount<>0 then
  1579.   begin
  1580.   query1.Last;
  1581.   temp:=query1.FieldValues['tno']+1;
  1582.   end
  1583.   else if query1.RecordCount=0 then
  1584.   begin
  1585.      temp:=7211;
  1586.   end;
  1587. end;
  1588.  end;
  1589.  end;
  1590. if TreeView1.Selected.text='第二知识点 结构体变量的引用和初始化' then
  1591.    begin
  1592.   query1.Active:=false;
  1593.   query1.Active:=true;
  1594. if(query1.Active=true)then
  1595. begin
  1596. query1.Close;
  1597. query1.SQL.Clear;
  1598. query1.SQL.Add('select * from ti_readpro where tno like ''722%'' order by tno');
  1599. query1.Open;
  1600. begin
  1601.   if query1.RecordCount<>0 then
  1602.   begin
  1603.   query1.Last;
  1604.   temp:=query1.FieldValues['tno']+1;
  1605.   end
  1606.   else if query1.RecordCount=0 then
  1607.   begin
  1608.      temp:=7221;
  1609.   end;
  1610. end;
  1611.  end;
  1612.  end;
  1613. if TreeView1.Selected.text='第三知识点 结构体数组' then
  1614.    begin
  1615.   query1.Active:=false;
  1616.   query1.Active:=true;
  1617. if(query1.Active=true)then
  1618. begin
  1619. query1.Close;
  1620. query1.SQL.Clear;
  1621. query1.SQL.Add('select * from ti_readpro where tno like ''723%'' order by tno');
  1622. query1.Open;
  1623. begin
  1624.   if query1.RecordCount<>0 then
  1625.   begin
  1626.   query1.Last;
  1627.   temp:=query1.FieldValues['tno']+1;
  1628.   end
  1629.   else if query1.RecordCount=0 then
  1630.   begin
  1631.      temp:=7231;
  1632.   end;
  1633. end;
  1634.  end;
  1635.  end;
  1636. if TreeView1.Selected.text='第四知识点 结构体指针' then
  1637.    begin
  1638.   query1.Active:=false;
  1639.   query1.Active:=true;
  1640. if(query1.Active=true)then
  1641. begin
  1642. query1.Close;
  1643. query1.SQL.Clear;
  1644. query1.SQL.Add('select * from ti_readpro where tno like ''724%'' order by tno');
  1645. query1.Open;
  1646. begin
  1647.   if query1.RecordCount<>0 then
  1648.   begin
  1649.   query1.Last;
  1650.   temp:=query1.FieldValues['tno']+1;
  1651.   end
  1652.   else if query1.RecordCount=0 then
  1653.   begin
  1654.      temp:=7241;
  1655.   end;
  1656. end;
  1657.  end;
  1658.  end;
  1659. if TreeView1.Selected.text='第五知识点 函数之间结构体变量的数据传递' then
  1660.    begin
  1661.   query1.Active:=false;
  1662.   query1.Active:=true;
  1663. if(query1.Active=true)then
  1664. begin
  1665. query1.Close;
  1666. query1.SQL.Clear;
  1667. query1.SQL.Add('select * from ti_readpro where tno like ''725%'' order by tno');
  1668. query1.Open;
  1669. begin
  1670.   if query1.RecordCount<>0 then
  1671.   begin
  1672.   query1.Last;
  1673.   temp:=query1.FieldValues['tno']+1;
  1674.   end
  1675.   else if query1.RecordCount=0 then
  1676.   begin
  1677.      temp:=7251;
  1678.   end;
  1679. end;
  1680.  end;
  1681.  end;
  1682. if TreeView1.Selected.text='第六知识点 结构体嵌套' then
  1683.    begin
  1684.   query1.Active:=false;
  1685.   query1.Active:=true;
  1686. if(query1.Active=true)then
  1687. begin
  1688. query1.Close;
  1689. query1.SQL.Clear;
  1690. query1.SQL.Add('select * from ti_readpro where tno like ''726%'' order by tno');
  1691. query1.Open;
  1692. begin
  1693.   if query1.RecordCount<>0 then
  1694.   begin
  1695.   query1.Last;
  1696.   temp:=query1.FieldValues['tno']+1;
  1697.   end
  1698.   else if query1.RecordCount=0 then
  1699.   begin
  1700.      temp:=7261;
  1701.   end;
  1702. end;
  1703.  end;
  1704.  end;
  1705. if TreeView1.Selected.text='第七知识点 链表' then
  1706.    begin
  1707.   query1.Active:=false;
  1708.   query1.Active:=true;
  1709. if(query1.Active=true)then
  1710. begin
  1711. query1.Close;
  1712. query1.SQL.Clear;
  1713. query1.SQL.Add('select * from ti_readpro where tno like ''727%'' order by tno');
  1714. query1.Open;
  1715. begin
  1716.   if query1.RecordCount<>0 then
  1717.   begin
  1718.   query1.Last;
  1719.   temp:=query1.FieldValues['tno']+1;
  1720.   end
  1721.   else if query1.RecordCount=0 then
  1722.   begin
  1723.      temp:=7271;
  1724.   end;
  1725. end;
  1726.  end;
  1727.  end;
  1728. if TreeView1.Selected.text='第八知识点 共用体' then
  1729.    begin
  1730.   query1.Active:=false;
  1731.   query1.Active:=true;
  1732. if(query1.Active=true)then
  1733. begin
  1734. query1.Close;
  1735. query1.SQL.Clear;
  1736. query1.SQL.Add('select * from ti_readpro where tno like ''728%'' order by tno');
  1737. query1.Open;
  1738. begin
  1739.   if query1.RecordCount<>0 then
  1740.   begin
  1741.   query1.Last;
  1742.   temp:=query1.FieldValues['tno']+1;
  1743.   end
  1744.   else if query1.RecordCount=0 then
  1745.   begin
  1746.      temp:=7281;
  1747.   end;
  1748. end;
  1749.  end;
  1750.  end;
  1751. if TreeView1.Selected.text='第九知识点 枚举类型' then
  1752.    begin
  1753.   query1.Active:=false;
  1754.   query1.Active:=true;
  1755. if(query1.Active=true)then
  1756. begin
  1757. query1.Close;
  1758. query1.SQL.Clear;
  1759. query1.SQL.Add('select * from ti_readpro where tno like ''729%'' order by tno');
  1760. query1.Open;
  1761. begin
  1762.   if query1.RecordCount<>0 then
  1763.   begin
  1764.   query1.Last;
  1765.   temp:=query1.FieldValues['tno']+1;
  1766.   end
  1767.   else if query1.RecordCount=0 then
  1768.   begin
  1769.      temp:=7291;
  1770.   end;
  1771. end;
  1772.  end;
  1773.  end;
  1774.  {
  1775. if TreeView1.Selected.text='第八章 预处理命令  ' then
  1776.    begin
  1777.   query1.Active:=false;
  1778.   query1.Active:=true;
  1779. if(query1.Active=true)then
  1780. begin
  1781. query1.Close;
  1782. query1.SQL.Clear;
  1783. query1.SQL.Add('select * from ti_choose where tno like ''8%%%''');
  1784. query1.Open;
  1785.  end;
  1786.  end;
  1787. if TreeView1.Selected.text='第一节 ' then
  1788.    begin
  1789.   query1.Active:=false;
  1790.   query1.Active:=true;
  1791. if(query1.Active=true)then
  1792. begin
  1793. query1.Close;
  1794. query1.SQL.Clear;
  1795. query1.SQL.Add('select * from ti_choose where tno like ''81%%''');
  1796. query1.Open;
  1797.  end;
  1798. end;                                }
  1799. if TreeView1.Selected.text='第一知识点 宏' then
  1800.    begin
  1801.   query1.Active:=false;
  1802.   query1.Active:=true;
  1803. if(query1.Active=true)then
  1804. begin
  1805. query1.Close;
  1806. query1.SQL.Clear;
  1807. query1.SQL.Add('select * from ti_readpro where tno like ''811%'' order by tno');
  1808. query1.Open;
  1809. begin
  1810.   if query1.RecordCount<>0 then
  1811.   begin
  1812.   query1.Last;
  1813.   temp:=query1.FieldValues['tno']+1;
  1814.   end
  1815.   else if query1.RecordCount=0 then
  1816.   begin
  1817.      temp:=8111;
  1818.   end;
  1819. end;
  1820.  end;
  1821.  end;
  1822. if TreeView1.Selected.text='第二知识点 条件编译' then
  1823.    begin
  1824.   query1.Active:=false;
  1825.   query1.Active:=true;
  1826. if(query1.Active=true)then
  1827. begin
  1828. query1.Close;
  1829. query1.SQL.Clear;
  1830. query1.SQL.Add('select * from ti_readpro where tno like ''812%'' order by tno');
  1831. query1.Open;
  1832. begin
  1833.   if query1.RecordCount<>0 then
  1834.   begin
  1835.   query1.Last;
  1836.   temp:=query1.FieldValues['tno']+1;
  1837.   end
  1838.   else if query1.RecordCount=0 then
  1839.   begin
  1840.      temp:=8121;
  1841.   end;
  1842. end;
  1843.  end;
  1844.  end;
  1845. if TreeView1.Selected.text='第三知识点 文件包含' then
  1846.    begin
  1847.   query1.Active:=false;
  1848.   query1.Active:=true;
  1849. if(query1.Active=true)then
  1850. begin
  1851. query1.Close;
  1852. query1.SQL.Clear;
  1853. query1.SQL.Add('select * from ti_readpro where tno like ''813%'' order by tno');
  1854. query1.Open;
  1855. begin
  1856.   if query1.RecordCount<>0 then
  1857.   begin
  1858.   query1.Last;
  1859.   temp:=query1.FieldValues['tno']+1;
  1860.   end
  1861.   else if query1.RecordCount=0 then
  1862.   begin
  1863.      temp:=8131;
  1864.   end;
  1865. end;
  1866.  end;
  1867.  end;
  1868.  {
  1869. if TreeView1.Selected.text='第二节 ' then
  1870.    begin
  1871.   query1.Active:=false;
  1872.   query1.Active:=true;
  1873. if(query1.Active=true)then
  1874. begin
  1875. query1.Close;
  1876. query1.SQL.Clear;
  1877. query1.SQL.Add('select * from ti_choose where tno like ''82%%''');
  1878. query1.Open;
  1879.  end;
  1880. end;                           }
  1881. if TreeView1.Selected.text='第一知识点 文件概述' then
  1882.    begin
  1883.   query1.Active:=false;
  1884.   query1.Active:=true;
  1885. if(query1.Active=true)then
  1886. begin
  1887. query1.Close;
  1888. query1.SQL.Clear;
  1889. query1.SQL.Add('select * from ti_readpro where tno like ''821%'' order by tno');
  1890. query1.Open;
  1891. begin
  1892.   if query1.RecordCount<>0 then
  1893.   begin
  1894.   query1.Last;
  1895.   temp:=query1.FieldValues['tno']+1;
  1896.   end
  1897.   else if query1.RecordCount=0 then
  1898.   begin
  1899.      temp:=8211;
  1900.   end;
  1901. end;
  1902.  end;
  1903.  end;
  1904. if TreeView1.Selected.text='第二知识点 文件的输入输出' then
  1905.    begin
  1906.   query1.Active:=false;
  1907.   query1.Active:=true;
  1908. if(query1.Active=true)then
  1909. begin
  1910. query1.Close;
  1911. query1.SQL.Clear;
  1912. query1.SQL.Add('select * from ti_readpro where tno like ''822%'' order by tno');
  1913. query1.Open;
  1914. begin
  1915.   if query1.RecordCount<>0 then
  1916.   begin
  1917.   query1.Last;
  1918.   temp:=query1.FieldValues['tno']+1;
  1919.   end
  1920.   else if query1.RecordCount=0 then
  1921.   begin
  1922.      temp:=8221;
  1923.   end;
  1924. end;
  1925.  end;
  1926.  end;
  1927. if TreeView1.Selected.text='第三知识点 文件的定位操作' then
  1928.    begin
  1929.   query1.Active:=false;
  1930.   query1.Active:=true;
  1931. if(query1.Active=true)then
  1932. begin
  1933. query1.Close;
  1934. query1.SQL.Clear;
  1935. query1.SQL.Add('select * from ti_readpro where tno like ''823%'' order by tno');
  1936. query1.Open;
  1937. begin
  1938.   if query1.RecordCount<>0 then
  1939.   begin
  1940.   query1.Last;
  1941.   temp:=query1.FieldValues['tno']+1;
  1942.   end
  1943.   else if query1.RecordCount=0 then
  1944.   begin
  1945.      temp:=8231;
  1946.   end;
  1947. end;
  1948.  end;
  1949.  end;
  1950. if TreeView1.Selected.text='第四知识点 文件的检测' then
  1951.    begin
  1952.   query1.Active:=false;
  1953.   query1.Active:=true;
  1954. if(query1.Active=true)then
  1955. begin
  1956. query1.Close;
  1957. query1.SQL.Clear;
  1958. query1.SQL.Add('select * from ti_readpro where tno like ''824%'' order by tno');
  1959. query1.Open;
  1960. begin
  1961.   if query1.RecordCount<>0 then
  1962.   begin
  1963.   query1.Last;
  1964.   temp:=query1.FieldValues['tno']+1;
  1965.   end
  1966.   else if query1.RecordCount=0 then
  1967.   begin
  1968.      temp:=8241;
  1969.   end;
  1970. end;
  1971.  end;
  1972.  end;
  1973.  {
  1974. if TreeView1.Selected.text='第九章 常用算法设计  ' then
  1975.    begin
  1976.   query1.Active:=false;
  1977.   query1.Active:=true;
  1978. if(query1.Active=true)then
  1979. begin
  1980. query1.Close;
  1981. query1.SQL.Clear;
  1982. query1.SQL.Add('select * from ti_choose where tno like ''9%%%''');
  1983. query1.Open;
  1984.  end;
  1985.  end;
  1986. if TreeView1.Selected.text='第一节 ' then
  1987.    begin
  1988.   query1.Active:=false;
  1989.   query1.Active:=true;
  1990. if(query1.Active=true)then
  1991. begin
  1992. query1.Close;
  1993. query1.SQL.Clear;
  1994. query1.SQL.Add('select * from ti_choose where tno like ''91%%''');
  1995. query1.Open;
  1996.  end;
  1997. end;                     }
  1998. if TreeView1.Selected.text='第一知识点 排序' then
  1999.    begin
  2000.   query1.Active:=false;
  2001.   query1.Active:=true;
  2002. if(query1.Active=true)then
  2003. begin
  2004. query1.Close;
  2005. query1.SQL.Clear;
  2006. query1.SQL.Add('select * from ti_readpro where tno like ''911%'' order by tno');
  2007. query1.Open;
  2008. begin
  2009.   if query1.RecordCount<>0 then
  2010.   begin
  2011.   query1.Last;
  2012.   temp:=query1.FieldValues['tno']+1;
  2013.   end
  2014.   else if query1.RecordCount=0 then
  2015.   begin
  2016.      temp:=9111;
  2017.   end;
  2018. end;
  2019.  end;
  2020.  end;
  2021.  {
  2022. if TreeView1.Selected.text='第二节 ' then
  2023.    begin
  2024.   query1.Active:=false;
  2025.   query1.Active:=true;
  2026. if(query1.Active=true)then
  2027. begin
  2028. query1.Close;
  2029. query1.SQL.Clear;
  2030. query1.SQL.Add('select * from ti_choose where tno like ''92%%''');
  2031. query1.Open;
  2032.  end;
  2033. end;                               }
  2034. if TreeView1.Selected.text='第一知识点 查找' then
  2035.    begin
  2036.   query1.Active:=false;
  2037.   query1.Active:=true;
  2038. if(query1.Active=true)then
  2039. begin
  2040. query1.Close;
  2041. query1.SQL.Clear;
  2042. query1.SQL.Add('select * from ti_readpro where tno like ''921%'' order by tno');
  2043. query1.Open;
  2044. begin
  2045.   if query1.RecordCount<>0 then
  2046.   begin
  2047.   query1.Last;
  2048.   temp:=query1.FieldValues['tno']+1;
  2049.   end
  2050.   else if query1.RecordCount=0 then
  2051.   begin
  2052.      temp:=9211;
  2053.   end;
  2054. end;
  2055.  end;
  2056.  end;
  2057.  {
  2058. if TreeView1.Selected.text='第三节 ' then
  2059.    begin
  2060.   query1.Active:=false;
  2061.   query1.Active:=true;
  2062. if(query1.Active=true)then
  2063. begin
  2064. query1.Close;
  2065. query1.SQL.Clear;
  2066. query1.SQL.Add('select * from ti_choose where tno like ''93%%''');
  2067. query1.Open;
  2068.  end;
  2069. end;                 }
  2070. if TreeView1.Selected.text='第一知识点 枚举法' then
  2071.    begin
  2072.   query1.Active:=false;
  2073.   query1.Active:=true;
  2074. if(query1.Active=true)then
  2075. begin
  2076. query1.Close;
  2077. query1.SQL.Clear;
  2078. query1.SQL.Add('select * from ti_readpro where tno like ''931%'' order by tno');
  2079. query1.Open;
  2080. begin
  2081.   if query1.RecordCount<>0 then
  2082.   begin
  2083.   query1.Last;
  2084.   temp:=query1.FieldValues['tno']+1;
  2085.   end
  2086.   else if query1.RecordCount=0 then
  2087.   begin
  2088.      temp:=9311;
  2089.   end;
  2090. end;
  2091.  end;
  2092.  end;                          {
  2093. if TreeView1.Selected.text='第四节 ' then
  2094.    begin
  2095.   query1.Active:=false;
  2096.   query1.Active:=true;
  2097. if(query1.Active=true)then
  2098. begin
  2099. query1.Close;
  2100. query1.SQL.Clear;
  2101. query1.SQL.Add('select * from ti_choose where tno like ''94%%''');
  2102. query1.Open;
  2103.  end;
  2104. end;                            }
  2105. if TreeView1.Selected.text='第一知识点 递归法' then
  2106.    begin
  2107.   query1.Active:=false;
  2108.   query1.Active:=true;
  2109. if(query1.Active=true)then
  2110. begin
  2111. query1.Close;
  2112. query1.SQL.Clear;
  2113. query1.SQL.Add('select * from ti_readpro where tno like ''941%'' order by tno');
  2114. query1.Open;
  2115. begin
  2116.   if query1.RecordCount<>0 then
  2117.   begin
  2118.   query1.Last;
  2119.   temp:=query1.FieldValues['tno']+1;
  2120.   end
  2121.   else if query1.RecordCount=0 then
  2122.   begin
  2123.      temp:=9411;
  2124.   end;
  2125. end;
  2126.  end;
  2127.  end;
  2128.  DBMemo1.DataSource:=DataSource1;
  2129.   DBEdit1.DataSource:=DataSource1;
  2130.   DBEdit6.DataSource:=DataSource1 ;
  2131.   DBComboBox1.DataSource:=DataSource1;
  2132.   DBMemo2.DataSource:=DataSource1;
  2133.   DBEdit2.DataSource:=DataSource1;
  2134.   DBEdit3.DataSource:=DataSource1 ;
  2135.   DBEdit4.DataSource:=DataSource1;
  2136.    DBEdit5.DataSource:=DataSource1;
  2137.    DBRadioGroup1.DataSource:=DataSource1;
  2138.    DBMemo3.DataSource:=DataSource1;
  2139.   DBEdit8.DataSource:=DataSource1 ;
  2140.   DBEdit9.DataSource:=DataSource1;
  2141.    DBEdit10.DataSource:=DataSource1;
  2142.     DBEdit11.DataSource:=DataSource1;
  2143.     DBRadioGroup2.DataSource:=DataSource1;
  2144.        DBMemo4.DataSource:=DataSource1;
  2145.   DBEdit12.DataSource:=DataSource1 ;
  2146.   DBEdit13.DataSource:=DataSource1;
  2147.    DBEdit14.DataSource:=DataSource1;
  2148.     DBEdit15.DataSource:=DataSource1;
  2149.     DBRadioGroup3.DataSource:=DataSource1;
  2150.  DBNavigator1.DataSource:=DataSource1;
  2151. end;
  2152. procedure Treadproform.BitBtn3Click(Sender: TObject);
  2153. begin
  2154. DBNavigator2.BtnClick(nbCancel);
  2155. end;
  2156. procedure Treadproform.BitBtn2Click(Sender: TObject);
  2157. begin
  2158. if addreadpro then
  2159.      begin
  2160.        if checknewreadpro then
  2161.        begin
  2162.        DataModule4.Table_readpro.Post;
  2163. DataModule4.Table_readpro.Close;
  2164. DataModule4.Table_readpro.Open;
  2165.        showmessage('添加成功!');
  2166.        addreadpro:=false;
  2167.     //   inc(newshijuanhao);
  2168.      //  DataModule4.Table_shijuan.UpdateRecord;
  2169.      //  DBNavigator1.CanFocus;
  2170.       DBNavigator2.Enabled:=true;
  2171.         end
  2172.     else
  2173.     exit;
  2174. end;
  2175. end;
  2176. procedure Treadproform.FormCreate(Sender: TObject);
  2177. begin
  2178. addreadpro:=false;
  2179. end;
  2180. procedure Treadproform.TreeView1MouseDown(Sender: TObject;
  2181.   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  2182. begin
  2183.  DBNavigator2.Enabled:=true;
  2184. end;
  2185. procedure Treadproform.DBNavigator1Click(Sender: TObject;
  2186.   Button: TNavigateBtn);
  2187. begin
  2188. case button of
  2189. nbFirst:
  2190. begin
  2191.   DataModule4.Table_readpro.First;
  2192.   end;
  2193. end;
  2194. end;
  2195. procedure Treadproform.DBEdit1Change(Sender: TObject);
  2196. begin
  2197. if DBEdit1.Text='' then
  2198. begin
  2199. DBNavigator2.VisibleButtons:=[nbInsert];
  2200.  DBNavigator2.Width:=28;
  2201.  end;
  2202. if DBEdit1.Text<>'' then
  2203. begin
  2204.  DBNavigator2.Width:=56;
  2205. DBNavigator2.VisibleButtons:=[nbInsert,nbDelete];
  2206. end;
  2207. end;
  2208. end.