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

📄 sys_main.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Sys_Main;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Common, ExtCtrls, StdCtrls, Base, Db, AdODB, Jpeg;

Type
  TFrm_Sys_Main = Class(TFrm_Base_Common)
    Image1: TImage;
    Label1: TLabel;
    Lbl_Ap: TLabel;
    Lbl_Ar: TLabel;
    Lbl_Gl: TLabel;
    Lbl_Sc: TLabel;
    Lbl_Ad: TLabel;
    Lbl_Pr: TLabel;
    Lbl_Pm: TLabel;
    Lbl_Sal: TLabel;
    Lbl_Stk: TLabel;
    Lbl_Inv: TLabel;
    Lbl_Qc:  TLabel;
    Lbl_Sfc: TLabel;
    Lbl_Bom: TLabel;
    Lbl_Bas: TLabel;
    Lbl_Sys: TLabel;
    Lbl_Mrp: TLabel;
    Lbl_Mr:  TLabel;
    Lbl_Cr:  TLabel;
    procedure Image1MouseMove(Sender: TObject;Shift: TShiftState; X, Y: Integer);
    procedure LblClick(Sender:Tobject);
    procedure OnFocusLabel(Sender: TObject; Shift: TShiftState; X,Y: Integer);
  private
    { Private declarations }
//    procedure OnFocusLabel(Sender:Tobject);
    showPictrue:boolean;
    procedure OnFocusImage(Sender:Tobject);
  public
    { Public declarations }
    procedure GetModuleFrm(ModuleCode:string);
  end;

var
  Frm_Sys_Main: TFrm_Sys_Main;

implementation

uses Main,Sys_Pm, Sys_Ad, Sys_Ap, Sys_Ar, Sys_Bas, Sys_Bom, Sys_Gl, Sys_Inv,
    Sys_Mrp, Sys_Qc, Sys_Sal, Sys_Sfc, Sys_Stk, Sys_Sys, Sys_Plan;

{$R *.DFM}

