unit mainform;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ShellAPI, Menus, ExtCtrls,  Buttons, StdCtrls, jpeg;

type
  Tfmainform = class(TForm)
    img1: TImage;
    tmr1: TTimer;
    btn122: TSpeedButton;
    btn1: TSpeedButton;
    btn3: TSpeedButton;
    lbl1: TLabel;
    lbl2: TLabel;
    img2: TImage;
    Image1: TImage;
    Label1: TLabel;
    lbl3: TLabel;
    pm2: TPopupMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    bvl1: TBevel;
    bvl2: TBevel;
    pm1: TPopupMenu;
    MenuItem1: TMenuItem;
    MenuItem2: TMenuItem;
    MenuItem3: TMenuItem;
    lbl4: TLabel;
    MSSQL1: TMenuItem;
    Label2: TLabel;
    lbl5: TLabel;
    tmr2: TTimer;
    N4: TMenuItem;
    procedure tmr1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure N2Click(Sender: TObject);

    procedure btn122Click(Sender: TObject);
    procedure lbl2Click(Sender: TObject);
    procedure Label1Click(Sender: TObject);
    procedure lbl1Click(Sender: TObject);
    procedure lbl2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
    procedure lbl2MouseLeave(Sender: TObject);
    procedure btn1Click(Sender: TObject);
    procedure btn3Click(Sender: TObject);
    procedure N1Click(Sender: TObject);
    procedure N3Click(Sender: TObject);
    procedure MenuItem1Click(Sender: TObject);
    procedure MenuItem3Click(Sender: TObject);
    procedure MSSQL1Click(Sender: TObject);
    procedure lbl5Click(Sender: TObject);
    procedure tmr2Timer(Sender: TObject);
    procedure N4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    path:string;
  end;

var
  fmainform: Tfmainform;

implementation

{$R *.dfm}

procedure Tfmainform.btn122Click(Sender: TObject);
begin
close;
end;

procedure Tfmainform.tmr1Timer(Sender: TObject);
begin

tmr1.Enabled :=false;
img1.Refresh;
fmainform.Refresh;
Label2.Transparent:=true;
Label2.Refresh;
lbl4.Transparent:=true;
lbl4.Refresh;
lbl1.Transparent:=true;
lbl1.Refresh;
lbl2.Transparent:=true;
lbl2.Refresh;
lbl3.Transparent:=true;
lbl3.Refresh;
Label1.Transparent:=true;
Label1.Refresh;
lbl5.Transparent:=true;
lbl5.Refresh;
end;

procedure Tfmainform.tmr2Timer(Sender: TObject);
begin
if lbl5.Font.Color=clBlue then
   lbl5.Font.Color:=clRed
else
   lbl5.Font.Color:=clBlue;
lbl5.Transparent:=true;
lbl5.Refresh;
end;

procedure Tfmainform.FormCreate(Sender: TObject);
begin
path:=ExtractFilePath(paramstr(0));
end;

procedure Tfmainform.N1Click(Sender: TObject);
begin
if Application.MessageBox('单机版或网络版服务器端需安装MSSQL或MSDE,你确定已安装了吗?',PChar(Application.Title), MB_OKCANCEL + MB_ICONQUESTION) = IDOK then
begin
  winexec(pchar(path+'/sun/服装鞋行业.exe'),0);
end;
end;

procedure Tfmainform.N2Click(Sender: TObject);
begin
winexec(pchar(path+'msde/setup.exe'),0);
end;



procedure Tfmainform.N3Click(Sender: TObject);
begin
ShellExecute(Handle, 'open', PChar(path+'doc\readme.doc'), nil, nil, SW_SHOW);

end;

procedure Tfmainform.N4Click(Sender: TObject);
begin
if Application.MessageBox('单机版或网络版服务器端需安装MSSQL或MSDE,你确定已安装了吗?',PChar(Application.Title), MB_OKCANCEL + MB_ICONQUESTION) = IDOK then
  begin
    winexec(pchar(path+'/sun/商贸行业.exe'),0);
  end;
end;

procedure Tfmainform.Label1Click(Sender: TObject);
begin
ShellExecute(handle,'open',pchar('http://sunsoft2010.taobao.com'),'','',SW_SHOWMAXIMIZED);
  //ShellExecute(Handle, 'open', PChar(path+'clothingjxc/readme.doc'), nil, nil, SW_SHOW);

end;

procedure Tfmainform.lbl1Click(Sender: TObject);
begin
shellexecute(handle,'open', pchar('tencent://message/?uin=514315352'+'&Site=lvehe&Menu=yes'), nil, nil,sw_shownormal);

end;

procedure Tfmainform.lbl2Click(Sender: TObject);
begin
 ShellExecute(handle,'open',pchar('http://www.haiinfo.com'),'','',SW_SHOWMAXIMIZED);

end;

procedure Tfmainform.lbl2MouseLeave(Sender: TObject);
begin
(Sender as TLabel).Font.Color:=clBlack;
(Sender as TLabel).Font.Style:=[];
end;

procedure Tfmainform.lbl2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
(Sender as TLabel).Font.Color:=clBlue;
(Sender as TLabel).Font.Style:=[fsUnderline];
end;

procedure Tfmainform.lbl5Click(Sender: TObject);
begin
 ShellExecute(handle,'open',pchar('http://www.haiinfo.com/BBS/index.asp?boardid=3'),'','',SW_SHOWMAXIMIZED);

end;

procedure Tfmainform.MenuItem1Click(Sender: TObject);
begin
if Application.MessageBox('你确定本机未安装MSSQL或MSDE吗?',PChar(Application.Title), MB_OKCANCEL + MB_ICONQUESTION) = IDOK then
begin
    Application.MessageBox(PChar('安装完毕后请勿必一定先重启计算机!' + #13#10 + '或者手工首先启动MSDE!'), PChar(Application.Title), MB_OK + MB_ICONINFORMATION);
    winexec(pchar(path+'msde/setup.exe'),0);
end;
end;

procedure Tfmainform.MenuItem3Click(Sender: TObject);
begin
winexec(pchar(path+'tools/MsManagerPro.exe'),0);
end;

procedure Tfmainform.MSSQL1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open', PChar(path+'doc\SQL2000系统维护手册.doc'), nil, nil, SW_SHOW);
end;

procedure Tfmainform.btn1Click(Sender: TObject);
begin
pm1.Popup(btn1.Left+fmainform.Left,btn1.Top+fmainform.Top+btn1.Height);



end;

procedure Tfmainform.btn3Click(Sender: TObject);
begin

pm2.Popup(btn3.Left+fmainform.Left,btn3.Top+fmainform.Top+btn3.Height);

end;


end.
