📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls,DateUtils, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
DateTimePicker1: TDateTimePicker;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Image1: TImage;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i,k,l:integer;
begin
if(strtodate('2003-11-12')>DateTimePicker1.Time)then
begin
i:=daysbetween(strtodate('2003-11-12'),DateTimePicker1.Time)+1;
l:=i mod 8;
case l of
0:begin
label3.Caption :='甲班第一个白班';
label4.Caption :='乙班第一个中班';
label5.Caption :='丙班第一个夜班';
label6.Caption :='丁班第一个休息';
end;
1:begin
label3.Caption :='甲班第二个休息';
label4.Caption :='乙班第二个白班';
label5.Caption :='丙班第二个中班';
label6.Caption :='丁班第二个夜班';
end;
2:begin
label3.Caption :='甲班第一个休息';
label4.Caption :='乙班第一个白班';
label5.Caption :='丙班第一个中班';
label6.Caption :='丁班第一个夜班';
end;
3:begin
label3.Caption :='甲班第二个夜班';
label4.Caption :='乙班第二个休息';
label5.Caption :='丙班第二个白班';
label6.Caption :='丁班第二个中班';
end;
4:begin
label3.Caption :='甲班第一个夜班';
label4.Caption :='乙班第一个休息';
label5.Caption :='丙班第一个白班';
label6.Caption :='丁班第一个中班';
end;
5:begin
label3.Caption :='甲班第二个中班';
label4.Caption :='乙班第二个夜班';
label5.Caption :='丙班第二个休息';
label6.Caption :='丁班第二个白班';
end;
6:begin
label3.Caption :='甲班第一个中班';
label4.Caption :='乙班第一个夜班';
label5.Caption :='丙班第一个休息';
label6.Caption :='丁班第一个白班';
end;
7:begin
label3.Caption :='甲班第二个白班';
label4.Caption :='乙班第二个中班';
label5.Caption :='丙班第二个夜班';
label6.Caption :='丁班第二个休息';
end;
end;
label3.Visible:=true;
label4.Visible:=true;
label5.Visible:=true;
label6.Visible:=true;
end
else
begin
i:=daysbetween(strtodate('2003-11-12'),DateTimePicker1.Time);
k:=i mod 8;
case k of
0:begin
label3.Caption :='甲班第一个白班';
label4.Caption :='乙班第一个中班';
label5.Caption :='丙班第一个夜班';
label6.Caption :='丁班第一个休息';
end;
1:begin
label3.Caption :='甲班第二个白班';
label4.Caption :='乙班第二个中班';
label5.Caption :='丙班第二个夜班';
label6.Caption :='丁班第二个休息';
end;
2:begin
label3.Caption :='甲班第一个中班';
label4.Caption :='乙班第一个夜班';
label5.Caption :='丙班第一个休息';
label6.Caption :='丁班第一个白班';
end;
3:begin
label3.Caption :='甲班第二个中班';
label4.Caption :='乙班第二个夜班';
label5.Caption :='丙班第二个休息';
label6.Caption :='丁班第二个白班';
end;
4:begin
label3.Caption :='甲班第一个夜班';
label4.Caption :='乙班第一个休息';
label5.Caption :='丙班第一个白班';
label6.Caption :='丁班第一个中班';
end;
5:begin
label3.Caption :='甲班第二个夜班';
label4.Caption :='乙班第二个休息';
label5.Caption :='丙班第二个白班';
label6.Caption :='丁班第二个中班';
end;
6:begin
label3.Caption :='甲班第一个休息';
label4.Caption :='乙班第一个白班';
label5.Caption :='丙班第一个中班';
label6.Caption :='丁班第一个夜班';
end;
7:begin
label3.Caption :='甲班第二个休息';
label4.Caption :='乙班第二个白班';
label5.Caption :='丙班第二个中班';
label6.Caption :='丁班第二个夜班';
end;
end;
label3.Visible:=true;
label4.Visible:=true;
label5.Visible:=true;
label6.Visible:=true;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
label2.Caption:='现在时刻:'+datetimetostr(now);
datetimepicker1.DateTime:=now;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -