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

📄 cjiang.~pas

📁 这是一个抽奖小程序 这是一个抽奖小程序 这是一个抽奖小程序
💻 ~PAS
📖 第 1 页 / 共 4 页
字号:
              atWork.AppendRecord([F_ser,F_code,F_name,F_pname,Combobox1.Text]);
              Close;
            end;
            with atWork do
            begin
              TableName:='ALuck';
              Open;
              atWork.AppendRecord([F_ser,F_code,F_name,F_pname,Combobox1.Text]);
              Close;
            end;
            if x=0 then
              break;
          end;
        end;
        inc(Y);
      end;
    end;
    Application.ProcessMessages;
    PDelay(Time);
    Label4.Caption:='恭喜..恭喜...';
    Label4.Left:=Round((Panel2.Width-Label4.Width)/2);
    SpeedButton2.SetFocus;
  end;
end;



procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  SpeedButton2.SetFocus;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  SD1.SkinFile:=ExtractFilePath(application.ExeName)+'skin0.skn';
  if sd1.Active=False then SD1.Active:=True;
  ADOC.ConnectionString:='';
  ADOC.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Persist Security Info=False;Data Source='+ExtractFilePath(application.ExeName)+'Goodluck.mdb';
  ADOC.LoginPrompt:=False;
  ADOC.Connected:=True;
  ComboBox1.ItemIndex:=0;
  Time:=1;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''A'' and grade>3 and grade<6');
    Open;
  end;
  GL:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''B'' and grade>3 and grade<6');
    Open;
  end;
  CY:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''C'' and grade>3 and grade<6');
    Open;
  end;
  CX:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''D'' and grade>3 and grade<6');
    Open;
  end;
  DD:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''E'' and grade>3 and grade<6');
    Open;
  end;
  ZL:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''G'' and grade>3 and grade<6');
    Open;
  end;
  LD:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''F'' and grade>3 and grade<6');
    Open;
  end;
  SJ:=aqprt.RecordCount;

  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''A'' and grade=1');
    Open;
  end;
  GL3:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''B'' and grade=1');
    Open;
  end;
  CY3:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''C'' and grade=1');
    Open;
  end;
  CX3:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''D'' and grade=1');
    Open;
  end;
  DD3:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''E'' and grade=1');
    Open;
  end;
  ZL3:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''G'' and grade=1');
    Open;
  end;
  LD3:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''F'' and grade=1');
    Open;
  end;
  SJ3:=aqprt.RecordCount;

  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''A'' and grade=2');
    Open;
  end;
  GL2:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''B'' and grade=2');
    Open;
  end;
  CY2:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''C'' and grade=2');
    Open;
  end;
  CX2:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''D'' and grade=2');
    Open;
  end;
  DD2:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''E'' and grade=2');
    Open;
  end;
  ZL2:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''G'' and grade=2');
    Open;
  end;
  LD2:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''F'' and grade=2');
    Open;
  end;
  SJ2:=aqprt.RecordCount;

  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''A'' and grade=3');
    Open;
  end;
  GL1:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''B'' and grade=3');
    Open;
  end;
  CY1:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''C'' and grade=3');
    Open;
  end;
  CX1:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''D'' and grade=3');
    Open;
  end;
  DD1:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''E'' and grade=3');
    Open;
  end;
  ZL1:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''G'' and grade=3');
    Open;
  end;
  LD1:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''F'' and grade=3');
    Open;
  end;
  SJ1:=aqprt.RecordCount;

  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''A'' and grade=6');
    Open;
  end;
  GL0:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''B'' and grade=6');
    Open;
  end;
  CY0:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''C'' and grade=6');
    Open;
  end;
  CX0:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''D'' and grade=6');
    Open;
  end;
  DD0:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''E'' and grade=6');
    Open;
  end;
  ZL0:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''G'' and grade=6');
    Open;
  end;
  LD0:=aqprt.RecordCount;
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from staffer where left(code,1)=''F'' and grade=6');
    Open;
  end;
  SJ0:=aqprt.RecordCount;
  
  Form1.WindowState:=wsMaximized;
  Button1.Left:=Panel3.Width-Button1.Width-5;
  Button2.Left:=Panel3.Width-Button1.Width-Button2.Width-5;
  Button5.Left:=Panel3.Width-Button1.Width-Button2.Width-Button5.Width-5;
  speedbutton2.Left:=Round((Panel3.Width)/2);
  speedbutton2.SetFocus;
  ListBox2.Left:=Panel2.Left;
  ListBox2.Top:=Panel2.Height-ListBox2.Height-Panel3.Height;
  ListBox2.Visible:=False;
  ListBox1.Visible:=False;
  Label3.Top:=Panel2.Top+Round(panel2.Height/2)-200;
  Label3.Left:=Round((Panel2.Width-Label3.Width)/2);
  Label4.top:=Panel2.Top+Round(panel2.Height/2)-250;
  Label4.Visible:=False;
  Label6.top:=Panel2.Top+Round(panel2.Height/2)-150;
  Label6.Visible:=False;
  Label5.top:=Panel2.Top+Round(panel2.Height/2)-340;;
  Label5.Visible:=False;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  ADOC.Connected:=False;
end;

procedure TForm1.DeleteRecord;
begin
  if MessageBox(Handle,'是否清除?', '提示', MB_OKCANCEL)=IDOK	then
  begin
    with aqWork do
    begin
      Close;
      sql.Clear;
      sql.Add('delete from luckly');
      execsql;
    end;
  end;
end;

procedure TForm1.PDelay(ms: Integer);
var
  FirstTickCount:longint;
begin
  FirstTickCount:=GetTickCount;
  repeat
    Application.ProcessMessages;
  until ((GetTickCount-FirstTickCount) >= Longint(ms));
END;

procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key=Vk_return then
  SpeedButton2.SetFocus;
end;

procedure TForm1.N1Click(Sender: TObject);
begin
  with aqprt do
  begin
    close;
    sql.Clear;
    sql.Add('select * from luckly order by mingci,code,pname');
//    sql.Add('select * from Aluck order by mingci,code,pname');
    Open;
  end;
  F_print.QuickRep1.DataSet:=Form1.aqprt;
  F_print.QRDBText1.DataField:='code';
  F_print.QRDBText2.DataField:='name';
  F_print.QRDBText3.DataField:='pname';
  F_print.QRDBText4.DataField:='mingci';
  F_print.QuickRep1.Preview;
  SpeedButton2.SetFocus;
end;

procedure TForm1.N2Click(Sender: TObject);
begin
  with aqprt do
  begin
    close;
    sql.Clear;
//    sql.Add('select * from luckly order by mingci,code,pname');
    sql.Add('select * from Aluck order by mingci,code,pname');
    Open;
  end;
  F_print.QuickRep1.DataSet:=Form1.aqprt;
  F_print.QRDBText1.DataField:='code';
  F_print.QRDBText2.DataField:='name';
  F_print.QRDBText3.DataField:='pname';
  F_print.QRDBText4.DataField:='mingci';
  F_print.QuickRep1.Preview;
  SpeedButton2.SetFocus;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  Menupt := Point( Button3.Left + Button3.Width-5 ,  self.Top+self.Height  );
  PopupMenu1.Popup(menuPt.x,menuPt.y);
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  DeleteRecord;
end;


end.

⌨️ 快捷键说明

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