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

📄 main.pas

📁 这是用Delphi编写的汽车配件管理系统。主要功能有基础信息管理
💻 PAS
字号:
unit MAIN;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Menus, Db, DBTables, StdCtrls, ComCtrls, ToolWin, ExtCtrls, ImgList,
  Buttons, jpeg;

type
  TMRQP = class(TForm)
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    Database1: TDatabase;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N12: TMenuItem;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    ToolButton5: TToolButton;
    StatusBar1: TStatusBar;
    N13: TMenuItem;
    N14: TMenuItem;
    N15: TMenuItem;
    N16: TMenuItem;
    N18: TMenuItem;
    N19: TMenuItem;
    N20: TMenuItem;
    N21: TMenuItem;
    N22: TMenuItem;
    N23: TMenuItem;
    N25: TMenuItem;
    N26: TMenuItem;
    N27: TMenuItem;
    N28: TMenuItem;
    N29: TMenuItem;
    N30: TMenuItem;
    N31: TMenuItem;
    N32: TMenuItem;
    ToolButton6: TToolButton;
    TreeView1: TTreeView;
    ImageList1: TImageList;
    ToolButton7: TToolButton;
    ToolButton8: TToolButton;
    ToolButton9: TToolButton;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Splitter1: TSplitter;
    ToolButton10: TToolButton;
    ToolButton11: TToolButton;
    N24: TMenuItem;
    N33: TMenuItem;
    Label1: TLabel;
    Image1: TImage;
    N4: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure N2Click(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure N8Click(Sender: TObject);
    procedure N11Click(Sender: TObject);
    procedure N9Click(Sender: TObject);
    procedure N12Click(Sender: TObject);
    procedure N14Click(Sender: TObject);
    procedure N15Click(Sender: TObject);
    procedure N16Click(Sender: TObject);
    procedure N27Click(Sender: TObject);
    procedure N28Click(Sender: TObject);
    procedure TreeView1DblClick(Sender: TObject);
    procedure N20Click(Sender: TObject);
    procedure N30Click(Sender: TObject);
    procedure N21Click(Sender: TObject);
    procedure N31Click(Sender: TObject);
    procedure N32Click(Sender: TObject);
    procedure N5Click(Sender: TObject);
    procedure N6Click(Sender: TObject);
    procedure N23Click(Sender: TObject);
    procedure N33Click(Sender: TObject);
    procedure ToolButton9Click(Sender: TObject);
    procedure N26Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MRQP: TMRQP;

implementation

uses MRCPXXGL, MRCPXXGL_CX,MRKHXXGL, MRKHXXGL_CX,MRCPRK,MRCPcK,MRCPXXBB,MRKHXXBB,MRRKBB,MRCKBB,MRTHBB,
  mrcpckth,mrcpckthsl,mrcpxxcx,mrcpxxxg,mrkhxxcx,mrkhxxxg,mrrkxxcx,mrcpckcx,mrcpthcx,MRYHGL,MRQXSZ,MRSJBF,MRPASS;

{$R *.DFM}

procedure TMRQP.FormCreate(Sender: TObject);
BEGIN
 Database1.Params.Values['username']:='';
 Database1.Params.Values['password']:='';
 Database1.LoginPrompt:=False;
 Database1.DatabaseName:='moed';
 Database1.AliasName:='user';
 treeview1.FullExpand;    //展开数状显示窗体
end;
procedure TMRQP.N2Click(Sender: TObject);   //调入产品信息管理窗口
BEGIN
 Application.CreateForm(TCPXXGL,CPXXGL);
 CPXXGL.ShowModal;
end;
procedure TMRQP.N3Click(Sender: TObject);  //调入客户信息管理窗口
BEGIN
 Application.CreateForm(TKHXXGL,KHXXGL);
 KHXXGL.showmodal;
end;
procedure TMRQP.FormShow(Sender: TObject);     //系统初始化
var year,month,day:word;
BEGIN
 PASS.ShowModal;  //显示密码确认窗口
 decodedate(now,year,month,day);
 statusbar1.panels[0].text:='明日腾龙汽配管理系统';
 statusbar1.panels[1].text:='操作员:'+PASS.Table1.fieldbyname('Xm').asstring;
 statusbar1.panels[2].text:='系统日期: '+inttostr(year)+'年'+inttostr(month)+'月'+inttostr(day)+'日';
 if PASS.table1.FieldByName('a').asboolean=true then
 BEGIN
  n1.enabled:=false;
 end;
end;
procedure TMRQP.N8Click(Sender: TObject);    //调入产品信息查询程序
BEGIN
 application.Createform(tcpxxcx,cpxxcx);
 cpxxcx.showmodal;
end;

procedure TMRQP.N9Click(Sender: TObject);    //调入客户信息查询程序
BEGIN
 APPLication.createform(Tkhxxcx,khxxcx);
 application.createform(tkhxxxg,khxxxg);
 khxxcx.showmodal;
end;

procedure TMRQP.N12Click(Sender: TObject);     //调入产品退货程序
BEGIN
 application.createform(Tcpckth,cpckth);
 aPPlication.createform(tcpckthsl,cpckthsl);
 cpckth.showmodal;
end;

procedure TMRQP.N14Click(Sender: TObject);    //调入入库信息查询程序
BEGIN
 application.createform(trkxxcx,rkxxcx);
 rkxxcx.showmodal;
end;

procedure TMRQP.N15Click(Sender: TObject);    //调入出库信息查询程序
BEGIN
 application.Createform(tcpckcx,cpckcx);
 cpckcx.showmodal;
end;

procedure TMRQP.N16Click(Sender: TObject);    //调入退货信息查询程序
BEGIN
 application.createform(tcpthcx,cpthcx);
 cpthcx.showmodal;
end;

procedure TMRQP.N27Click(Sender: TObject);     //调入产品信息报表
BEGIN
 application.Createform(tCPXXBB,CPXXBB);
 CPXXBB.QuickRep1.PreviewModal;
end;
procedure TMRQP.N28Click(Sender: TObject);     //调入退货报表
BEGIN
 application.createform(tkhXXBB,khXXBB);
 khXXBB.quickrep1.previewmodal;
end;

procedure TMRQP.TreeView1DblClick(Sender: TObject);
BEGIN
if treeview1.selected.text='数据备份' then begin      //调入数据备份程序
Application.CreateForm(TSJBF,SJBF);
SJBF.showmodal;
end;
if treeview1.selected.text='产品信息管理' then begin      //调入产品信息管理程序
Application.CreateForm(TCPXXGL,CPXXGL);
CPXXGL.ShowModal;
end;
if treeview1.selected.text='客户信息管理' then begin      //调入客户信息管理程序
 Application.CreateForm(TkhXXGL,khXXGL);
 khXXGL.ShowModal;
end;
if treeview1.selected.text='入库登记管理' then begin      //调入入库管理程序
 Application.CreateForm(TCPRK,CPRK);
 CPRK.showmodal;
end;
if treeview1.selected.text='出库登记管理' then begin      //调入出库管理程序
Application.CreateForm(TCPCK,CPCK);
CPCK.showmodal;
end;
if treeview1.selected.text='退货登记管理' then begin      //调入退货管理程序
application.createform(Tcpckth,cpckth);
aPPlication.createform(tcpckthsl,cpckthsl);
cpckth.showmodal;
end;
if treeview1.selected.text='产品信息查询' then begin       //调入产品信息查询程序
application.Createform(tcpxxcx,cpxxcx);
cpxxcx.showmodal;
end;
if treeview1.selected.text='客户信息查询' then begin      //调入客户信息查询程序
application.Createform(tKHxxcx,KHxxcx);
KHxxcx.showmodal;
end;
if treeview1.selected.text='入库信息查询' then begin      //调入入库信息查询程序
application.Createform(tRKxxcx,RKxxcx);
RKxxcx.showmodal;
end;
if treeview1.selected.Text='出库信息查询' then begin       //调入出库信息查询程序
 application.Createform(tcpckcx,cpckcx);
 cpckcx.showmodal;
end;
if treeview1.selected.text='退货信息查询' then begin        //调入退货信息查询程序
 application.Createform(tcpTHcx,cpTHcx);
 cpTHcx.showmodal;
end;
if treeview1.selected.text='客户信息报表' then begin        //调入客户信息报表
 application.Createform(tKHXXBB,KHXXBB);
 khXXBB.quickrep1.previewmodal
end;
if treeview1.selected.text='产品信息报表' then begin       //调入产品信息报表
 application.Createform(tCPXXBB,CPXXBB);
 CPXXBB.quickrep1.previewmodal
end;
if treeview1.selected.text='入库信息报表' then begin        //调入入库信息报表
 application.Createform(tRKBB,RKBB);
 RKBB.quickrep1.previewmodal
end;
if treeview1.selected.text='出库信息报表' then begin       //调入出库信息报表
 application.Createform(tCKBB,CKBB);
 CKBB.quickrep1.previewmodal
end;
if treeview1.selected.text='用户管理' then begin         //调入用户管理程序
  if PASS.table1.fieldbyname('a').asboolean=true then begin
   application.Createform(tcpxxcx,cpxxcx);
   cpxxcx.showmodal;
  End
  Else BEGIN
   showmessage('对不起,您没有这个权限。');
end;
end;
if treeview1.selected.text='权限设置' then begin      //调入权限设置程序
  if PASS.table1.fieldbyname('b').asboolean=true then begin
   application.createform(tQXSZ,QXSZ);
   QXSZ.showmodal;
 End
  Else BEGIN
      showmessage('对不起,您没有这个权限。');
  end;
end;
end;
procedure TMRQP.N20Click(Sender: TObject);      //调入用户管理程序
BEGIN
 application.createform(tYHGL,YHGL);
 YHGL.showmodal;
end;

procedure TMRQP.N30Click(Sender: TObject);     //调入入库报表
BEGIN
 application.createform(tRKBB,RKBB);
 RKBB.quickrep1.previewmodal;
end;

procedure TMRQP.N21Click(Sender: TObject);      //调入权限设置
BEGIN
 application.createform(tQXSZ,QXSZ);
 QXSZ.showmodal;
end;

procedure TMRQP.N31Click(Sender: TObject);      //调入出库报表
BEGIN
 application.createform(tCKBB,CKBB);
 CKBB.quickrep1.previewmodal;
end;

procedure TMRQP.N32Click(Sender: TObject);       //调入退货报表
BEGIN
 application.createform(tTHBB,THBB);
 THBB.quickrep1.previewmodal;
end;

procedure TMRQP.N5Click(Sender: TObject);        //调入产品入库程序
BEGIN
 Application.CreateForm(TCPRK,CPRK);
 CPRK.showmodal;
end;

procedure TMRQP.N6Click(Sender: TObject);      //调入产品出库程序
BEGIN
 Application.CreateForm(TCPck,CPcK);
 CPcK.showmodal;
end;

procedure TMRQP.N23Click(Sender: TObject);      //调入数据备份程序
BEGIN
 Application.CreateForm(TSJBF,SJBF);
 SJBF.showmodal;
end;

procedure TMRQP.N33Click(Sender: TObject);       //是否显示工具栏
BEGIN
 IF  ToolBar1.Visible=TRUE
 THEN  BEGIN
    TOOLBAR1.VISIBLE:=FALSE ;
    N33.Checked:=FALSE ;
  End
  else begin
    TOOLBAR1.VISIBLE:=TRUE;
    N33.Checked:=TRUE ;
 END;
end;

procedure TMRQP.ToolButton9Click(Sender: TObject);
BEGIN
 close;
end;
procedure TMRQP.N11Click(Sender: TObject);    //退出
BEGIN
 close;
end;

procedure TMRQP.N26Click(Sender: TObject);
begin
   close;
end;

end.

⌨️ 快捷键说明

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