⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drive_card_report.~pas

📁 软件类别: 数据库 软件大小: 2.60M 运行环境: Win9xNT/2000/XP 一套车辆管理系统,此版本为商业版,大家一定用的着。
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
        DateTimePicker3.Visible:=False;
        DateTimePicker4.Visible:=False;
        Label2.Visible:=False;
    end;
end;

procedure Tfrm_Drive_Card_Report.CheckBox11Click(Sender: TObject);
begin
    Edit5.Clear;
    Edit6.Clear;
    if CheckBox11.Checked=True then
    begin
        Edit5.Visible:=True;
        Edit6.Visible:=True;
        DateTimePicker5.Visible:=True;
        DateTimePicker6.Visible:=True;
        Label3.Visible:=True;
    end
    else
    begin
        Edit5.Visible:=False;
        Edit6.Visible:=False;
        DateTimePicker5.Visible:=False;
        DateTimePicker6.Visible:=False;
        Label3.Visible:=False;
    end;
end;

procedure Tfrm_Drive_Card_Report.DateTimePicker1Change(Sender: TObject);
begin
    Edit1.Text:=ForMatDateTime('yyyy''-''mm''-''dd',DateTimePicker1.DateTime);
end;

procedure Tfrm_Drive_Card_Report.DateTimePicker2Change(Sender: TObject);
begin
    Edit2.Text:=ForMatDateTime('yyyy''-''mm''-''dd',DateTimePicker2.DateTime);
end;

procedure Tfrm_Drive_Card_Report.DateTimePicker3Change(Sender: TObject);
begin
    Edit3.Text:=ForMatDateTime('yyyy''-''mm''-''dd',DateTimePicker3.DateTime);
end;

procedure Tfrm_Drive_Card_Report.DateTimePicker4Change(Sender: TObject);
begin
    Edit4.Text:=ForMatDateTime('yyyy''-''mm''-''dd',DateTimePicker4.DateTime);
end;

procedure Tfrm_Drive_Card_Report.DateTimePicker5Change(Sender: TObject);
begin
    Edit5.Text:=ForMatDateTime('yyyy''-''mm''-''dd',DateTimePicker5.DateTime);
end;

procedure Tfrm_Drive_Card_Report.DateTimePicker6Change(Sender: TObject);
begin
    Edit6.Text:=ForMatDateTime('yyyy''-''mm''-''dd',DateTimePicker6.DateTime);
end;

