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

📄 xsh_unit.pas

📁 delphi进销存管理系统 很不错得进销存管理系统 有很多skin得
💻 PAS
📖 第 1 页 / 共 2 页
字号:
procedure Txsh_form.SpeedButton11Click(Sender: TObject);
begin
  jh_yg_find_form := Tjh_yg_find_form.create(application);
  jh_yg_find_form.show;
  jh_yg_find_form.DBGrid1.Visible := false;
  jh_yg_find_form.DBGrid2.Visible := false;
  jh_yg_find_form.DBGrid3.Visible := true;
  jh_yg_find_form.DBGrid4.Visible := false;
  jh_yg_find_form.DBGrid5.Visible := false;
  jh_yg_find_form.DBGrid6.Visible := false;
end;

procedure Txsh_form.SpeedButton1Click(Sender: TObject);
begin
  jh_sp_find_form := Tjh_sp_find_form.create(application);
  jh_sp_find_form.show;
  jh_sp_find_form.DBGrid1.Visible := false;
  jh_sp_find_form.DBGrid2.Visible := false;
  jh_sp_find_form.DBGrid3.Visible := false;
  jh_sp_find_form.DBGrid4.Visible := true;
//jh_sp_find_form.DBGrid1.Visible :=false;
end;

procedure Txsh_form.Edit4KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    speedbutton11click(nil);

end;

procedure Txsh_form.Edit6KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    speedbutton1click(nil);

end;

procedure Txsh_form.Edit13KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    edit14.SetFocus;

end;

