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

📄 store_unit.pas

📁 这是用delphi开发的一个物资管理信息系统
💻 PAS
字号:
unit store_unit;

interface
  uses
  Windows,Messages,SysUtils,Variants,DBclient,Classes,datamodule;
  type
   Tstore=class(TObject)
   private
    Datamod:TDataMod;
   public
   function StoreRec(RecSQL:string):Boolean;
   function StoreRecs(FindSQL:string):OLEVariant;
   function FindRecs(FindSQL:string):Boolean;
   function GetStoreNum(ProCode:string):string;
    function GetPlaceCode(ProCode:string):string;
    function GetUnit(ProCode:string):string;
   procedure StoreRecInsert(InsertSQL:string);
   procedure StoreRecUpdate(UpdateSQL:string);
   procedure StoreRecDel(DeleteSQL:string);
   constructor create;
   destructor Destroy;override;
  end;
implementation

  constructor  Tstore.create;
  begin
  Datamod:=TDataMod.Create(nil);
  end;

  destructor Tstore.Destroy ;
  begin
  freeandnil(Datamod);
 inherited;
  end;

  function Tstore.StoreRec(RecSQL:string):Boolean;
  begin
  DataMod.adoq2.Close;
  DataMod.adoq2.SQL.Clear;
  DataMod.adoq2.SQL.Add(RecSQL);
  DataMod.adoq2.Open;
  if  DataMod.adoq2.Eof  then  result:=false
  else result:=true;
  end;

    function Tstore.FindRecs(FindSQL:string):Boolean;
  begin
  DataMod.adoq2.Close;
  DataMod.adoq2.SQL.Clear;
  DataMod.adoq2.SQL.Add(FindSQL);
  DataMod.adoq2.Open;
  if  DataMod.adoq2.Eof  then  result:=false
  else result:=true;
  end;

  procedure Tstore.StoreRecInsert(InsertSQL:string);
  begin
  DataMod.adoq2.Close;
  DataMod.adoq2.SQL.Clear;
  DataMod.adoq2.SQL.Add(InsertSQL);
  DataMod.adoq2.ExecSQL;
  end;

    procedure Tstore.StoreRecUpdate(UpdateSQL:string);
  begin
  DataMod.adoq2.Close;
  DataMod.adoq2.SQL.Clear;
  DataMod.adoq2.SQL.Add(UpdateSQL);
  DataMod.adoq2.ExecSQL ;
  end;

      procedure Tstore.StoreRecDel(DeleteSQL:string);
  begin
  DataMod.adoq2.Close;
  DataMod.adoq2.SQL.Clear;
  DataMod.adoq2.SQL.Add(DeleteSQL);
  DataMod.adoq2.ExecSQL ;
  end;

  function  Tstore.StoreRecs(FindSQL:string):OLEVariant;
  begin
  DataMod.sel_adoq1.Close;
  DataMod.sel_adoq1.SQL.Clear;
  DataMod.sel_adoq1.SQL.Add(FindSQL);
  DataMod.sel_adoq1.Open;
  result:=DataMod.sel_dsp1.Data;
  end;

   function Tstore.GetStoreNum(ProCode:string):string;
   begin
   DataMod.sel_adoq1.Close;
   DataMod.sel_adoq1.SQL.Clear;
   DataMod.sel_adoq1.SQL.Add ('select * from store_info where pro_code='''+ProCode+'''');
   DataMod.sel_adoq1.Open ;
   result:=DataMod.sel_adoq1.fieldbyname('store_pro_num').AsString ;

   end;

      function Tstore.GetPlaceCode (ProCode:string):string;
   begin
   DataMod.sel_adoq1.Close;
   DataMod.sel_adoq1.SQL.Clear;
   DataMod.sel_adoq1.SQL.Add ('select * from store_info where pro_code='''+ProCode+'''');
   DataMod.sel_adoq1.Open ;
   result:=DataMod.sel_adoq1.fieldbyname('place_code').AsString ;

   end;

      function Tstore.GetUnit(ProCode:string):string;
   begin
   DataMod.sel_adoq1.Close;
   DataMod.sel_adoq1.SQL.Clear;
   DataMod.sel_adoq1.SQL.Add ('select * from store_info where pro_code='''+ProCode+'''');
   DataMod.sel_adoq1.Open ;
   result:=DataMod.sel_adoq1.fieldbyname('unit').AsString ;

   end;



end.


⌨️ 快捷键说明

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