找传奇、传世资源到传世资源站!

驾校学员管理系统

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

【例子介绍】驾校学员练车管理系统
【相关图片】驾校学员管理系统 Delphi数据库编程-第1张驾校学员管理系统 Delphi数据库编程-第2张驾校学员管理系统 Delphi数据库编程-第3张驾校学员管理系统 Delphi数据库编程-第4张
【源码结构】DELPHI
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, ComCtrls, DB, ADODB, Grids, DBGrids, DBCtrls, StdCtrls,
  StrUtils, XPMan, MPlayer,MMSystem, Menus,DateUtils, Mask, IdBaseComponent,
  IdComponent, IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase,
  IdFTP;

type
  TForm1 = class(TForm)
    DataSource1: TDataSource;
    ADOConnection1: TADOConnection;
    ADOQuery1: TADOQuery;
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    ADOQuery2: TADOQuery;
    DataSource2: TDataSource;
    Timer1: TTimer;
    ADOQuery3: TADOQuery;
    DataSource3: TDataSource;
    ADOQuery4: TADOQuery;
    DataSource4: TDataSource;
    TabSheet7: TTabSheet;
    GroupBox4: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton6: TRadioButton;
    RadioButton7: TRadioButton;
    PageControl3: TPageControl;
    TabSheet8: TTabSheet;
    TabSheet9: TTabSheet;
    GroupBox1: TGroupBox;
    Button4: TButton;
    Button3: TButton;
    Button10: TButton;
    DBText12: TDBText;
    Edit16: TEdit;
    DBText1: TDBText;
    Label19: TLabel;
    Label12: TLabel;
    Label18: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    DBText2: TDBText;
    DBText3: TDBText;
    Label3: TLabel;
    Edit3: TEdit;
    ComboBox3: TComboBox;
    Label4: TLabel;
    DBText4: TDBText;
    Edit4: TEdit;
    ComboBox4: TComboBox;
    Edit5: TEdit;
    DateTimePicker1: TDateTimePicker;
    DBText5: TDBText;
    Label5: TLabel;
    DateTimePicker2: TDateTimePicker;
    Edit6: TEdit;
    DBText6: TDBText;
    Label6: TLabel;
    Edit7: TEdit;
    DateTimePicker3: TDateTimePicker;
    DBText7: TDBText;
    Label7: TLabel;
    Label8: TLabel;
    DBText8: TDBText;
    Edit8: TEdit;
    DateTimePicker4: TDateTimePicker;
    Label9: TLabel;
    DBText9: TDBText;
    Edit9: TEdit;
    ComboBox1: TComboBox;
    Label10: TLabel;
    DBText10: TDBText;
    Edit10: TEdit;
    Label11: TLabel;
    DBText11: TDBText;
    Edit11: TEdit;
    ComboBox5: TComboBox;
    TabSheet10: TTabSheet;
    DBGrid1: TDBGrid;
    GroupBox5: TGroupBox;
    Label20: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    DBText18: TDBText;
    DBText19: TDBText;
    DBText20: TDBText;
    DBText21: TDBText;
    DBText22: TDBText;
    Label25: TLabel;
    Label26: TLabel;
    ComboBox6: TComboBox;
    ComboBox2: TComboBox;
    Edit17: TEdit;
    Edit18: TEdit;
    Edit19: TEdit;
    Edit20: TEdit;
    Button15: TButton;
    Button17: TButton;
    Button18: TButton;
    Edit21: TEdit;
    Edit22: TEdit;
    Button19: TButton;
    DBNavigator4: TDBNavigator;
    DateTimePicker5: TDateTimePicker;
    Edit15: TEdit;
    DateTimePicker7: TDateTimePicker;
    DBGrid6: TDBGrid;
    TabSheet3: TTabSheet;
    Label1: TLabel;
    Edit23: TEdit;
    Label13: TLabel;
    DateTimePicker6: TDateTimePicker;
    DateTimePicker8: TDateTimePicker;
    Label14: TLabel;
    DateTimePicker9: TDateTimePicker;
    Label15: TLabel;
    Edit24: TEdit;
    ComboBox7: TComboBox;
    TabSheet5: TTabSheet;
    Button11: TButton;
    Button20: TButton;
    Edit25: TEdit;
    Button14: TButton;
    Edit26: TEdit;
    Edit27: TEdit;
    Edit28: TEdit;
    ComboBox9: TComboBox;
    Button12: TButton;
    Button13: TButton;
    Edit12: TEdit;
    Edit13: TEdit;
    Edit14: TEdit;
    Button6: TButton;
    Button5: TButton;
    Button8: TButton;
    Button7: TButton;
    Button2: TButton;
    Button9: TButton;
    Button1: TButton;
    Button16: TButton;
    Button21: TButton;
    GroupBox2: TGroupBox;
    Button22: TButton;
    Button24: TButton;
    DataSource5: TDataSource;
    ADOQuery5: TADOQuery;
    DBGrid2: TDBGrid;
    Label16: TLabel;
    Label17: TLabel;
    Button23: TButton;
    Button25: TButton;
    GroupBox3: TGroupBox;
    DBNavigator2: TDBNavigator;
    Button26: TButton;
    XPManifest1: TXPManifest;
    Button27: TButton;
    DateTimePicker10: TDateTimePicker;
    Button28: TButton;
    Edit29: TEdit;
    GroupBox6: TGroupBox;
    DBGrid3: TDBGrid;
    DataSource6: TDataSource;
    ADOQuery6: TADOQuery;
    Button30: TButton;
    ADOQuery7: TADOQuery;
    Button29: TButton;
    Button31: TButton;
    Button32: TButton;
    Button33: TButton;
    Button34: TButton;
    ADOQuery8: TADOQuery;
    TabSheet4: TTabSheet;
    GroupBox7: TGroupBox;
    Label29: TLabel;
    Label30: TLabel;
    Button36: TButton;
    Button37: TButton;
    DateTimePicker12: TDateTimePicker;
    Button38: TButton;
    Button39: TButton;
    Button40: TButton;
    Button41: TButton;
    Button35: TButton;
    Button42: TButton;
    Label31: TLabel;
    Edit33: TEdit;
    ADOQuery9: TADOQuery;
    Button43: TButton;
    DBNavigator1: TDBNavigator;
    ADO5int: TADOQuery;
    DBGrid4: TDBGrid;
    DATA5int: TDataSource;
    DBEdit1: TDBEdit;
    Button44: TButton;
    Button45: TButton;
    Button46: TButton;
    StatusBar1: TStatusBar;
    Edit30: TEdit;
    Edit31: TEdit;
    Button47: TButton;
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N21: TMenuItem;
    N3: TMenuItem;
    N11: TMenuItem;
    N22: TMenuItem;
    N4: TMenuItem;
    N12: TMenuItem;
    N23: TMenuItem;
    N31: TMenuItem;
    N41: TMenuItem;
    Button48: TButton;
    Button49: TButton;
    Button50: TButton;
    RadioButton8: TRadioButton;
    Edit32: TEdit;
    Button51: TButton;
    Button52: TButton;
    IdFTP1: TIdFTP;
    Button53: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure Button9Click(Sender: TObject);
    procedure DBGrid1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Button10Click(Sender: TObject);
    procedure Button11Click(Sender: TObject);
    procedure DBGrid3MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure DateTimePicker1Change(Sender: TObject);
    procedure DateTimePicker2Change(Sender: TObject);
    procedure DateTimePicker3Change(Sender: TObject);
    procedure DateTimePicker4Change(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
    procedure ComboBox2Change(Sender: TObject);
    procedure ComboBox3Change(Sender: TObject);
    procedure ComboBox5Change(Sender: TObject);
    procedure ComboBox6Change(Sender: TObject);
    procedure Button14Click(Sender: TObject);
    procedure DateTimePicker5Change(Sender: TObject);
    procedure DateTimePicker7Change(Sender: TObject);
    procedure ComboBox4Change(Sender: TObject);
    procedure Button17Click(Sender: TObject);
    procedure Button18Click(Sender: TObject);
    procedure Button20Click(Sender: TObject);
    procedure ComboBox7Change(Sender: TObject);
    procedure DateTimePicker6Change(Sender: TObject);
    procedure DateTimePicker8Change(Sender: TObject);
    procedure DateTimePicker9Change(Sender: TObject);
    procedure ComboBox9Change(Sender: TObject);
    procedure Button12Click(Sender: TObject);
    procedure Button13Click(Sender: TObject);
    procedure Button21Click(Sender: TObject);
    procedure Button22Click(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
    procedure RadioButton4Click(Sender: TObject);
    procedure RadioButton5Click(Sender: TObject);
    procedure RadioButton6Click(Sender: TObject);
    procedure RadioButton7Click(Sender: TObject);
    procedure Button23Click(Sender: TObject);
    procedure Button25Click(Sender: TObject);
    procedure ComboBox9Enter(Sender: TObject);
    procedure Button24Click(Sender: TObject);
    procedure Button27Click(Sender: TObject);
    procedure Button28Click(Sender: TObject);
    procedure Button30Click(Sender: TObject);
    procedure Button29Click(Sender: TObject);
    procedure Button31Click(Sender: TObject);
    procedure Button32Click(Sender: TObject);
    procedure Button33Click(Sender: TObject);
    procedure Button34Click(Sender: TObject);
    procedure Button42Click(Sender: TObject);
    procedure Button26Click(Sender: TObject);
    procedure Button43Click(Sender: TObject);
    procedure Button44Click(Sender: TObject);
    procedure Button45Click(Sender: TObject);
    procedure Button46Click(Sender: TObject);
    procedure DBGrid2MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Button47Click(Sender: TObject);
    procedure Button49Click(Sender: TObject);
    procedure Button48Click(Sender: TObject);
    procedure Button50Click(Sender: TObject);
    procedure RadioButton8Click(Sender: TObject);
    procedure Button51Click(Sender: TObject);
    procedure Button52Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  ejiaolian:string;
  uc:Integer;
implementation

uses Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit9, Unit10, Unit14, Uxyinf;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
pagecontrol1.Align:=alclient;
dbgrid1.Align:=alclient;
adoquery2.active:=true;

timer1.Enabled:=true;
end;

procedure TForm1.RadioButton1Click(Sender: TObject);
begin
form4.Label1.Caption:=RadioButton1.Caption;
ejiaolian:='吴教练';
uc:=1;
Button27.Click;
end;

procedure TForm1.RadioButton2Click(Sender: TObject);
begin
form4.Label1.Caption:=RadioButton2.Caption;
ejiaolian:='杨教练';
uc:=1;
Button27.Click;

end;

procedure TForm1.RadioButton3Click(Sender: TObject);
begin
form4.Label1.Caption:=RadioButton3.Caption;
ejiaolian:='马教练';
uc:=1;
Button27.Click;

end;

procedure TForm1.RadioButton4Click(Sender: TObject);
begin
form4.Label1.Caption:=RadioButton4.Caption;
ejiaolian:='张教练';
uc:=1;
Button27.Click;
end;

procedure TForm1.RadioButton5Click(Sender: TObject);
begin
form4.Label1.Caption:=RadioButton5.Caption;
ejiaolian:='闫教练';
uc:=1;
Button27.Click;
end;

procedure TForm1.RadioButton6Click(Sender: TObject);
begin
form4.Label1.Caption:=RadioButton6.Caption;
ejiaolian:='孙教练';
uc:=1;
Button27.Click;
end;

procedure TForm1.RadioButton7Click(Sender: TObject);
begin
//-form4.Label1.Caption:=RadioButton7.Caption;
ADOQuery5.Close;
ADOQuery5.SQL.Text:='select * from ulianche where  u练车日期 = '
          '#' StringReplace (datetostr(DateTimePicker10.Date), '/', '-', [rfReplaceAll]) '#' ' '
          'order by usid desc';
ADOQuery5.Open;
ADO5int.Close;
ADO5int.SQL.Text:='select count(*) from ulianche where  u练车日期 = '
          '#' StringReplace (datetostr(DateTimePicker10.Date), '/', '-', [rfReplaceAll]) '#';
ADO5int.Open;
end;

procedure TForm1.RadioButton8Click(Sender: TObject);
begin
form4.Label1.Caption:=RadioButton8.Caption;
ejiaolian:='张磊教';
uc:=1;
Button27.Click;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin

Button1.Caption := IntToStr(StrToIntDef(Button1.Caption, 0) 1);
//label12.Caption:=IntToStr(timer1.interval);
edit1.Text:=IntToStr(timer1.tag);
button2.Click;
//初始化。。。。
PageControl3.Align:=alClient;

//最大化每个窗口
form1.WindowState:=wsMaximized;
form2.WindowState:=wsMaximized;
form3.WindowState:=wsMaximized;
form4.WindowState:=wsMaximized;
form5.WindowState:=wsMaximized;
form6.WindowState:=wsMaximized;
form7.WindowState:=wsMaximized;

timer1.Enabled:=false;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
edit9.Text:='';
edit10.Text:='';
edit11.Text:='';

//edit15.Text:='';
//edit17.Text:='';
//edit18.Text:='';
//edit19.Text:='';
//edit20.Text:='';

edit23.Text:='';
edit26.Text:='';
edit27.Text:='';
edit28.Text:='';
edit24.Text:='';
//日期初始化
DateTimePicker1.Date:=Date();
DateTimePicker2.Date:=Date();
DateTimePicker3.Date:=Date();
DateTimePicker4.Date:=Date();
DateTimePicker5.Date:=Date();
DateTimePicker6.Date:=Date();
DateTimePicker7.Date:=Date();
DateTimePicker8.Date:=Date();
DateTimePicker9.Date:=Date();

//表格初始化
edit16.Text:=DBText12.Caption;
Label16.Caption:=DBText1.Caption;
Label17.Caption:=DBText12.Caption;

//驾校设置初始化
form2.Button1.Click;
ComboBox7.Items:=form2.ComboBox1.Items;
ComboBox3.Items:=form2.ComboBox1.Items;

form3.Button1.Click;

//练车时间初始化
form5.Button1.Click;
form5.ComboBox1.Items:=Form5.DBMemo1.Lines;
DBGrid2.Align:=alClient;
DateTimePicker10.Date:=date();
uc:=0;
//是否通过初始化
 ComboBox9.Items:=ComboBox5.Items;

//学员练车初始化
form4.ComboBox1.Items:=form5.ComboBox1.Items;
form4.ComboBox3.Items:=form3.ComboBox1.Items;
form4.DateTimePicker1.Date:=date();
DateTimePicker1.Date:=date();

//收钱初始化
form6.Button1.Click;
ComboBox1.Items:=form6.ComboBox1.Items;
form4.ComboBox2.Items:=ComboBox1.Items;
//初始化结束
timer1.Enabled:=false;

//账目初始化
DBGrid3.Align:=alClient;

end;

procedure TForm1.Button20Click(Sender: TObject);
begin
edit25.Text:='select * from juser where uid>0  ';
if edit23.Text <> '' then edit25.Text := edit25.Text ' and 驾校=' '''' edit23.Text '''';
if edit26.Text <> '' then edit25.Text := edit25.Text ' and 开始练车 <='
                  '#' StringReplace (edit26.Text, '/', '-', [rfReplaceAll]) '#  and '   '结束练车 >='
                  '#' StringReplace (edit27.Text, '/', '-', [rfReplaceAll]) '#   ' ;
if edit28.Text <> '' then edit25.Text := edit25.Text  ' and 考试日期 ='
                  '#' StringReplace (edit28.Text, '/', '-', [rfReplaceAll]) '#  ';
if edit24.Text <> '' then edit25.Text := edit25.Text ' and 是否通过=' '''' edit24.Text '''';
form14.Edit1.Text:=StringReplace (edit25.Text, 'select * from juser', ' ', [rfReplaceAll]) ;
edit25.Text:=edit25.Text ' order by uid desc' ;
ADOQuery1.Close;
ADOQuery1.SQL.Text:=edit25.Text;
ADOQuery1.Open;

edit33.Text:='select count(*) from juser where uid>0  ';
if edit23.Text <> '' then edit33.Text := edit33.Text ' and 驾校=' '''' edit23.Text '''';
if edit26.Text <> '' then edit33.Text := edit33.Text ' and 开始练车 <='
                  '#' StringReplace (edit26.Text, '/', '-', [rfReplaceAll]) '#  and '   '结束练车 >='
                  '#' StringReplace (edit27.Text, '/', '-', [rfReplaceAll]) '#   ' ;
if edit28.Text <> '' then edit33.Text := edit33.Text  ' and 考试日期 ='
                  '#' StringReplace (edit28.Text, '/', '-', [rfReplaceAll]) '#  ';
if edit24.Text <> '' then edit33.Text := edit33.Text ' and 是否通过=' '''' edit24.Text '''';
ADOQuery9.Close;
ADOQuery9.SQL.Text:=edit33.Text;
ADOQuery9.Open;
Label31.Caption:=ADOQuery9.FieldValues['Expr1000'];
Label31.Caption:='一共 【' Label31.Caption '】个学员';
form1.PageControl3.TabIndex:=2;
form1.PageControl3.ActivePage.Show;
end;

procedure TForm1.Button21Click(Sender: TObject);
var
tf:textfile;
ln:string;
begin
assignfile(tf,'c:\xueyuan\temp.txt');
rewrite(tf);
ADOQuery1.First;
while not ADOQuery1.eof do begin
ln:=ADOQuery1.FieldValues['名字'];
ln := dupestring(' ',5-length(ln))  ln;
//ln := Format('%8s',[ln]);
ln:=ln ' ' ADOQuery1.FieldValues['电话'];
ln:=ln ' ' ADOQuery1.FieldValues['驾校'];
ln:=ln #13#10;
writeln(tf,ln);
ADOQuery1.next
end;
closefile(tf);
end;

procedure TForm1.Button22Click(Sender: TObject);
begin
{
if RadioButton1.Enabled=true then form4.Label1.Caption:=RadioButton1.Caption;
if RadioButton2.Enabled=true then form4.Label1.Caption:=RadioButton2.Caption;
if RadioButton3.Enabled=true then form4.Label1.Caption:=RadioButton3.Caption;
if RadioButton4.Enabled=true then form4.Label1.Caption:=RadioButton4.Caption;
if RadioButton5.Enabled=true then form4.Label1.Caption:=RadioButton5.Caption;
if RadioButton6.Enabled=true then form4.Label1.Caption:=RadioButton6.Caption;
if RadioButton7.Enabled=true then form4.Label1.Caption:=RadioButton7.Caption; }

//form4.Button2.Click;

if not ADOQuery5.Eof then
begin
form4.edit1.Text:=form1.ADOQuery5.FieldValues['uid'];
form4.edit2.Text:=form1.ADOQuery5.FieldValues['u名字'];
end
else
begin
form4.Edit1.Text:=DBText12.Caption;
form4.Edit2.Text:=DBText1.Caption;
end;
form4.Edit6.Text:=form1.DBText9.Caption;
form4.Edit8.Text:=form4.DBText3.Caption;
form4.Button2.Click;
form4.Show;

end;

procedure TForm1.Button23Click(Sender: TObject);
begin
form5.Show;
end;

procedure TForm1.Button24Click(Sender: TObject);
begin
ADOQuery5.Delete;
end;

procedure TForm1.Button25Click(Sender: TObject);
begin
combobox9.DroppedDown := True;
end;

procedure TForm1.Button26Click(Sender: TObject);
begin

form4.Edit1.Text:=DBText12.Caption;
form4.Edit2.Text:=DBText1.Caption;
form4.Edit6.Text:=form1.DBText9.Caption;
form4.Edit8.Text:=form4.DBText3.Caption;
form4.Button2.Click;
form4.Show;

end;

procedure TForm1.Button27Click(Sender: TObject);
begin
//ejiaolian:='吴教练';
if uc=1 then
begin
ADOQuery5.Close;
ADOQuery5.SQL.Text:='select * from ulianche where u教练 = '
          '''' ejiaolian '''' 'and u练车日期 = '
          '#' StringReplace (datetostr(DateTimePicker10.Date), '/', '-', [rfReplaceAll]) '#' ' '
          'order by usid desc';
ADOQuery5.Open;
ADO5int.Close;
ADO5int.SQL.Text:='select count(*) from ulianche where u教练 = '
          '''' ejiaolian '''' 'and u练车日期 = '
          '#' StringReplace (datetostr(DateTimePicker10.Date), '/', '-', [rfReplaceAll]) '#';
ADO5int.Open;
//Label21.Caption:=ADO5int.FieldValues['Expr1000'] '人';
uc:=0;
end
else
begin
  uc:=0;
  form7.Show;
end;
edit29.Text:=ADOQuery5.SQL.Text;
end;

procedure TForm1.Button28Click(Sender: TObject);
begin

if Button28.Caption <> '关闭教练' then
begin
 Button28.Caption:='关闭教练';
 GroupBox4.Visible:=False;

end
 else
 begin
 Button28.Caption:='打开教练';
 GroupBox4.Visible:=true;
 end;
 end;

procedure TForm1.Button29Click(Sender: TObject);
begin
form1.PageControl3.TabIndex:=1;
form1.PageControl3.ActivePage.Show;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
{

}

end;

procedure TForm1.Button30Click(Sender: TObject);
begin
PlaySound(PChar('C:\xueyuan\cg.wav'),0, SND_ASYNC);
end;

procedure TForm1.Button31Click(Sender: TObject);
begin
DateTimePicker10.Date:=date();
edit29.Text:=datetostr(DateTimePicker1.Date) ;
uc:=1;
Button27.Click;
end;

procedure TForm1.Button32Click(Sender: TObject);
begin
DateTimePicker10.Date:=DateTimePicker10.Date-1;
uc:=1;
Button27.Click;
end;

procedure TForm1.Button33Click(Sender: TObject);
begin
DateTimePicker10.Date:=DateTimePicker10.Date 1;
uc:=1;
Button27.Click;
{if RadioButton1.TabStop=true then
begin

//uc:=1;
//Button27.Click;;
end; }
//edit29.text := DatetimetoStr(IncMonth(datetimepicker1.date,1));
//DateTimePicker1:=IncDay(DateTimePicker1.date,1);
//DateTimePicker1.date 1;
end;

procedure TForm1.Button34Click(Sender: TObject);
begin
//form4.Edit1.Text:=DBText12.Caption;
//form4.Edit2.Text:=DBText1.Caption;
Button3.Click;

form1.PageControl3.TabIndex:=0;
form1.PageControl3.ActivePage.Show;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
edit1.Text:=dbtext1.Caption;
edit2.Text:=dbtext2.Caption;
edit3.Text:=dbtext3.Caption;
edit4.Text:=dbtext4.Caption;
edit5.Text:=dbtext5.Caption;
edit6.Text:=dbtext6.Caption;
edit7.Text:=dbtext7.Caption;
edit8.Text:=dbtext8.Caption;
edit9.Text:=dbtext9.Caption;
edit10.Text:=dbtext10.Caption;
edit11.Text:=dbtext11.Caption;
edit16.Text:=DBText12.Caption;
end;

procedure TForm1.Button42Click(Sender: TObject);
begin
form9.show;
end;

procedure TForm1.Button43Click(Sender: TObject);
begin
form10.Edit1.Text:=ADOQuery6.FieldValues['Zid'];
form10.Edit2.Text:=ADOQuery6.FieldValues['Z名字'];
form10.Edit3.Text:=ADOQuery6.FieldValues['Z账目内容'];
form10.Edit4.Text:=ADOQuery6.FieldValues['Z金额'];
form10.Edit5.Text:=DateToStr(Date());
form10.Edit6.Text:=ADOQuery6.FieldValues['Zuid'];
form10.Show;
end;

procedure TForm1.Button44Click(Sender: TObject);
begin
form14.show;
end;

procedure TForm1.Button45Click(Sender: TObject);
begin
form14.Show;
end;

procedure TForm1.Button46Click(Sender: TObject);
begin
xyinf.show;
end;

procedure TForm1.Button47Click(Sender: TObject);
begin
ADOQuery6.Close;
ADOQuery6.Open;
end;

procedure TForm1.Button48Click(Sender: TObject);
begin
form10.Edit6.Text:=ADOQuery5.FieldValues['uid'];
form10.Edit2.Text:=ADOQuery5.FieldValues['u名字'];
form10.Edit3.Text:=ADOQuery6.FieldValues['Z账目内容'];
form10.Edit4.Text:=ADOQuery6.FieldValues['Z金额'];
form10.Edit5.Text:=DateToStr(Date());
//form10.Edit6.Text:=ADOQuery6.FieldValues['Zuid'];
form10.Show;
end;

procedure TForm1.Button49Click(Sender: TObject);
begin
form10.Edit6.Text:=ADOQuery1.FieldValues['uid'];
form10.Edit2.Text:=ADOQuery1.FieldValues['名字'];
form10.Edit3.Text:=ADOQuery6.FieldValues['Z账目内容'];
form10.Edit4.Text:=ADOQuery6.FieldValues['Z金额'];
form10.Edit5.Text:=DateToStr(Date());
//form10.Edit6.Text:=ADOQuery6.FieldValues['Zuid'];
form10.Show;
end;

procedure TForm1.Button4Click(Sender: TObject);

var
 ed5:String;
begin
ADOQuery1.Close;

ed5:='update juser set '    '名字=' '''' edit1.text '''' ','
                      '电话=' '''' edit2.text '''' ','
                      '驾校=' '''' edit3.text '''' ','
                      '考场=' '''' edit4.text '''' ','
                      '考试日期=' ''''
                      StringReplace (edit5.Text, '/', '-', [rfReplaceAll])
                        ''''

                      ',' '模拟日期=' ''''
                      StringReplace (edit6.Text, '/', '-', [rfReplaceAll])
                      '''' ','
                      '开始练车='
                      ''''
                      StringReplace (edit7.Text, '/', '-', [rfReplaceAll])
                      '''' ','
                      '结束练车='
                      ''''
                      StringReplace (edit8.Text, '/', '-', [rfReplaceAll])
                      '''' ','
                      '练车几天=' '''' edit9.text '''' ','
                      '第几次考=' '''' edit10.text '''' ','
                      '是否通过=' '''' edit11.text ''''

                      ' where uid= ' edit16.Text ;
//edit15.Text:=ed5;

ADOQuery7.SQL.Text:= ed5;
ADOQuery7.ExecSQL;
ADOQuery1.Open;
form1.PageControl3.TabIndex:=2;
form1.PageControl3.ActivePage.Show;
end;

procedure TForm1.Button50Click(Sender: TObject);
begin
form9.Edit2.Text:=ADOQuery5.FieldValues['uid'];
form9.Button4.Click;
form9.Show;
end;

procedure TForm1.Button51Click(Sender: TObject);
var
   namestr:string;
begin
//ADOQuery1.First;
namestr:=edit30.Text ;
  ADOQuery1.Next;
while not ADOQuery1.Eof do
begin
  if  Pos(namestr,ADOQuery1.FieldValues['名字'])>0  then
  begin
  Break;

  end;
  ADOQuery1.Next;
end;
end;

procedure TForm1.Button52Click(Sender: TObject);
begin
ADOQuery1.First;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
edit12.Text:='2018/12/8';
end;

procedure TForm1.Button6Click(Sender: TObject);
begin

//2018 / 12 / 8
edit13.Text:=LeftStr(edit12.Text,4)
              '-'
             MidStr(edit12.Text,6,2)
              '-'
             MidStr(edit12.Text,9,2);

end;

procedure TForm1.Button7Click(Sender: TObject);
begin
edit14.Text:=TimeToStr(Time());
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
edit12.Text:=StringReplace (edit12.Text, '/', '-', [rfReplaceAll])
end;

procedure TForm1.Button9Click(Sender: TObject);
begin
form6.show;
//edit15.Text:=DBText12.Caption;
{
'update juser set '
                      '名字=' '''' edit1.text '''' ','
                      '电话=' '''' edit2.text '''' ','
                      '驾校=' '''' edit3.text '''' ','
                      '考场=' '''' edit4.text '''' ','
                      '考试日期=' ''''
                      StringReplace (edit5.Text, '/', '-', [rfReplaceAll])
                        ''''
                      { ','
                      '模拟日期=' '''' edit6.text '''' ','
                      '开始练车=' '''' edit7.text '''' ','
                      '结束练车=' '''' edit8.text '''' ','
                      '练车几天=' '''' edit9.text '''' ','
                      '第几次考=' '''' edit10.text '''' ','
                      '是否通过=' '''' edit11.text '''' 

                      ' where uid=' DBText12.Caption;   }
end;

procedure TForm1.DBGrid1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
edit16.Text:=DBText12.Caption;
Label16.Caption:=DBText1.Caption;
Label17.Caption:=DBText12.Caption;

//显示复制的信息
edit30.Text:='k3' DateToStr(ADOQuery1.FieldValues['考试日期'])
              ADOQuery1.FieldValues['名字']
              ADOQuery1.FieldValues['驾校']
              ADOQuery1.FieldValues['考场'] ;

Edit30.Text:=StringReplace(edit30.Text , '/', '.', [rfReplaceAll]);
Edit30.Text:=StringReplace(edit30.Text , '201', '1', [rfReplaceAll]);
Edit30.Text:=StringReplace(edit30.Text , '驾校', '', [rfReplaceAll]);
Edit30.Text:=StringReplace(edit30.Text , '考场', '', [rfReplaceAll]);
Edit31.Text:=ADOQuery1.FieldValues['电话'];

// StringReplace (DateToStr(ADOQuery1.FieldValues['考试日期']), '/', '.', [rfReplaceAll])
if not ADOQuery1.Eof then
begin
xyinf.Edit1.Text:=ADOQuery1.FieldValues['uid'];
xyinf.Button1.Click;
end;
//GroupBox2.Caption:='学员名:' DBText1.Caption;
//Edit17.Text:= DBText1.Caption;
//Edit22.Text:=DBText12.Caption;

end;

procedure TForm1.DBGrid2MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin

if not ADOQuery5.Eof then
begin
xyinf.Edit1.Text:=ADOQuery5.FieldValues['uid'];
xyinf.Button1.Click;
end;

end;

procedure TForm1.Button10Click(Sender: TObject);
var
 ed6:String;
begin
ADOQuery1.Close;

ed6:='insert into juser '
                      '(名字,电话,驾校,考场,考试日期,模拟日期,开始练车,结束练车,练车几天,第几次考,'
                      '是否通过)'
                      'values('
                      '''' edit1.text '''' ','
                      '''' edit2.text '''' ','
                      '''' edit3.text '''' ','
                      '''' edit4.text '''' ','
                      ''''
                      StringReplace (edit5.Text, '/', '-', [rfReplaceAll])
                      '''' ','
                      ''''
                      StringReplace (edit6.Text, '/', '-', [rfReplaceAll])
                      '''' ','
                      ''''
                      StringReplace (edit7.Text, '/', '-', [rfReplaceAll])
                      '''' ','
                      ''''
                      StringReplace (edit8.Text, '/', '-', [rfReplaceAll])
                      '''' ','
                      '''' edit9.text '''' ','
                      '''' edit10.text '''' ','
                      '''' edit11.text ''''

                      ')' ;
//edit15.Text:=ed6;

ADOQuery7.SQL.Text:= ed6;
ADOQuery7.ExecSQL;
ADOQuery1.Open;
Button30.Click;
end;

procedure TForm1.Button11Click(Sender: TObject);

begin
form2.Show;
end;

procedure TForm1.Button12Click(Sender: TObject);
begin
edit26.Text:=datetostr(date()) ;
edit27.Text:=datetostr(date()) ;
end;

procedure TForm1.Button13Click(Sender: TObject);
begin
edit23.Text:='';
edit24.Text:='';
edit26.Text:='';
edit27.Text:='';
edit28.Text:='';
end;

procedure TForm1.DBGrid3MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
//Edit21.Text:=DBText17.Caption;

if not ADOQuery6.Eof then
begin
xyinf.Edit1.Text:=ADOQuery6.FieldValues['zuid'];
xyinf.Button1.Click;
end;

end;

procedure TForm1.DateTimePicker1Change(Sender: TObject);
begin
Edit5.Text:=DateToStr(DateTimePicker1.date);
end;

procedure TForm1.DateTimePicker2Change(Sender: TObject);
begin
Edit6.Text:=DateToStr(DateTimePicker2.date);
end;

procedure TForm1.DateTimePicker3Change(Sender: TObject);
begin
Edit7.Text:=DateToStr(DateTimePicker3.date);
end;

procedure TForm1.DateTimePicker4Change(Sender: TObject);
begin
Edit8.Text:=DateToStr(DateTimePicker4.date);
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
Edit9.Text:=ComboBox1.Text;
end;

procedure TForm1.ComboBox2Change(Sender: TObject);
begin
edit19.Text:=ComboBox2.Text;
end;

procedure TForm1.ComboBox3Change(Sender: TObject);
begin
edit3.Text:=ComboBox3.Text;
end;

procedure TForm1.ComboBox4Change(Sender: TObject);
begin
Edit4.Text:=ComboBox4.Text;
end;

procedure TForm1.ComboBox5Change(Sender: TObject);
begin
edit11.Text:=ComboBox5.Text;
end;

procedure TForm1.ComboBox6Change(Sender: TObject);
begin
edit20.Text:=ComboBox6.Text;
end;

procedure TForm1.ComboBox7Change(Sender: TObject);
begin
edit23.Text:=ComboBox7.Text;
end;

procedure TForm1.ComboBox9Change(Sender: TObject);
begin

edit24.Text:=ComboBox9.Text;
end;

procedure TForm1.ComboBox9Enter(Sender: TObject);
begin
combobox9.DroppedDown:=true;
end;

procedure TForm1.Button14Click(Sender: TObject);
begin
//edit17.Text:=DBText13.Caption;
form3.Show;
end;

procedure TForm1.Button17Click(Sender: TObject);

var
 ed5:String;
begin
ADOQuery3.Close;

ed5:='update ulianche set '
                      'uid=' edit22.text ','
                      'u名字=' '''' Edit17.Text '''' ','
                      'u练车日期=' ''''
                      StringReplace (edit18.Text, '/', '-', [rfReplaceAll])
                        '''' ','
                      'u练车时间=' '''' edit19.text '''' ','
                      'u教练=' '''' edit20.text ''''
                      ' where usid= ' edit21.Text ;
edit15.Text:=ed5;

ADOQuery3.SQL.Text:= ed5;
ADOQuery3.ExecSQL;
ADOQuery3.SQL.Text:='select * from ulianche';
ADOQuery3.Open;

end;

procedure TForm1.Button18Click(Sender: TObject);

var
 ed5:String;
begin
ADOQuery3.Close;

ed5:='insert into ulianche '
                      '(uid,u名字,u练车日期,u练车时间,u教练)'
                      'values('
                      edit22.Text ','
                      '''' edit17.text '''' ','

                      ''''
                      StringReplace (edit18.Text, '/', '-', [rfReplaceAll])
                        '''' ','
                      '''' edit19.text '''' ','
                      '''' edit20.text '''' ')'
                      ;
edit15.Text:=ed5;

ADOQuery3.SQL.Text:= ed5;
ADOQuery3.ExecSQL;
ADOQuery3.SQL.Text:='select * from ulianche';
ADOQuery3.Open;
end;

procedure TForm1.DateTimePicker5Change(Sender: TObject);
begin
Edit18.Text:=DateToStr(DateTimePicker5.date);
end;

procedure TForm1.DateTimePicker6Change(Sender: TObject);
begin
edit26.Text:= datetostr( DateTimePicker6.Date);
end;

procedure TForm1.DateTimePicker7Change(Sender: TObject);
begin
edit15.Text:=datetostr( DateTimePicker7.date);
ADOQuery3.Close;
ADOQuery3.SQL.Text:='select * from ulianche where u练车日期 =  #' edit15.Text '# ';
ADOQuery3.Open;

end;

procedure TForm1.DateTimePicker8Change(Sender: TObject);
begin
edit27.Text:= datetostr( DateTimePicker8.Date);
end;

procedure TForm1.DateTimePicker9Change(Sender: TObject);
begin
edit28.Text:=datetostr(DateTimePicker9.Date)
end;

end.

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复