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

📄 ujgyhxxsz.pas

📁 ProviceSystem-公积金监管系统中心端
💻 PAS
📖 第 1 页 / 共 3 页
字号:
end;

procedure TfrmJGYhXxSz.Edit11KeyPress(Sender: TObject; var Key: Char);
begin
  if not(key in ['0'..'9']) and (key <> #8) then
    key:= char(0);
end;

procedure TfrmJGYhXxSz.Edit21KeyPress(Sender: TObject; var Key: Char);
begin
  if not(key in ['0'..'9']) and (key <> #8) then
    key:= char(0);
end;

procedure TfrmJGYhXxSz.Edit41KeyPress(Sender: TObject; var Key: Char);
begin
  if not(key in ['0'..'9']) and (key <> #8) then
    key:= char(0);
end;

procedure TfrmJGYhXxSz.Edit51KeyPress(Sender: TObject; var Key: Char);
begin
  if not(key in ['0'..'9']) and (key <> #8) then
    key:= char(0);
end;

procedure TfrmJGYhXxSz.Edit52KeyPress(Sender: TObject; var Key: Char);
begin
  if not(key in ['0'..'9','.']) and (key <> #8) then
    key:= char(0);
end;

procedure TfrmJGYhXxSz.LoadInitInfo;
var
  aCity: TCityDynArray;
  aKhyh: TKhyhDynArray;
  i: smallint;
begin
  DsInfo(aCity);
  combobox11.Items.Clear;
  combobox21.Items.Clear;
  combobox31.Items.Clear;
  combobox51.Items.Clear;
  for i:=0 to high(aCity) do
  begin
    combobox11.Items.Add(aCity[i].bh +' '+aCity[i].mc);
    combobox21.Items.Add(aCity[i].bh +' '+aCity[i].mc);
    combobox31.Items.Add(aCity[i].bh +' '+aCity[i].mc);
    combobox51.Items.Add(aCity[i].bh +' '+aCity[i].mc);
  end;
  KhYhInfo(aKhyh);
  combobox12.Items.Clear;
  combobox22.Items.Clear;
  combobox52.Items.Clear;
  for i:=0 to high(aKhyh) do
  begin
    combobox12.Items.Add(aKhyh[i].bh +' '+aKhyh[i].mc);
    combobox22.Items.Add(aKhyh[i].bh +' '+aKhyh[i].mc);
    combobox52.Items.Add(aKhyh[i].bh +' '+aKhyh[i].mc);
  end;
  SubBankInfo('','',DBGrid1);
  DBGrid1.Columns[0].Width := 70;
  DBGrid1.Columns[1].Width := 120;
  DBGrid1.Columns[2].Width := 70;
  DBGrid1.Columns[3].Width := 120;
  DBGrid1.Columns[4].Width := 70;
  DBGrid1.Columns[5].Width := 120;

  DBGrid2.Columns[0].Width := 70;
  DBGrid2.Columns[1].Width := 120;
  DBGrid2.Columns[2].Width := 70;
  DBGrid2.Columns[3].Width := 120;
  DBGrid2.Columns[4].Width := 70;
  DBGrid2.Columns[5].Width := 120;
  DBGrid2.Columns[6].Width := 70;
  DBGrid2.Columns[7].Width := 120;

  DBGrid3.Columns[0].Width := 70;
  DBGrid3.Columns[1].Width := 120;
  DBGrid3.Columns[2].Width := 70;
  DBGrid3.Columns[3].Width := 120;

  DBGrid4.Columns[0].Width := 70;
  DBGrid4.Columns[1].Width := 120;

  DBGrid5.Columns[0].Width := 70;
  DBGrid5.Columns[1].Width := 120;
  DBGrid5.Columns[2].Width := 70;
  DBGrid5.Columns[3].Width := 120;
  DBGrid5.Columns[4].Width := 70;
  DBGrid5.Columns[5].Width := 120;
  DBGrid5.Columns[6].Width := 70;
  DBGrid5.Columns[7].Width := 120;
  DBGrid5.Columns[8].Width := 70;
  DBGrid5.Columns[9].Width := 120;
  DBGrid5.Columns[10].Width := 70;
  DBGrid5.Columns[11].Width := 120;
  DBGrid5.Columns[12].Width := 120;
  DBGrid5.Columns[13].Width := 120;
  DBGrid5.Columns[14].Width := 70;

end;


procedure TfrmJGYhXxSz.SaveSubBankInfo;
var
  sCity, sBank, sSubBankNum, sSubBank: String;
  l: smallint;
begin
  l:= Pos(' ',ComboBox11.Text)-1;
  sCity := trim(copy(ComboBox11.Text,1,l));
  if sCity='' then
  begin
    Application.MessageBox('地市不能为空,请选择!',PMsgCaption,64);
    ComboBox11.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox12.Text)-1;
  sBank := trim(copy(ComboBox12.Text,1,l));
  if sBank='' then
  begin
    Application.MessageBox('银行不能为空,请选择!',PMsgCaption,64);
    ComboBox12.SetFocus;
    exit;
  end;
  sSubBankNum := Trim(Edit11.Text);
  sSubBank := Trim(Edit12.Text);
  if sSubBankNum='' then
  begin
    Application.MessageBox('支行编号不能为空!',PMsgCaption,64);
    Edit11.SetFocus;
    exit;
  end;
  if sSubBank='' then
  begin
    Application.MessageBox('支行名称不能为空!',PMsgCaption,64);
    Edit12.SetFocus;
    exit;
  end;
  if isAdd then
    if IsExistSubBank(sCity,sBank,sSubBankNum) then
    begin
      Application.MessageBox('支行已经存在,请更换!',PMsgCaption,64);
      Edit11.SetFocus;
      exit;
    end;
  if SaveSubBank(sCity,sBank,sSubBankNum,sSubBank) =0 then
  begin
    SubBankInfo('','',DBGrid1);
    ToolButton2.Click;
    Application.MessageBox('存盘成功',PMsgCaption,64);
  end
  else
    Application.MessageBox('存盘失败!',PMsgCaption,48);
end;

procedure TfrmJGYhXxSz.ToolButton2Click(Sender: TObject);
var
  i: smallint;
begin
  ToolButton9.Enabled:=false;
  ToolButton2.Enabled:=false;
  for i:=0 to PageControl1.PageCount-1 do
    PageControl1.Pages[i].Enabled := True;
  case pagecontrol1.ActivePageIndex of
    0: begin
         edit11.Enabled:=false;
         edit12.Enabled:=false;
         ComboBox11.Enabled := False;
         ComboBox12.Enabled := False;
         DBGrid1.Enabled := True;
       end;
    1: begin
         ComboBox21.Enabled := False;
         ComboBox22.Enabled := False;
         ComboBox23.Enabled := False;
         edit21.Enabled:=false;
         edit22.Enabled:=false;
         DBGrid2.Enabled := True;
       end;
    2: begin
         ComboBox31.Enabled := False;
         edit31.Enabled:=false;
         edit32.Enabled:=false;
         DBGrid3.Enabled := True;
       end;
    3: begin
         edit41.Enabled:=false;
         edit42.Enabled:=false;
         DBGrid4.Enabled := True;
       end;
    4: begin
         ComboBox51.Enabled := False;
         ComboBox52.Enabled := False;
         ComboBox53.Enabled := False;
         ComboBox54.Enabled := False;
         ComboBox55.Enabled := False;
         ComboBox56.Enabled := False;
         edit51.Enabled:=false;
         edit52.Enabled:=false;
         DateTimePicker1.Enabled := False;
         DBGrid5.Enabled := True;
       end;
    end;

end;


procedure TfrmJGYhXxSz.SaveBankAccountInfo;
var
  sAccountNum, sAccount: String;
begin
  sAccountNum := Trim(Edit41.Text);
  sAccount := Trim(Edit42.Text);
  if sAccountNum='' then
  begin
    Application.MessageBox('专户编号不能为空!',PMsgCaption,64);
    Edit41.SetFocus;
    exit;
  end;
  if sAccount='' then
  begin
    Application.MessageBox('专户名称不能为空!',PMsgCaption,64);
    Edit42.SetFocus;
    exit;
  end;
  if isAdd then
    if IsExistBankAccount(sAccountNum) then
    begin
      Application.MessageBox('专户已经存在,请更换!',PMsgCaption,64);
      Edit41.SetFocus;
      exit;
    end;
  if SaveBankAccount(sAccountNum,sAccount) =0 then
  begin
    BankAccountInfo(DBGrid4);
    ToolButton2.Click;
    Application.MessageBox('存盘成功',PMsgCaption,64);
  end
  else
    Application.MessageBox('存盘失败!',PMsgCaption,48);
end;

procedure TfrmJGYhXxSz.SaveBankOfficeInfo;
var
  sCity, sBank, sSubBank, sBankOfficeNum, sBankOffice: String;
  l: smallint;
begin
  l:= Pos(' ',ComboBox21.Text)-1;
  sCity := trim(copy(ComboBox21.Text,1,l));
  if sCity='' then
  begin
    Application.MessageBox('地市不能为空,请选择!',PMsgCaption,64);
    ComboBox21.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox22.Text)-1;
  sBank := trim(copy(ComboBox22.Text,1,l));
  if sBank='' then
  begin
    Application.MessageBox('银行不能为空,请选择!',PMsgCaption,64);
    ComboBox22.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox23.Text)-1;
  sSubBank := trim(copy(ComboBox23.Text,1,l));
  if sSubBank='' then
  begin
    Application.MessageBox('支行不能为空,请选择!',PMsgCaption,64);
    ComboBox23.SetFocus;
    exit;
  end;

  sBankOfficeNum := Trim(Edit21.Text);
  sBankOffice := Trim(Edit22.Text);
  if sBankOfficeNum='' then
  begin
    Application.MessageBox('分理处编号不能为空!',PMsgCaption,64);
    Edit21.SetFocus;
    exit;
  end;
  if sBankOffice='' then
  begin
    Application.MessageBox('分理处名称不能为空!',PMsgCaption,64);
    Edit22.SetFocus;
    exit;
  end;
  if isAdd then
    if IsExistBankOffice(sCity,sBank,sSubBank,sBankOfficeNum) then
    begin
      Application.MessageBox('分理处已经存在,请更换!',PMsgCaption,64);
      Edit21.SetFocus;
      exit;
    end;
  if SaveBankOffice(sCity,sBank,sSubBank,sBankOfficeNum,sBankOffice) =0 then
  begin
    BankOfficeInfo('','','',DBGrid2);
    ToolButton2.Click;
    Application.MessageBox('存盘成功',PMsgCaption,64);
  end
  else
    Application.MessageBox('存盘失败!',PMsgCaption,48);
end;

procedure TfrmJGYhXxSz.SaveSumUpInfo;
var
  sCity, sSumUpNum, sSumUp: String;
  l: smallint;
begin
  l:= Pos(' ',ComboBox31.Text)-1;
  sCity := trim(copy(ComboBox31.Text,1,l));
  if sCity='' then
  begin
    Application.MessageBox('地市不能为空,请选择!',PMsgCaption,64);
    ComboBox31.SetFocus;
    exit;
  end;
  sSumUpNum := Trim(Edit31.Text);
  sSumUp := Trim(Edit32.Text);
  if sSumUpNum='' then
  begin
    Application.MessageBox('归集点编号不能为空!',PMsgCaption,64);
    Edit31.SetFocus;
    exit;
  end;
  if sSumUp='' then
  begin
    Application.MessageBox('归集点名称不能为空!',PMsgCaption,64);
    Edit32.SetFocus;
    exit;
  end;
  if isAdd then
    if IsExistSumUp(sCity,sSumUpNum) then
    begin
      Application.MessageBox('归集点已经存在,请更换!',PMsgCaption,64);
      Edit31.SetFocus;
      exit;
    end;
  if SaveSumUp(sCity,sSumUpNum,sSumUp) =0 then
  begin
    SumUpInfo('',DBGrid3);
    ToolButton2.Click;
    Application.MessageBox('存盘成功',PMsgCaption,64);
  end
  else
    Application.MessageBox('存盘失败!',PMsgCaption,48);
end;

procedure TfrmJGYhXxSz.SaveOpenAccountInfo;
var
  sCity, sBank, sSubBank, sBankOffice, sSumUp, sAccount, sOpenAccount: String;
  dBalance: Double;
  dtDate: TDate;
  l: smallint;
begin
  l:= Pos(' ',ComboBox51.Text)-1;
  sCity := trim(copy(ComboBox51.Text,1,l));
  if sCity='' then
  begin
    Application.MessageBox('地市不能为空,请选择!',PMsgCaption,64);
    ComboBox51.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox52.Text)-1;
  sBank := trim(copy(ComboBox52.Text,1,l));
  if sBank='' then
  begin
    Application.MessageBox('银行不能为空,请选择!',PMsgCaption,64);
    ComboBox52.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox53.Text)-1;
  sSubBank := trim(copy(ComboBox53.Text,1,l));
  if sSubBank='' then
  begin
    Application.MessageBox('支行不能为空,请选择!',PMsgCaption,64);
    ComboBox53.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox54.Text)-1;
  sBankOffice := trim(copy(ComboBox54.Text,1,l));
  if sBankOffice='' then
  begin
    Application.MessageBox('分理处不能为空,请选择!',PMsgCaption,64);
    ComboBox54.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox55.Text)-1;
  sAccount := trim(copy(ComboBox55.Text,1,l));
  if sAccount='' then
  begin
    Application.MessageBox('专户不能为空,请选择!',PMsgCaption,64);
    ComboBox55.SetFocus;
    exit;
  end;
  l:= Pos(' ',ComboBox56.Text)-1;
  sSumUp := trim(copy(ComboBox56.Text,1,l));
  if sSumUp='' then
  begin
    Application.MessageBox('归集点不能为空,请选择!',PMsgCaption,64);
    ComboBox56.SetFocus;
    exit;
  end;
  sOpenAccount := Trim(Edit51.Text);
  if trim(Edit52.Text)<>'' then
    dBalance := strtofloat(trim(Edit52.Text))
  else
    dBalance := 0;
  dtDate := DateTimePicker1.Date;
  if sOpenAccount='' then
  begin
    Application.MessageBox('开户帐号不能为空!',PMsgCaption,64);
    Edit51.SetFocus;
    exit;
  end;
  if dBalance=0 then
  begin
    Application.MessageBox('开户金额不能为0!',PMsgCaption,64);
    Edit52.SetFocus;
    exit;
  end;
  if isAdd then
    if IsExistOpenAccount(sCity, sBank, sSubBank, sBankOffice,
         sAccount, sSumUp, sOpenAccount) then
    begin
      Application.MessageBox('开户帐号已经存在,请更换!',PMsgCaption,64);
      Edit51.SetFocus;
      exit;
    end;
  if SaveOpenAccount(sCity, sBank, sSubBank, sBankOffice,
       sAccount, sSumUp, sOpenAccount,dBalance, dtDate) =0 then
  begin
    OpenAccountInfo('','','','','','',DBGrid5);
    ToolButton2.Click;
    Application.MessageBox('存盘成功',PMsgCaption,64);
  end
  else
    Application.MessageBox('存盘失败!',PMsgCaption,48);
end;

procedure TfrmJGYhXxSz.Edit52MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  (Sender as tEdit).SelectAll;
end;

procedure TfrmJGYhXxSz.Edit52Exit(Sender: TObject);
var
  dVal : Double;
  cVal : string;
begin
  inherited;
  try
    dVal := strtofloat((Sender as tEdit).Text);
    str(dVal:16:2,cVal);
    (Sender as tEdit).Text := cVal;
  except
    (Sender as tEdit).Text := '            0.00';
  end;
end;

end.

⌨️ 快捷键说明

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