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

📄 main.pas.~1~

📁 公司ERP系统
💻 ~1~
📖 第 1 页 / 共 2 页
字号:
  btnsam.ENABLED := True;
end;


procedure TMainForm.BtnPrClick(Sender: TObject);
begin
  btnPr.ENABLED := False;
  Run_main('prmain.exe');
  btnPr.ENABLED := True;
end;


procedure TMainForm.BtnkqClick(Sender: TObject);
begin
  Btnkq.ENABLED := False;
  Run_main('kqmainb.exe');
  Btnkq.ENABLED := True;
end;


procedure TMainForm.BtnMrpClick(Sender: TObject);
begin
  btnMrp.ENABLED := False;
  Run_main('mpmainb.exe');
  btnMrp.ENABLED := True;
end;


procedure TMainForm.pp4btnClick(Sender: TObject);
begin
  pp4btn.ENABLED := False;
  Run_main('plan.exe');
  pp4btn.ENABLED := True;
end;


procedure TMainForm.BtnPr2Click(Sender: TObject);
begin
  btnPr2.ENABLED := False;
  Run_main('ioproject.exe');
  btnPr2.ENABLED := True;
end;

procedure TMainForm.btndmpClick(Sender: TObject);
begin
  btndmp.ENABLED := False;
  Run_main('dmpmainb.exe');
  btndmp.ENABLED := True;
