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

📄 main.pas

📁 公司ERP系统
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    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.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  reg.CloseKey;
  reg.Free;
end;


procedure Tmainform.connect_drive_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;

procedure TMainForm.ImBtnClick(Sender: TObject);
begin
 btnqc.ENABLED := False;
  Run_main('qc.exe');
  btnqc.ENABLED := True;
end;

end.

⌨️ 快捷键说明

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