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

📄 u_product.pas

📁 这是一个用条码录入的数据的进销存(只对成品)---做童装的
💻 PAS
字号:
unit U_Product;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, U_Set_Base, WinSkinStore, WinSkinData, DB, ADODB, Buttons,
  Grids, DBGridEh, ExtCtrls, StdCtrls, Mask, DBCtrls;

type
  TF_Product = class(TF_set_base)
    Ado_QueryProductTM: TStringField;
    Ado_QueryItemNO: TStringField;
    Ado_QueryGroupNO: TStringField;
    Ado_QueryPrice: TBCDField;
    Ado_QueryProductJD: TStringField;
    Ado_QueryBrandno: TStringField;
    Ado_QueryColor: TStringField;
    Label1: TLabel;
    Label4: TLabel;
    Price: TDBEdit;
    Label5: TLabel;
    ProductJD: TDBEdit;
    Label6: TLabel;
    ItemNO: TDBEdit;
    Label7: TLabel;
    GroupNO: TDBEdit;
    Label8: TLabel;
    Brandno: TDBEdit;
    Ado_QueryBrandname: TStringField;
    Ado_Queryitemname: TStringField;
    Ado_Queryhandcount: TIntegerField;
    Ado_QueryGroupname: TStringField;
    Label3: TLabel;
    YF: TDBEdit;
    Ado_QueryCustno: TStringField;
    Ado_QueryCustname: TStringField;
    Label2: TLabel;
    Custname: TDBEdit;
    Label10: TLabel;
    handcount: TDBEdit;
    Label11: TLabel;
    Color: TDBEdit;
    itemname: TDBEdit;
    Groupname: TDBEdit;
    Brandname: TDBEdit;
    Producttm: TDBEdit;
    Ado_QueryYF: TStringField;
    BitBtn1: TBitBtn;
    procedure FormCreate(Sender: TObject);
    procedure btn_insertClick(Sender: TObject);
    procedure ProductTMKeyPress(Sender: TObject; var Key: Char);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_Product: TF_Product;

implementation

uses U_DM, U_Function;

{$R *.dfm}

procedure TF_Product.FormCreate(Sender: TObject);
begin
  inherited;
  width:=  725;
  height:=442;
  OpenSql(Ado_query,'Select * from IProduct');
end;

procedure TF_Product.btn_insertClick(Sender: TObject);
begin
  Producttm.SetFocus;
  inherited;

end;

procedure TF_Product.ProductTMKeyPress(Sender: TObject; var Key: Char);
begin
  inherited;
if key=#13 then
Begin
if Trim(ProductTM.Text)='' then
Begin
Application.MessageBox('请录入产品条码!','提示信息',MB_ICONINFORMATION+MB_OK);
ProductTm.SetFocus;
Exit;
end;
Try
 Getproductinfo(Trim(ProductTm.Text),Theproduct);
Except
  Application.MessageBox('取得产品资料时出现错语!','提示信息',MB_ICONinformation+MB_OK);
  Exit;
end;
Yf.Text:=Theproduct.NF;
ProductJD.Text:=Theproduct.JDname;
Groupno.Text:=Theproduct.Groupno;
Groupname.Text:=Theproduct.Groupname;
Itemno.Text:=Theproduct.ItemNo;
ITemname.Text:=Theproduct.ItemName;
Brandno.Text:=Theproduct.Brandno;
BrandName.Text:=Theproduct.Brandname;
Ado_Query.FieldByName('Custno').AsString:=Theproduct.Custno;
Custname.Text:=Theproduct.Custname;
Handcount.Text:=inttostr(Theproduct.Handcount);
price.Text:=Floattostr(Theproduct.Price);
end;
end;

procedure TF_Product.BitBtn1Click(Sender: TObject);
begin
  inherited;
  openSql(F_dm.Temp,'Select * from IWarehouse');
  while not F_Dm.Temp.Eof  do
  Begin
  Try
  Execsql('Insert into Warehouse (ProductTm,Warehouseno,Itemno '
           +',itemname,GroupNo,GroupName,brandno,Brandname,jdname'
           +',HandCount) Select ProductTm,'''
           +Trim(F_Dm.Temp.Fieldbyname('Warehouseno').AsString)+''',Itemno '
           +',itemname,GroupNo,GroupName,brandno,Brandname,ProductJD'
           + ',HandCount from IProduct where ProductTm not in (select ProductTm '
           +' from Warehouse where warehouseno='''
           +Trim(F_Dm.Temp.Fieldbyname('Warehouseno').AsString)+''')');
  Except
  
  end;         
  F_Dm.Temp.Next;
  end;
  Application.MessageBox('已经更新仓库资料!','恭喜',MB_ICONINFORMATION+MB_OK);         
end;

end.

⌨️ 快捷键说明

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