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

📄 main_unit.~pas

📁 仓库管理信息系统 DELPHI代码作的
💻 ~PAS
字号:
unit main_unit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TEMPLETFORM, Menus, ComCtrls, ToolWin, StdCtrls, ExtCtrls, jpeg,
  GX_Outlook, ImgList, fcOutlookList, fcButton, fcImgBtn, fcShapeBtn,
  fcClearPanel, fcButtonGroup, fcOutlookBar;

type
  Tmain_form = class(TTEMPLETF)
    Panel1: TPanel;
    Image1: TImage;
    fcOutlookBar1: TfcOutlookBar;
    fcOutlookBar1OutlookList1: TfcOutlookList;
    fcOutlookBar1fcShapeBtn1: TfcShapeBtn;
    fcOutlookBar1OutlookList2: TfcOutlookList;
    fcOutlookBar1fcShapeBtn2: TfcShapeBtn;
    fcOutlookBar1OutlookList3: TfcOutlookList;
    fcOutlookBar1fcShapeBtn3: TfcShapeBtn;
    ImageList1: TImageList;
    Edit1: TEdit;
    Edit2: TEdit;
    fcOutlookBar1OutlookList4: TfcOutlookList;
    fcOutlookBar1fcShapeBtn4: TfcShapeBtn;
    procedure fcOutlookBar1OutlookList1Items1Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList2Items0Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList1Items0Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList2Items1Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList2Items2Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList2Items3Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList2Items4Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList3Items0Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList3Items1Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList3Items2Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList3Items3Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList2Items5Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure FormShow(Sender: TObject);
    procedure fcOutlookBar1OutlookList4Items0Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
    procedure fcOutlookBar1OutlookList4Items1Click(
      OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  main_form: Tmain_form;



implementation




uses goodsin_unit, login_unit, receive_unit, withdraw_unit, exchange_unit,
  check_unit, manufacturer_unit, depot_unit, storage_unit, sell_unit,
  goods_out_unit,Registry,data_unit;

{$R *.dfm}

procedure Tmain_form.fcOutlookBar1OutlookList1Items1Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
close;
end;

procedure Tmain_form.fcOutlookBar1OutlookList2Items0Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
goods_in.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList1Items0Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
if fcOutlookBar1OutlookList1.Items[0].Text='用户登陆' then
login.ShowModal
else
begin
  if application.MessageBox('确定注销吗?','系统信息',mb_yesno+mb_iconquestion)=id_yes then
  begin
  main_form.fcOutlookBar1fcShapeBtn2.Enabled:=false;
  main_form.fcOutlookBar1fcShapeBtn3.Enabled:=false;
  main_form.fcOutlookBar1fcShapeBtn4.Enabled:=false;
  fcOutlookBar1OutlookList1.Items[0].Text:='用户登陆'
  end;
end;
end;

procedure Tmain_form.fcOutlookBar1OutlookList2Items1Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
receive.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList2Items2Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
withdraw.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList2Items3Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
exchange.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList2Items4Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
  if strtoint(trim(edit1.Text))=63 then
    check.ShowModal
  else
  begin
    application.MessageBox('您的权限不够,不能使用!','系统信息',mb_ok+mb_iconinformation);
    exit;
  end;
end;

procedure Tmain_form.fcOutlookBar1OutlookList3Items0Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
  manufacturer.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList3Items1Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
  depot.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList3Items2Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
  storage.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList3Items3Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;

sell.ShowModal;
end;

procedure Tmain_form.fcOutlookBar1OutlookList2Items5Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
goods_out.ShowModal;
end;

procedure Tmain_form.FormShow(Sender: TObject);
var
  Reg: TRegistry;
  var server,uid,sqlPassword,databasename,s:string;
begin
  inherited;
   databasename:='silk';                             //读取注册表
   Reg := TRegistry.Create;
   Reg.RootKey := HKEY_LOCAL_MACHINE;
   try
    if Reg.OpenKey('\SOFTWARE\Silk\DBConn', True) then
    begin
    server:=Reg.ReadString('DataSource');
    uid:=Reg.ReadString('UserName');
    sqlPassword:=Reg.ReadString('Password');
   end ;
   except
    Reg.Free;
     end;

  data.ADOConnection1.Close;
  s:='';
  s:=s+'Provider=SQLOLEDB.1;';
  s:=s+'Password='+ sqlPassword +';';
  s:=S+'Persist Security Info=True;';
  s:=S+'User ID='+ UID +';';
  s:=S+'Initial Catalog='+ dataBaseName +';';
  s:=S+'Data Source='+ server + ';';

  try
    data.ADOConnection1.ConnectionString:=s;
    data.ADOConnection1.LoginPrompt:=false;
    data.ADOConnection1.Connected:=true;
  except
    showmessage('数据库错误');
    application.Terminate;
  end;

end;


procedure Tmain_form.fcOutlookBar1OutlookList4Items0Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
storage.ShowModal ;
end;

procedure Tmain_form.fcOutlookBar1OutlookList4Items1Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  inherited;
sell.ShowModal;
end;

end.

⌨️ 快捷键说明

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