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

📄 openprixrecord.pas

📁 彩票销售系统
💻 PAS
字号:
unit OpenPrixRecord;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, ToolWin, ComCtrls, Grids, DBGrids,
  DB, ADODB, Menus;

type
  TOpenPrixRecord_form = class(TForm)
    StatusBar1: TStatusBar;
    ToolBar1: TToolBar;
    Panel1: TPanel;
    BitBtn3: TBitBtn;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    GroupBox3: TGroupBox;
    Edit1: TEdit;
    Panel2: TPanel;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    PopupMenu1: TPopupMenu;
    N1: TMenuItem;
    OpenRecord: TADOQuery;
    opensave_sp: TADOStoredProc;
    Edit2: TEdit;
    deleteRecordp: TADOQuery;
    recordassay: TADOStoredProc;
    Label2: TLabel;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Edit7: TEdit;
    Edit8: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
    Shape4: TShape;
    Shape5: TShape;
    Shape6: TShape;
    Shape7: TShape;
    Shape8: TShape;
    Shape9: TShape;
    Shape10: TShape;
    Shape11: TShape;
    Shape12: TShape;
    Shape13: TShape;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Shape14: TShape;
    Label9: TLabel;
    Shape15: TShape;
    Label10: TLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BitBtn3Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure Edit2KeyPress(Sender: TObject; var Key: Char);
    procedure N1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure Edit3KeyPress(Sender: TObject; var Key: Char);
    procedure Edit4KeyPress(Sender: TObject; var Key: Char);
    procedure Edit5KeyPress(Sender: TObject; var Key: Char);
    procedure Edit6KeyPress(Sender: TObject; var Key: Char);
    procedure Edit7KeyPress(Sender: TObject; var Key: Char);
    procedure Edit8KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  OpenPrixRecord_form: TOpenPrixRecord_form;

implementation
  uses NumberManger;
{$R *.dfm}

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

procedure TOpenPrixRecord_form.BitBtn3Click(Sender: TObject);
begin
  close;
end;

procedure TOpenPrixRecord_form.FormShow(Sender: TObject);
begin
  if saleperiod<>'' then
  begin
    edit1.Text:=saleperiod;
  end
  else
  begin
    application.MessageBox('无可用的期号!','系统提示',MB_ICONERROR);
    close;
  end ;
  OpenRecord.Close;
  OpenRecord.Open;
end;

procedure TOpenPrixRecord_form.BitBtn1Click(Sender: TObject);
var
  saveString:string;
begin
   if application.MessageBox('是否确定开奖数据正确?','系统提示',mb_yesno+mb_iconquestion)=id_yes  then
   begin
     if (edit2.text='') or (edit3.text='') or (edit4.text='') or (edit5.text='') or (edit6.text='') or (edit7.text='') or (edit8.text='')then
     begin
       application.MessageBox('请录入开奖记录!','系统提示',MB_ICONERROR);
       edit2.SetFocus;
       exit;
     end
     else
     begin
       saveString:='';
       saveString:=edit2.Text+'+'+edit3.Text+'+'+edit4.Text+'+'+edit5.Text+'+'+edit6.Text+'+'+edit7.Text+'+'+edit8.Text;
       opensave_sp.Close;
       opensave_sp.Parameters[1].Value:=saleperiod;
       opensave_sp.Parameters[2].Value:=saveString;
       opensave_sp.Parameters[3].Value:=Null;
       opensave_sp.Prepared;
       opensave_sp.ExecProc;
       showmessage(opensave_sp.Parameters[3].Value);
       opensave_sp.Close;
       OpenRecord.Close;
       OpenRecord.Open;
     end;
   end;
end;

procedure TOpenPrixRecord_form.Edit2KeyPress(Sender: TObject;
  var Key: Char);
begin
  if key=#13 then
  begin
    {if edit2.text='' then
    begin
      application.MessageBox('请录开奖值!','系统提示',MB_ICONERROR);
      edit2.SetFocus;
      exit;
    end
    else
    begin
      BitBtn1Click(Sender);
    end; }
    if edit2.text<>'' then edit3.SetFocus;
  end;
  if not (key in ['0'..'9',Chr(8),'+'])  then
  key:=#0;
end;