procedure TFrm_Sys_Main.OnFocusLabel(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
begin
  TLabel(Sender).Font.Color:=clBlue;
  TLabel(Sender).Font.Style:=[fsBold];
  TLabel(Sender).Cursor:= crHandPoint;
end;

procedure TFrm_Sys_Main.OnFocusImage(Sender:Tobject);
begin
  Lbl_Ap.Font.Color:=clWhite;
  Lbl_Ar.Font.Color:=clWhite;
  Lbl_Gl.Font.Color:=clWhite;
  Lbl_Sc.Font.Color:=clWhite;
  Lbl_Ad.Font.Color:=clWhite;
  Lbl_PR.Font.Color:=clWhite;
  Lbl_Pm.Font.Color:=clWhite;
  Lbl_Sal.Font.Color:=clWhite;
  Lbl_Stk.Font.Color:=clWhite;
  Lbl_Inv.Font.Color:=clWhite;
  Lbl_Qc.Font.Color:=clWhite;
  Lbl_Sfc.Font.Color:=clWhite;
  Lbl_Bom.Font.Color:=clWhite;
  Lbl_Bas.Font.Color:=clWhite;
  Lbl_Sys.Font.Color:=clWhite;
  Lbl_Mrp.Font.Color:=clWhite;
  Lbl_Mr.Font.Color:=clWhite;
  Lbl_CR.Font.Color:=clWhite;
end;


procedure TFrm_Sys_Main.Image1MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
begin
  inherited;
  OnFocusImage(Sender);
end;

procedure  TFrm_Sys_Main.LblClick(Sender:Tobject);
var
  i:integer;
  ModuleCode,ModuleName:string;
begin
  ModuleCode:=(sender as TLabel).Name;
  i:=length(ModuleCode);
  ModuleCode:=copy(ModuleCode,5,i-3);
  if  ModuleCode='Ms' then ModuleCode:='pl';
  if  ModuleCode='Mr' then ModuleCode:='pl';
  if  ModuleCode='CR' then ModuleCode:='pl';

  Frm_Main.Getnewmenuclick(ModuleCode);
  GetModuleFrm(ModuleCode);
end;

procedure TFrm_Sys_Main.GetModuleFrm(ModuleCode:string);
begin
  showPictrue:=False;
  if showPictrue=True then
  begin
    ModuleCode:=LowerCase(ModuleCode);
    if (ModuleCode='Inv')  then
    begin
      if Frm_Sys_Inv=nil then
      begin
       Frm_Sys_Inv:=TFrm_Sys_Inv.Create(Frm_Main);
       Frm_Sys_Inv.Show;
      end
      else
      Frm_Sys_Inv.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Ad' then
    begin
      if Frm_Sys_Ad=nil then
      begin
      Frm_Sys_Ad:=TFrm_Sys_Ad.Create(Frm_Main);
      Frm_Sys_Ad.Show;
      end
      else
      Frm_Sys_Ad.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Ap'  then
    begin
      if Frm_Sys_Ap=nil then
      begin
        Frm_Sys_Ap:=TFrm_Sys_Ap.Create(Frm_Main);
        Frm_Sys_Ap.Show;
      end
      else
      Frm_Sys_Ap.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Ar' then
    begin
      if  Frm_Sys_Ar=nil then
      begin
        Frm_Sys_Ar:=TFrm_Sys_Ar.Create(Frm_Main);
        Frm_Sys_Ar.Show;
      end
      else
        Frm_Sys_Ar.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Bas' then
    begin
      if Frm_Sys_Bas=nil then
      begin
        Frm_Sys_Bas:=TFrm_Sys_Bas.Create(Frm_Main);
        Frm_Sys_Bas.Show;
      end
      else
        Frm_Sys_Bas.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Bom'  then
    begin
      if Frm_Sys_Bom=nil then
      begin
        Frm_Sys_Bom:=TFrm_Sys_Bom.Create(Frm_Main);
        Frm_Sys_Bom.Show;
      end
      else
        Frm_Sys_Bom.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Gl'  then
    begin
      if Frm_Sys_Gl=nil then
      begin
        Frm_Sys_Gl:=TFrm_Sys_Gl.Create(Frm_Main);
        Frm_Sys_Gl.Show;
      end
      else
        Frm_Sys_Gl.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Mrp' then
    begin
      if Frm_Sys_Mrp=nil then
      begin
      Frm_Sys_Mrp:=TFrm_Sys_Mrp.Create(Frm_Main);
      Frm_Sys_Mrp.Show;
      end
      else
        Frm_Sys_Mrp.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Pm' then
    begin
      if Frm_Sys_Pm=nil then
      begin
      Frm_Sys_Pm:=TFrm_Sys_Pm.Create(Frm_Main);
      Frm_Sys_Pm.Show;
      end
      else
        Frm_Sys_Pm.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Qc' then
    begin
      if Frm_Sys_Qc=nil then
      begin
      Frm_Sys_Qc:=TFrm_Sys_Qc.Create(Frm_Main);
      Frm_Sys_Qc.Show;
      end
      else
        Frm_Sys_Qc.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Sal'  then
    begin
      if Frm_Sys_Sal=nil then
      begin
      Frm_Sys_Sal:=TFrm_Sys_Sal.Create(Frm_Main);
      Frm_Sys_Sal.Show;
      end
      else
        Frm_Sys_Sal.Windowstate:=wsMaximized;
    end;

    if  ModuleCode='Sfc'  then
    begin
      if Frm_Sys_Sfc=nil then
      begin
        Frm_Sys_Sfc:=TFrm_Sys_Sfc.Create(Frm_Main);
        Frm_Sys_Sfc.Show;
      end
      else
        Frm_Sys_Sfc.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Stk'  then
    begin
      if Frm_Sys_Stk=nil then
      begin
      Frm_Sys_Stk:=TFrm_Sys_Stk.Create(Frm_Main);
      Frm_Sys_Stk.Show;
      end
      else
        Frm_Sys_Stk.Windowstate:=wsMaximized;
    end;

    if ModuleCode='Sys' then
    begin
      if Frm_Sys_Sys=nil then
      begin
      Frm_Sys_Sys:=TFrm_Sys_Sys.Create(Frm_Main);
      Frm_Sys_Sys.Show;
      end
      else
        Frm_Sys_Sys.Windowstate:=wsMaximized;
    end;

    if ModuleCode='pl'then
    begin
      if Frm_Sys_Plan=nil then
      begin
      Frm_Sys_Plan:=TFrm_Sys_Plan.Create(Frm_Main);
      Frm_Sys_Plan.Show;
      end
      else
        Frm_Sys_Plan.Windowstate:=wsMaximized;
    end;
  end;
end;

end.

⌨️ 快捷键说明

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