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

📄 gong_ying_shang_pai.~pas

📁 品质管理系统:delphi+sql实现了制造企业在生产过程中对产品质量的控制
💻 ~PAS
字号:
unit gong_ying_shang_pai;

interface

uses
  Windows, Messages, SysUtils, StrUtils,Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, DB, DBTables;

type
  Tgong_ying_shang_pa = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    t1: TMaskEdit;
    t2: TMaskEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Table1: TTable;
    Query1: TQuery;
    sp1: TStoredProc;
    sp2: TStoredProc;
    Label3: TLabel;
    Label4: TLabel;
    ComboBox1: TComboBox;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure t1KeyPress(Sender: TObject; var Key: Char);
    procedure t2KeyPress(Sender: TObject; var Key: Char);
    procedure Button3Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ComboBox1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  gong_ying_shang_pa: Tgong_ying_shang_pa;

implementation
uses gong_ying_shang_report;
{$R *.dfm}

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

procedure Tgong_ying_shang_pa.t1KeyPress(Sender: TObject; var Key: Char);
begin
if key=chr(13) then
t2.SetFocus;
end;

procedure Tgong_ying_shang_pa.t2KeyPress(Sender: TObject; var Key: Char);
begin
if key=chr(13) then
combobox1.SetFocus;
end;

procedure Tgong_ying_shang_pa.Button3Click(Sender: TObject);
begin
close;
end;

procedure Tgong_ying_shang_pa.Button1Click(Sender: TObject);
var    i:integer; xws:string;
begin

i:=100000;


if table1.IsEmpty=false then
begin
sp1.Active:=false;
sp1.Prepare;
sp1.ExecProc;
end;


 sp2.Active:=false;
 sp2.ParamByName('@str1').AsDateTime:=strtodate(t1.Text);
  sp2.ParamByName('@str2').AsDateTime:=strtodate(t2.Text);
  sp2.Prepare;
  sp2.Active:=true;

 sp2.First;
 while not sp2.Eof do
            begin
          xws:=midstr(sp2.Fields[3].AsString,1,1);
            table1.Last;
            table1.Append;
            table1.Edit;
            table1.Fields[0].AsString:=inttostr(i);
            table1.Fields[1].AsString:=sp2.Fields[0].AsString;
            if  sp2.Fields[1].AsString<>'' then
            table1.Fields[2].AsFloat:=sp2.Fields[1].AsFloat
            else
            table1.Fields[2].AsFloat:=0;
            if sp2.Fields[2].AsString<>'' then
            table1.Fields[3].AsFloat:=sp2.Fields[2].AsFloat
            else
            table1.Fields[3].AsFloat:=0;
            if sp2.Fields[1].AsString<>'' then
            table1.Fields[4].AsFloat:=sp2.Fields[2].AsFloat/sp2.Fields[1].AsFloat
            else
           table1.Fields[4].AsFloat:=0;

            table1.Fields[5].AsString:=xws;


           table1.Post;
           i:=i+1;
           sp2.Next;
           if sp2.Eof then
           begin
             showmessage('参璸Ч拨!');
             system.Exit;


           end;

          end;



end;

procedure Tgong_ying_shang_pa.Button2Click(Sender: TObject);
 var gong_ying_shang_repor:Tgong_ying_shang_repor;
begin
gong_ying_shang_repor:=Tgong_ying_shang_repor.Create(self);
if combobox1.Text='

⌨️ 快捷键说明

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