procedure TOpenPrixRecord_form.N1Click(Sender: TObject);
begin
  if application.MessageBox('是删除该开奖记录?','系统提示',mb_yesno+mb_iconquestion)=id_yes  then
  begin
    deleteRecordp.Close;
    deleteRecordp.sql.clear;
    deleteRecordp.SQL.Add('select * from T_OpenAward_Record where FAssayBz=1 and FSalePeriod='''+saleperiod+'''');
    deleteRecordp.Open;
    if deleteRecordp.RecordCount<1 then
    begin
      OpenRecord.Delete;
      application.MessageBox('数据已删除!','系统提示',MB_ICONERROR);
      OpenRecord.Close;
      OpenRecord.Open;
      exit;
    end
    else
    begin
      application.MessageBox('数据删除失败,不允许删除已分析的记录!','系统提示',MB_ICONERROR);
      exit;
    end;
  end;
end;

procedure TOpenPrixRecord_form.BitBtn2Click(Sender: TObject);
begin
  if application.MessageBox('是否进行中奖分析','系统提示',mb_yesno+mb_iconquestion)=id_yes  then
  begin
    recordassay.Close;
    recordassay.Parameters[1].value:=saleperiod;
    recordassay.Parameters[2].value:=Null;
    recordassay.ExecProc;
    showmessage(recordassay.Parameters[2].value);
    recordassay.Close;
  end;
end;

procedure TOpenPrixRecord_form.Edit3KeyPress(Sender: TObject;
  var Key: Char);
begin
  if key=#13 then
  begin
    {if edit2.text='' then
    begin
      application.MessageBox('请录开奖值!','系统提示',MB_ICONERROR);
      edit2.SetFocus;
      exit;
    end
    else
    begin
      BitBtn1Click(Sender);
    end; }
    if edit3.text<>'' then edit4.SetFocus;
  end;
  if not (key in ['0'..'9',Chr(8),'+'])  then
  key:=#0;
end;

procedure TOpenPrixRecord_form.Edit4KeyPress(Sender: TObject;
  var Key: Char);
begin
  if key=#13 then
  begin
    {if edit2.text='' then
    begin
      application.MessageBox('请录开奖值!','系统提示',MB_ICONERROR);
      edit2.SetFocus;
      exit;
    end
    else
    begin
      BitBtn1Click(Sender);
    end; }
    if edit4.text<>'' then edit5.SetFocus;
  end;
  if not (key in ['0'..'9',Chr(8),'+'])  then
  key:=#0;
end;

procedure TOpenPrixRecord_form.Edit5KeyPress(Sender: TObject;
  var Key: Char);
begin
  if key=#13 then
  begin
    {if edit2.text='' then
    begin
      application.MessageBox('请录开奖值!','系统提示',MB_ICONERROR);
      edit2.SetFocus;
      exit;
    end
    else
    begin
      BitBtn1Click(Sender);
    end; }
    if edit5.text<>'' then edit6.SetFocus;
  end;
  if not (key in ['0'..'9',Chr(8),'+'])  then
  key:=#0;
end;

procedure TOpenPrixRecord_form.Edit6KeyPress(Sender: TObject;
  var Key: Char);
begin
  if key=#13 then
  begin
    {if edit2.text='' then
    begin
      application.MessageBox('请录开奖值!','系统提示',MB_ICONERROR);
      edit2.SetFocus;
      exit;
    end
    else
    begin
      BitBtn1Click(Sender);
    end; }
    if edit6.text<>'' then edit7.SetFocus;
  end;
  if not (key in ['0'..'9',Chr(8),'+'])  then
  key:=#0;
end;

procedure TOpenPrixRecord_form.Edit7KeyPress(Sender: TObject;
  var Key: Char);
begin
  if key=#13 then
  begin
    {if edit2.text='' then
    begin
      application.MessageBox('请录开奖值!','系统提示',MB_ICONERROR);
      edit2.SetFocus;
      exit;
    end
    else
    begin
      BitBtn1Click(Sender);
    end; }
    if edit7.text<>'' then edit8.SetFocus;
  end;
  if not (key in ['0'..'9',Chr(8),'+'])  then
  key:=#0;
end;

procedure TOpenPrixRecord_form.Edit8KeyPress(Sender: TObject;
  var Key: Char);
begin
  if key=#13 then
  begin

    if edit2.text<>'' then BitBtn1Click(Sender);
  end;
  if not (key in ['0'..'9',Chr(8),'+'])  then
  key:=#0;
end;

end.

⌨️ 快捷键说明

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