procedure Tfrm_Drive_Card_Report.Cmd_SearchClick(Sender: TObject);
begin
    inherited;
    tempsql:='Select * from [Drive_Card] where ';
    if Trim(ComboBox1.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_ID Like '+''''+'%'+ Trim(ComboBox1.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox2.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_Man Like '+''''+'%'+ Trim(ComboBox2.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox3.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_Card_Type Like '+''''+'%'+ Trim(ComboBox3.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox4.Text)<>'' then
    begin
        tempSql:=tempSql+' SEX Like '+''''+'%'+ Trim(ComboBox4.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox5.Text)<>'' then
    begin
        tempSql:=tempSql+' Send_Mond Like '+''''+'%'+ Trim(ComboBox5.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox6.Text)<>'' then
    begin
        tempSql:=tempSql+' Send_Date = '+''''+ Trim(ComboBox6.Text)+''''+' and ';
    end;
    if Trim(ComboBox7.Text)<>'' then
    begin
        tempSql:=tempSql+' Value_Date = '+''''+ Trim(ComboBox7.Text)+''''+' and ';
    end;
    if Trim(ComboBox8.Text)<>'' then
    begin
        tempSql:=tempSql+' Record_Date = '+''''+ Trim(ComboBox8.Text)+''''+' and ';
    end;
    if CheckBox9.Checked=True then
    begin
        if Trim(Edit1.Text)<>'' then
        begin
            tempSql:=tempSql+' Send_Date between '''+Trim(Edit1.Text)+''' and '''+Trim(Edit2.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit1.SetFocus;
            Exit;
        end;
    end;
    if CheckBox10.Checked=True then
    begin
        if Trim(Edit3.Text)<>'' then
        begin
            tempSql:=tempSql+' Value_Date between '''+Trim(Edit3.Text)+''' and '''+Trim(Edit4.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit3.SetFocus;
            Exit;
        end;
    end;
    if CheckBox11.Checked=True then
    begin
        if Trim(Edit5.Text)<>'' then
        begin
            tempSql:=tempSql+' Record_Date between '''+Trim(Edit5.Text)+''' and '''+Trim(Edit6.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit5.SetFocus;
            Exit;
        end;
    end;
    tempSql:=Copy(tempSql,0,length(tempSql)-4);
    with frm_data.Query_Drive_Card do
    begin
        Close;
        Sql.Clear;
        Sql.Add(tempSql);
        Prepared;
        Open;
        if frm_data.Query_Drive_Card.RecordCount<>0 then
        begin
            Cmd_Preview.Enabled:=True;
            Cmd_Print.Enabled:=True;
            Showmessage('符合条件的记录有:'+IntToStr(frm_data.Query_Drive_Card.RecordCount)+'条');
        end
        else
        begin
            Cmd_Preview.Enabled:=False;
            Cmd_Print.Enabled:=False;
            Showmessage('符合条件的记录有:'+IntToStr(frm_data.Query_Drive_Card.RecordCount)+'条');
        end;
    end;
end;

procedure Tfrm_Drive_Card_Report.Cmd_PreviewClick(Sender: TObject);
begin
    inherited;
    tempsql:='Select * from [Drive_Card] where ';
    if Trim(ComboBox1.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_ID Like '+''''+'%'+ Trim(ComboBox1.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox2.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_Man Like '+''''+'%'+ Trim(ComboBox2.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox3.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_Card_Type Like '+''''+'%'+ Trim(ComboBox3.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox4.Text)<>'' then
    begin
        tempSql:=tempSql+' SEX Like '+''''+'%'+ Trim(ComboBox4.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox5.Text)<>'' then
    begin
        tempSql:=tempSql+' Send_Mond Like '+''''+'%'+ Trim(ComboBox5.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox6.Text)<>'' then
    begin
        tempSql:=tempSql+' Send_Date = '+''''+ Trim(ComboBox6.Text)+''''+' and ';
    end;
    if Trim(ComboBox7.Text)<>'' then
    begin
        tempSql:=tempSql+' Value_Date = '+''''+ Trim(ComboBox7.Text)+''''+' and ';
    end;
    if Trim(ComboBox8.Text)<>'' then
    begin
        tempSql:=tempSql+' Record_Date = '+''''+ Trim(ComboBox8.Text)+''''+' and ';
    end;
    if CheckBox9.Checked=True then
    begin
        if Trim(Edit1.Text)<>'' then
        begin
            tempSql:=tempSql+' Send_Date between '''+Trim(Edit1.Text)+''' and '''+Trim(Edit2.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit1.SetFocus;
            Exit;
        end;
    end;
    if CheckBox10.Checked=True then
    begin
        if Trim(Edit3.Text)<>'' then
        begin
            tempSql:=tempSql+' Value_Date between '''+Trim(Edit3.Text)+''' and '''+Trim(Edit4.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit3.SetFocus;
            Exit;
        end;
    end;
    if CheckBox11.Checked=True then
    begin
        if Trim(Edit5.Text)<>'' then
        begin
            tempSql:=tempSql+' Record_Date between '''+Trim(Edit5.Text)+''' and '''+Trim(Edit6.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit5.SetFocus;
            Exit;
        end;
    end;
    tempSql:=Copy(tempSql,0,length(tempSql)-4);
    with frm_data.Query_Drive_Card do
    begin
        Close;
        Sql.Clear;
        Sql.Add(tempSql);
        Prepared;
        Open;
        frm_Preview:=Tfrm_Preview.Create(self);
        frm_ReportInFormation:=Tfrm_ReportInFormation.Create(self);
        frm_ReportInFormation.L_DriveCard_HeaderTitle.Caption:=func.Use_mond+frm_ReportInFormation.L_DriveCard_HeaderTitle.Caption;
        frm_ReportInFormation.lab_DriveCard_Ren.Caption:=frm_ReportInFormation.lab_DriveCard_Ren.Caption+func.Login_Name;
        frm_ReportInFormation.Lab_DriveCard_Time.Caption:=frm_ReportInFormation.Lab_DriveCard_Time.Caption+formatdatetime('yyyy''-''mm''-''dd',now);
        frm_ReportInFormation.QuickRep_DriveCard.Prepare;
        frm_Preview.ShowModal(frm_ReportInFormation.QuickRep_DriveCard,'驾照信息报表');
    end;
end;

procedure Tfrm_Drive_Card_Report.Cmd_PrintClick(Sender: TObject);
begin
    inherited;
    tempsql:='Select * from [Drive_Card] where ';
    if Trim(ComboBox1.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_ID Like '+''''+'%'+ Trim(ComboBox1.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox2.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_Man Like '+''''+'%'+ Trim(ComboBox2.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox3.Text)<>'' then
    begin
        tempSql:=tempSql+' Drive_Card_Type Like '+''''+'%'+ Trim(ComboBox3.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox4.Text)<>'' then
    begin
        tempSql:=tempSql+' SEX Like '+''''+'%'+ Trim(ComboBox4.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox5.Text)<>'' then
    begin
        tempSql:=tempSql+' Send_Mond Like '+''''+'%'+ Trim(ComboBox5.Text)+'%'+''''+' and ';
    end;
    if Trim(ComboBox6.Text)<>'' then
    begin
        tempSql:=tempSql+' Send_Date = '+''''+ Trim(ComboBox6.Text)+''''+' and ';
    end;
    if Trim(ComboBox7.Text)<>'' then
    begin
        tempSql:=tempSql+' Value_Date = '+''''+ Trim(ComboBox7.Text)+''''+' and ';
    end;
    if Trim(ComboBox8.Text)<>'' then
    begin
        tempSql:=tempSql+' Record_Date = '+''''+ Trim(ComboBox8.Text)+''''+' and ';
    end;
    if CheckBox9.Checked=True then
    begin
        if Trim(Edit1.Text)<>'' then
        begin
            tempSql:=tempSql+' Send_Date between '''+Trim(Edit1.Text)+''' and '''+Trim(Edit2.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit1.SetFocus;
            Exit;
        end;
    end;
    if CheckBox10.Checked=True then
    begin
        if Trim(Edit3.Text)<>'' then
        begin
            tempSql:=tempSql+' Value_Date between '''+Trim(Edit3.Text)+''' and '''+Trim(Edit4.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit3.SetFocus;
            Exit;
        end;
    end;
    if CheckBox11.Checked=True then
    begin
        if Trim(Edit5.Text)<>'' then
        begin
            tempSql:=tempSql+' Record_Date between '''+Trim(Edit5.Text)+''' and '''+Trim(Edit6.Text)+''''+' and ';
        end
        else
        begin
            Application.MessageBox('操作错误,已经选择了按时间段查询,开始时间不能为空',''mb_ok);
            Edit5.SetFocus;
            Exit;
        end;
    end;
    tempSql:=Copy(tempSql,0,length(tempSql)-4);
    with frm_data.Query_Drive_Card do
    begin
        Close;
        Sql.Clear;
        Sql.Add(tempSql);
        Prepared;
        Open;
        frm_Preview:=Tfrm_Preview.Create(self);
        frm_ReportInFormation:=Tfrm_ReportInFormation.Create(self);
        frm_ReportInFormation.L_DriveCard_HeaderTitle.Caption:=func.Use_mond+frm_ReportInFormation.L_DriveCard_HeaderTitle.Caption;
        frm_ReportInFormation.lab_DriveCard_Ren.Caption:=frm_ReportInFormation.lab_DriveCard_Ren.Caption+func.Login_Name;
        frm_ReportInFormation.Lab_DriveCard_Time.Caption:=frm_ReportInFormation.Lab_DriveCard_Time.Caption+formatdatetime('yyyy''-''mm''-''dd',now);
        frm_ReportInFormation.QuickRep_DriveCard.Prepare;
        frm_Preview.ShowModal(frm_ReportInFormation.QuickRep_DriveCard,'驾照信息报表');
    end;
end;

procedure Tfrm_Drive_Card_Report.Cmd_CancelClick(Sender: TObject);
begin
    Close;
end;

procedure Tfrm_Drive_Card_Report.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
    action:=cafree;
end;

procedure Tfrm_Drive_Card_Report.Cmd_ExitClick(Sender: TObject);
begin
    Cmd_Preview.Enabled:=False;
    Cmd_Print.Enabled:=False;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -