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

📄 u_apply.pas

📁 delphi编的排课管理系统
💻 PAS
字号:
unit u_apply;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGridEh, ExtCtrls, DBCtrls, StdCtrls, Buttons, DB,
  DBTables;

type
  Tf_apply = class(TForm)
    DBGridEh1: TDBGridEh;
    DBGridEh2: TDBGridEh;
    DBNavigator1: TDBNavigator;
    Panel1: TPanel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    cb: TCheckBox;
    e_kc: TDBLookupComboBox;
    e_star_week: TEdit;
    e_week_time: TEdit;
    e_room: TDBLookupComboBox;
    e_tec: TDBLookupComboBox;
    e_jion_class: TDBLookupComboBox;
    Bevel1: TBevel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    DBNavigator2: TDBNavigator;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    t_class: TTable;
    ds_class: TDataSource;
    DBText1: TDBText;
    Label5: TLabel;
    Bevel2: TBevel;
    DBText2: TDBText;
    Label1: TLabel;
    DBText3: TDBText;
    DBText4: TDBText;
    DBText5: TDBText;
    DBText6: TDBText;
    DBText7: TDBText;
    procedure FormShow(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure cbClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_apply: Tf_apply;
  lsh:integer;

implementation
uses   u_data;
{$R *.dfm}

procedure Tf_apply.FormShow(Sender: TObject);
begin
 t_class.Open;
 with datamodule1 do
  begin
   tb_apply.open;
   lsh:=tb_apply.RecordCount ;
   tb_apply.Close;
   tb_class.Open;
   tb_apply.Open;
   tb_room.Open;
   tb_tec.Open;
   tb_kc.Open;
  end;
end;

procedure Tf_apply.BitBtn1Click(Sender: TObject);
var
i:integer;
begin
  with datamodule1 do
  begin
  lsh:=lsh+1;
  tb_apply.Open;
  i:=tb_apply.RecordCount ;
  tb_apply.Append;
  tb_apply['id']:=i;
  tb_apply['lsh']:=lsh;
  tb_apply['class']:=dbgrideh1.Fields[1].Text ;
  tb_apply['kc_na']:=e_kc.Text ;
  tb_apply['kc_name']:=dbtext7.Caption ;
  tb_apply['star_week']:=strtoint(e_star_week.Text );
  tb_apply['week_time']:=strtoint(e_week_time.Text );
  tb_apply['code']:=dbtext3.Caption ; //课程代码;
  tb_apply['xueshi']:=strtoint(dbtext1.Caption) ;
  tb_apply['room']:=e_room.Text ;
  tb_apply['room_code']:=dbtext4.Caption ;
  tb_apply['tech']:=e_tec.Text ;
  tb_apply['tech_code']:=dbtext6.Caption ;
  tb_apply['kind']:=dbtext2.Caption ;
  tb_apply['ready']:=strtoint(dbtext1.Caption);

  if cb.Checked =true then
  begin
  tb_apply['jion_sing']:=true;
  tb_apply['jion_class']:=e_jion_class.Text ;
  tb_apply['j_code']:=dbtext5.Caption ;
  end else
  begin
  tb_apply['jion_sing']:=false;
  tb_apply['jion_class']:='';
  tb_apply['j_code']:=null;
  end;
  query1.Close;
  tb_apply.Post ;
  tb_apply.Close;
  tb_apply.Open;
  
  end;
  end;

procedure Tf_apply.BitBtn3Click(Sender: TObject);
begin
  with datamodule1 do
  begin
  tb_class.Close;
  tb_kc.Close;
  tb_room.Close;
  tb_apply.Close;
  tb_tec.Close;
  end;
close;
end;

procedure Tf_apply.SpeedButton2Click(Sender: TObject);
begin
 with datamodule1 do
  begin
   tb_class.Open;
   
   end;
end;

procedure Tf_apply.SpeedButton1Click(Sender: TObject);
begin
 with datamodule1 do
  begin
  tb_class.Close;
  
   end;
   
end;

procedure Tf_apply.BitBtn2Click(Sender: TObject);
begin
lsh:=lsh-1;
datamodule1.tb_apply.Delete ;
  
end;

procedure Tf_apply.cbClick(Sender: TObject);
begin
if cb.Checked =true then
e_jion_class.Enabled :=true else
e_jion_class.Enabled :=false;
end;

end.

⌨️ 快捷键说明

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