end;
//add by yyx 040823为解决部门改变
Procedure TMainForm.Get_Show_Text_New(emp_no:string);
Var
MyArray1:Array[0..10] of integer;
MyArray2:Array[0..10] of string;
i:integer;
gemp:string;
Begin
  //code here
  gemp:=emp_no;
  With Sql_Query1 do
  Begin
    Close;
    Sql.Clear;
    Sql.Add('select sql_expression from sql_table ');
    Open;
    First;
    i:=0;
    While Not Eof Do
    Begin
      If i<=(Sql_Query1.RecordCount-1) Then
        MyArray2[i]:=Sql_Query1.Fieldbyname('Sql_Expression').asstring;
      Next;
      i:=i+1;
    End;
    MainPromptForm:=TMainPromptForm.Create(application);
    For i:=0 To (Sql_Query1.RecordCount-1) Do
    Begin
      Sql_Query2.Close;
      Sql_Query2.SQL.Clear;
      Sql_Query2.SQL.Add(MyArray2[i]);
      sql_query2.parambyname('emp_no').AsString:=gemp;
      Sql_Query2.Open;
      MyArray1[i]:=Sql_Query2.Fieldbyname('a').AsInteger;
      With MainPromptForm do
      Begin
        Case I Of
        0:
        Begin
          Memo_prompt.Lines.Add(inttostr(i)+'.你有'+inttostr(MyArray1[i])+'笔请购单要请购审核.');
          Memo_Prompt.Lines.Add(#13);
        End;
        1:
        Begin
          Memo_Prompt.Lines.Add(inttostr(i)+'.你有'+inttostr(MyArray1[i])+'笔请购单要请购核准.');
          Memo_Prompt.Lines.Add(#13);
        End;
        2:
        Begin
          Memo_Prompt.Lines.Add(inttostr(i)+'.你有'+inttostr(MyArray1[i])+'笔请购单待分配承办人.');
          Memo_Prompt.Lines.Add(#13);
        End;
        3:
        Begin
          Memo_Prompt.Lines.Add(inttostr(i)+'.你有'+inttostr(MyArray1[i])+'笔资料需要询价审核.');
          Memo_Prompt.Lines.Add(#13);
        End;
        4:
        Begin
          Memo_Prompt.Lines.Add(inttostr(i)+'.你有'+inttostr(MyArray1[i])+'笔资料需要询价核示.');
          Memo_Prompt.Lines.Add(#13);
        End;
        5:
        Begin
          Memo_Prompt.Lines.Add(inttostr(i)+'.你有'+inttostr(MyArray1[i])+'笔资料需要验收核示.');
          Memo_Prompt.Lines.Add(#13);
        End;
        End;
      End;//with MainPromptForm do
    End;//For i:=0 To (Sql_Query1.FieldCount-1) do
  End;//With Sql_Query1 Do
  With MainPromptForm Do
  Begin
    Top:=MainForm.Top;
    Left:=MainForm.Left+MainForm.Width;
    Height:=MainForm.Height;
    Show;
  End;
End;

procedure TMainform.get_show_text(bol:boolean);
var vrq_count1,vrq_count2,vinq1_count,vinq2_count,vinq3_count,vcheck_count,vdistribute_count:integer;
    temp_emp_no:string;
    i,j:integer;
begin
  with Qry_show_text do//add by dongat 040818
  begin
    close;
    sql.clear;
    sql.add('select * from poautoshow ');
    open;
    if fieldbyname('show_yn').asstring<>'Y' then
    begin
      close;
      exit;
    end;
  end;//Qry_show_text
  vrq_count1:=0;//请购审核1
  vrq_count2:=0;//请购审核2
  vinq1_count:=0;//询价一审
  vinq2_count:=0;//询价二审
  vinq3_count:=0;//询价核准
  vcheck_count:=0;//验收核示
  vdistribute_count:=0;//分配承办人
  tientaisqltable.Close;
  tientaisqltable.open;
  if tientaisqltable.FindKey(['MAIN','MAIN',1]) then//请购一审笔数
  begin
    Qry_show_text.close;
    Qry_show_text.SQL.Text:=tientaisqltable.fieldbyname('sql_text').AsString;
    if length(trim(Qry_show_text.sql.Text))>0 then
    begin
      Qry_show_text.ParamByName('emp_no').asstring:=gemp_no;
      Qry_show_text.Open;
      vrq_count1:=Qry_show_text.fields[0].asinteger;
      Qry_show_text.Close;
    end;
  end;
  if tientaisqltable.FindKey(['MAIN','MAIN',2]) then//请购二审笔数
  begin
    Qry_show_text.close;
    Qry_show_text.SQL.Text:=tientaisqltable.fieldbyname('sql_text').AsString;
    if length(trim(Qry_show_text.sql.Text))>0 then
    begin
      Qry_show_text.ParamByName('emp_no').asstring:=gemp_no;
      Qry_show_text.Open;
      vrq_count2:=Qry_show_text.fields[0].asinteger;
      Qry_show_text.Close;
    end;
  end;
  if tientaisqltable.FindKey(['MAIN','MAIN',3]) then//分配承办人笔数
  begin
    Qry_show_text.close;
    Qry_show_text.SQL.Text:=tientaisqltable.fieldbyname('sql_text').AsString;
    if length(trim(Qry_show_text.sql.Text))>0 then
    begin
      Qry_show_text.ParamByName('emp_no').asstring:=gemp_no;
      Qry_show_text.Open;
      vdistribute_count:=Qry_show_text.fields[0].asinteger;
      Qry_show_text.Close;
    end;
  end;
  if tientaisqltable.FindKey(['MAIN','MAIN',4]) then//询价一审笔数
  begin
    Qry_show_text.close;
    Qry_show_text.SQL.Text:=tientaisqltable.fieldbyname('sql_text').AsString;
    if length(trim(Qry_show_text.sql.Text))>0 then
    begin
      Qry_show_text.ParamByName('emp_no').asstring:=gemp_no;
      Qry_show_text.Open;
      vinq1_count:=Qry_show_text.fields[0].asinteger;
      Qry_show_text.Close;
    end;
  end;
  if tientaisqltable.FindKey(['MAIN','MAIN',5]) then//请购一审笔数
  begin
    Qry_show_text.close;
    Qry_show_text.SQL.Text:=tientaisqltable.fieldbyname('sql_text').AsString;
    if length(trim(Qry_show_text.sql.Text))>0 then
    begin
      Qry_show_text.ParamByName('emp_no').asstring:=gemp_no;
      Qry_show_text.Open;
      vinq2_count:=Qry_show_text.fields[0].asinteger;
      Qry_show_text.Close;
    end;
  end;
  if tientaisqltable.FindKey(['MAIN','MAIN',6]) then//请购一审笔数
  begin
    Qry_show_text.close;
    Qry_show_text.SQL.Text:=tientaisqltable.fieldbyname('sql_text').AsString;
    if length(trim(Qry_show_text.sql.Text))>0 then
    begin
      Qry_show_text.ParamByName('emp_no').asstring:=gemp_no;
      Qry_show_text.Open;
      vinq3_count:=Qry_show_text.fields[0].asinteger;
      Qry_show_text.Close;
    end;
  end;
  if tientaisqltable.FindKey(['MAIN','MAIN',7]) then//请购一审笔数
  begin
    Qry_show_text.close;
    Qry_show_text.SQL.Text:=tientaisqltable.fieldbyname('sql_text').AsString;
    if length(trim(Qry_show_text.sql.Text))>0 then
    begin
      Qry_show_text.ParamByName('emp_no').asstring:=gemp_no;
      Qry_show_text.Open;
      vcheck_count:=Qry_show_text.fields[0].asinteger;
      Qry_show_text.Close;
    end;
  end;
  /////////////////////
  i:=1;
  if (vrq_count1>0) or (vrq_count2>0) or (vinq1_count>0) or (vinq2_count>0) or
     (vinq3_count>0) or (vcheck_count>0) or (vdistribute_count>0) then
  begin
    if not assigned(mainpromptform) then
      mainpromptform:=Tmainpromptform.create(application);
    with mainpromptform do
    begin
      Memo_prompt.Lines.clear;
      if vrq_count1>0 then
      begin
        Memo_prompt.Lines.add(inttostr(i)+'.你有'+inttostr(vrq_count1)+'笔请购单要请购一审.');
        Inc(i);
        Memo_prompt.lines.Add(#13);
      end;
      if vrq_count2>0 then
      begin
        Memo_prompt.Lines.add(inttostr(i)+'.你有'+inttostr(vrq_count2)+'笔请购单要请购二审.');
        Inc(i);
        Memo_prompt.lines.Add(#13);
      end;
      if vdistribute_count>0 then
      begin
        Memo_prompt.Lines.Add(inttostr(i)+'.你有'+inttostr(vdistribute_count)+'笔请购单待分配承办人.');
        Inc(i);
        Memo_prompt.Lines.Add(#13);
      end;
      if vinq1_count>0 then
      begin
        Memo_prompt.Lines.add(inttostr(i)+'.你有'+inttostr(vinq1_count)+'笔资料需要询价一审.');
        Inc(i);
        Memo_prompt.lines.Add(#13);
      end;
      if vinq2_count>0 then
      begin
        Memo_prompt.Lines.add(inttostr(i)+'.你有'+inttostr(vinq2_count)+'笔资料需要询价二审.');
        Inc(i);
        Memo_prompt.lines.Add(#13);
      end;
      if vinq3_count>0 then//add by dong at 050328
      begin
        Memo_prompt.Lines.add(inttostr(i)+'.你有'+inttostr(vinq3_count)+'笔资料需要询价核准.');
        Inc(i);
        Memo_prompt.lines.Add(#13);
      end;
      if vcheck_count>0 then
      begin
        Memo_prompt.lines.add(inttostr(i)+'.你有'+inttostr(vcheck_count)+'笔资料需要验收核示.');
        Inc(i);
        Memo_prompt.lines.add(#13);
      end;
      top:=mainform.Top;
      left:=mainform.Left+mainform.Width;
      height:=mainform.Height;
      show;
    end;
  end
  else
  begin
    if bol then
    begin
      if assigned(mainpromptform) then
        mainpromptform.Close;
      messagedlg('目前无任何提示信息!',mtinformation,[mbok],0);
    end;
  end;
end;

procedure TMainForm.btn_msgClick(Sender: TObject);
begin
  btn_msg.Enabled:=false;
  application.ProcessMessages;
  get_show_text(true);//add by dong at 040225
  btn_msg.Enabled:=true;
  //get_show_text_new(gemp_no);//add by yyx 040823 解决部门改变
end;

procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  reg.CloseKey;
  reg.Free;
end;

procedure TMainForm.CheckBox_auto_showClick(Sender: TObject);
begin
  case CheckBox_auto_show.Checked of
    true:
      begin
        reg.writestring('tientai_sys_auto','1');
      end;
    false:
      begin
        reg.WriteString('tientai_sys_auto','0');
      end;
  end;//case
end;

procedure Tmainform.connect_drive_x;//add by dong at 040806(目的:解决windowsXP未加入域的情况下也连上X盘)
var 
   NRW: TNetResource;
begin
  with NRW do
  begin
    dwType := RESOURCETYPE_ANY;
    lpLocalName :='X:';
    lpRemoteName:='\\mis01\user';
    lpProvider := '';
  end;
  if GETDRIVETYPE(PChar('X:'))<>DRIVE_REMOTE then
  begin
   if not (WNetAddConnection2(NRW,pchar(gPassword),pchar(guser_id),CONNECT_UPDATE_PROFILE)=NO_ERROR) then
     messagedlg('网络驱动器(X盘->\\mis01\user)未能连接成功!',mtwarning,[mbok],0);
  end;
end;

procedure TMainForm.Database2Login(Database: TDatabase;
  LoginParams: TStrings);
begin
  LoginParams.Values['user name']:='';
  LoginParams.Values['password']:='';
end;

end.

⌨️ 快捷键说明

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