procedure Txsh_form.Edit13KeyPress(Sender: TObject; var Key: Char);
begin
  if not (key in ['0'..'9', '.', #8, #13]) then
  begin
    showmessage('请正确输入数值');
    key := #0;
    edit13.SetFocus;
  end;

end;

procedure Txsh_form.Edit14KeyPress(Sender: TObject; var Key: Char);
begin
  if not (key in ['0'..'9', '.', #8, #13]) then
  begin
    showmessage('请正确输入数值');
    key := #0;
    edit14.SetFocus;
  end;

end;

procedure Txsh_form.Edit14KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    speedbutton15click(nil);

end;

procedure Txsh_form.SpeedButton5Click(Sender: TObject);
begin
  jh_ghs_find_form := Tjh_ghs_find_form.create(application);
  jh_ghs_find_form.show;
  jh_ghs_find_form.DBGrid1.Visible := false;
  jh_ghs_find_form.DBGrid2.Visible := false;
  jh_ghs_find_form.DBGrid3.Visible := false;
  jh_ghs_find_form.DBGrid4.Visible := true;

end;

procedure Txsh_form.SpeedButton6Click(Sender: TObject);
begin
  jh_yg_find_form := Tjh_yg_find_form.create(application);
  jh_yg_find_form.show;
  jh_yg_find_form.DBGrid1.Visible := false;
  jh_yg_find_form.DBGrid2.Visible := false;
  jh_yg_find_form.DBGrid3.Visible := false;
  jh_yg_find_form.DBGrid4.Visible := true;
  jh_yg_find_form.DBGrid5.Visible := false;
  jh_yg_find_form.DBGrid6.Visible := false;

end;

procedure Txsh_form.Edit5KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = vk_return then
    edit6.SetFocus;
end;

procedure Txsh_form.DBGrid1CellClick(Column: TColumn);
begin
  if dbgrid1.DataSource.DataSet.RecordCount > 0 then
//begin
    edit32.Text := dbgrid1.DataSource.DataSet.FieldValues['编号'];
//else
//showmessage('请刷新选择记录!');
//edit31.Text :=dbgrid1.DataSource.DataSet.FieldValues['单据编码'];
//end;

end;

procedure Txsh_form.SpeedButton19Click(Sender: TObject);
begin
  with database do
  begin
    adoq1.Connection := adoc;
    adoq1.SQL.Clear;
    adoq1.SQL.Add('select * from xshd');
    adoq1.Active := true;
    datas1.DataSet := adoq1;
    dbgrid1.DataSource := datas1;
    statusbar1.Panels[1].Text := inttostr(adoq1.Recordset.RecordCount);
  end;
end;

procedure Txsh_form.SpeedButton16Click(Sender: TObject);
begin
  xsh_find_form := Txsh_find_form.create(application);
  xsh_find_form.show;
end;

procedure Txsh_form.SpeedButton7Click(Sender: TObject);
begin
  if (length(edit15.Text) <> 0) and (length(edit18.Text) <> 0) then
  begin
    with database do
    begin
      adoq2.Connection := adoc;
      if (length(edit20.Text) = 0) then edit20.Text := '0';
      if (length(edit21.Text) = 0) then edit21.Text := '0';
      if (length(edit22.Text) = 0) then edit22.Text := '0';
      if (length(edit23.Text) = 0) then edit23.Text := '0';
      if (length(edit36.Text) = 0) then edit36.Text := '0';
//edit23.Text :=floattostr(strtofloat(edit21.Text)-strtofloat(edit20.Text)-strtofloat(edit22.Text));
      edit22.Text := floattostr(strtofloat(edit36.Text) + strtofloat(edit20.Text));
      edit26.Text := formatdatetime('yy-mm-dd', datetimepicker2.date);
//edit27.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
      edit28.Text := formatdatetime('MM-dd-yy', datetimepicker2.date);
//edit35.Text :=formatdatetime('MM-dd-yy',datetimepicker2.date);
      adoq2.SQL.Clear;
      adoq2.SQL.Add('insert into xsfk(录单日期,单据编码,供货商名称,经手人,销售单号,发票类型,付款方式,本次付款,应付总金额,已付金额,未付金额,票号,备注) values(:ldrq,:djbm,:gysmc,:jsr,:jhdh,:fplx,:fkfs,:bcfk,:yfzje,:yfje,:wfje,:ph,:bz)');
      adoq2.parameters.ParamByName('ldrq').value := edit26.Text;
      adoq2.parameters.ParamByName('djbm').value := edit15.text;
      adoq2.parameters.ParamByName('gysmc').value := edit16.text;
      adoq2.Parameters.ParamByName('jsr').Value := edit17.Text;
      adoq2.Parameters.ParamByName('jhdh').Value := edit18.text;
      adoq2.parameters.ParamByName('fplx').value := combobox3.Text;
      adoq2.parameters.ParamByName('fkfs').value := edit19.text;
      adoq2.parameters.ParamByName('bcfk').value := strtofloat(edit20.text);
      adoq2.Parameters.ParamByName('yfzje').Value := strtofloat(edit21.text);
      adoq2.Parameters.ParamByName('yfje').Value := strtofloat(edit22.text);
      adoq2.parameters.ParamByName('wfje').value := strtofloat(edit23.text);
      adoq2.parameters.ParamByName('ph').value := edit24.text;
      adoq2.parameters.ParamByName('bz').value := edit25.text;
      adoq2.ExecSQL;
      adoq2.SQL.Clear;
      adoq2.SQL.Add('select * from xshfk where 录单日期 between #' + edit28.text + '# and #' + edit28.text + '#');
//adoq2.Parameters.ParamByName('djbm').Value :=edit2.Text;
      adoq2.Active := true;
      datas2.DataSet := adoq2;
      dbgrid2.DataSource := datas2;
      statusbar2.Panels[1].Text := inttostr(adoq2.Recordset.RecordCount);
      edit15.Clear; edit16.Clear; edit17.Clear; edit18.Clear; edit19.clear; edit24.Clear; edit25.Clear;
      combobox3.Text := '';
      edit20.Text := '0'; edit21.Text := '0'; edit22.Text := '0';
      edit23.Text := '0';
      datetimepicker1.date := date;
      edit15.SetFocus;
    end;
  end
  else
  begin
    showmessage('请正确输入单句编码和销售单号!');
    edit15.SetFocus
  end;

end;

procedure Txsh_form.SpeedButton13Click(Sender: TObject);
begin
  with database do
  begin
    adoq1.Connection := adoc;
    if application.MessageBox('是否真的删除?', '记录删除', 4) = 6 then
    begin
      if length(edit27.text) = 0 then showmessage('请刷新选择记录!');
      adoq1.SQL.Clear;
      adoq1.SQL.Add('delete from xsfk where 编号=:djbm ');
      adoq1.Parameters.ParamByName('djbm').Value := edit27.Text;
      adoq1.ExecSQL;
    end;
    adoq1.SQL.Clear;
    adoq1.SQL.Add('select * from xsfk');
    adoq1.Active := true;
    datas2.DataSet := adoq1;
    dbgrid2.DataSource := datas2;
    statusbar2.Panels[1].Text := inttostr(adoq1.Recordset.RecordCount);
  end;

end;

procedure Txsh_form.SpeedButton20Click(Sender: TObject);
begin
  with database do
  begin
    adoq2.Connection := adoc;
    adoq2.SQL.Clear;
    adoq2.SQL.Add('select * from xsfk order by 录单日期 ');
    adoq2.Active := true;
    datas2.DataSet := adoq2;
    dbgrid2.DataSource := datas2;
    statusbar2.Panels[1].Text := inttostr(adoq2.Recordset.RecordCount);
  end;

end;

procedure Txsh_form.DBGrid2CellClick(Column: TColumn);
begin
  if dbgrid2.DataSource.DataSet.RecordCount > 0 then
  begin
    edit27.Text := dbgrid2.DataSource.DataSet.FieldValues['编号'];
    edit38.Text := dbgrid2.DataSource.DataSet.FieldValues['单据编码'];
  end;

end;

procedure Txsh_form.SpeedButton8Click(Sender: TObject);
begin
  jh_jhdh_find_form := Tjh_jhdh_find_form.Create(application);
  jh_jhdh_find_form.Show;
  jh_jhdh_find_form.DBGrid1.Visible := false;
  jh_jhdh_find_form.DBGrid2.Visible := false;
  jh_jhdh_find_form.DBGrid3.Visible := true;
  jh_jhdh_find_form.DBGrid4.Visible := true;
end;

procedure Txsh_form.SpeedButton12Click(Sender: TObject);
begin
  xshfk_find_form := Txshfk_find_form.create(application);
  xshfk_find_form.show;
end;

procedure Txsh_form.SpeedButton9Click(Sender: TObject);
begin
  jh_sfkfs_find_form := Tjh_sfkfs_find_form.create(application);
  jh_sfkfs_find_form.show;
  jh_sfkfs_find_form.DBGrid1.Visible := false;
  jh_sfkfs_find_form.DBGrid2.Visible := true;
end;

end.


//此源码由程序太平洋收集整理发布,任何人都可自由转载,但需保留本站信息
//╭⌒╮┅~ ¤ 欢迎光临程序太平洋╭⌒╮
//╭⌒╭⌒╮╭⌒╮~╭⌒╮  ︶  ,︶︶
//,︶︶︶︶,''︶~~ ,''~︶︶  ,''
//╔ ╱◥███◣═╬╬╬╬╬╬╬╬╬╗
//╬ ︱田︱田 田 ︱          ╬
//╬       http://www.5ivb.net ╬
//╬  ╭○╮●                     ╬
//╬  /■\/■\                    ╬
//╬   <| ||    有希望,就有成功! ╬
//╬                 ╬
//╚╬╬╬╬╬╬╬╬╬╬╗  ╔╬╬╬╬╝
//
//说明:
//专业提供VB、.NET、Delphi、ASP、PB源码下载
//包括:程序源码,控件,商业源码,系统方案,开发工具,书籍教程,技术文档

⌨️ 快捷键说明

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