📄 u_zhgl_zhgl_qtzj.pas
字号:
unit U_Zhgl_Zhgl_Qtzj;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls, Buttons, Grids, DBGrids, ExtCtrls,
ActnList, XPStyleActnCtrls, ActnMan, ComCtrls,u_public_define;
type
TFrm_Zhgl_Zhgl_QtZj = class(TForm)
Panel1: TPanel;
GroupBox1: TGroupBox;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
Label2: TLabel;
Label1: TLabel;
Label3: TLabel;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
Cmx_Gs: TComboBox;
cmx_lb: TComboBox;
ActionManager1: TActionManager;
Action1: TAction;
Action2: TAction;
Action3: TAction;
Action4: TAction;
Action5: TAction;
Action6: TAction;
Action7: TAction;
Action8: TAction;
Lbl_fs: TLabel;
Action9: TAction;
Lvw_lb1: TListView;
Lvw_lb2: TListView;
Edt_Je: TEdit;
procedure Action3Execute(Sender: TObject);
procedure Action8Execute(Sender: TObject);
procedure Action2Execute(Sender: TObject);
procedure Action9Execute(Sender: TObject);
procedure Action4Execute(Sender: TObject);
procedure Action5Execute(Sender: TObject);
procedure Action6Execute(Sender: TObject);
procedure Action7Execute(Sender: TObject);
procedure Lvw_lb1SelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure Lvw_lb2SelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure SpeedButton5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_Zhgl_Zhgl_QtZj: TFrm_Zhgl_Zhgl_QtZj;
implementation
uses U_Data;
var selectOk:Boolean;
selectOk1:Boolean;
{$R *.dfm}
procedure TFrm_Zhgl_Zhgl_QtZj.Action3Execute(Sender: TObject);
begin
data.G_con.Open();
data.G_Rst.SQL.Clear;
data.G_Rst.SQL.Add('select * from mr_jbb where m_lbbh=5');
data.G_Rst.ExecSQL;
data.G_Rst.Open;
while not data.G_Rst.Eof do
begin
cmx_lb.Items.Add(data.G_Rst.FieldValues['m_name']);
data.G_Rst.Next;
end;
data.G_Rst.SQL.Clear;
data.G_Rst.SQL.Add('select * from mr_jbb where m_lbbh=1');
data.G_Rst.ExecSQL;
data.G_Rst.Open;
while not data.G_Rst.Eof do
begin
cmx_gs.Items.Add(data.G_Rst.FieldValues['m_name']);
data.G_Rst.Next;
end;
data.G_Rst.Close;
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Action8Execute(Sender: TObject);
begin
data.G_con.Open();
data.G_Rst.SQL.Clear;
data.G_Rst.SQL.Add('select * from mr_jbb where m_lbbh=5 and m_name='+quotedstr(cmx_lb.Text));
data.G_Rst.ExecSQL;
data.G_Rst.Open;
if not data.G_Rst.Eof then
lbl_fs.Caption:=data.G_Rst.FieldValues['m_lb'];
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Action2Execute(Sender: TObject);
begin
close;
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Action9Execute(Sender: TObject);
var aa:string;
a1,a2,a3,a4:string;
begin
aa:=cmx_gs.Text;
data.G_Rst_temp1.SQL.Clear;
data.G_Rst_temp1.SQL.Add('select * from mr_people where bm='+quotedstr(aa));
data.G_Rst_temp1.ExecSQL;
data.G_Rst_temp1.Open;
self.Lvw_lb1.Items.Clear;
while not data.G_Rst_temp1.Eof do
begin
a1:= data.g_Rst_temp1.FieldValues['xm'];
a2:=data.G_Rst_Temp1.FieldValues['bh'];
a3:=data.G_Rst_Temp1.FieldValues['kh'];
a4:=data.G_Rst_Temp1.FieldValues['ycje'];
with Lvw_lb1.Items.Add do
begin
caption:=a1;
subitems.Add(a2);
subitems.Add(a3);
subitems.Add(a4);
end;
data.G_Rst_Temp1.Next;
end;
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Action4Execute(Sender: TObject);
begin
if selectok then
begin
with lvw_lb2.Items.Add do
begin
caption:=lvw_lb1.Selected.Caption;
subitems.Add(lvw_lb1.Selected.SubItems[0]);
subitems.Add(lvw_lb1.Selected.SubItems[1]);
subitems.Add(lvw_lb1.Selected.SubItems[2]);
lvw_lb1.Selected.Delete;
end;
selectok:=false;
end;
//
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Action5Execute(Sender: TObject);
begin
if selectok1 then
begin
with lvw_lb1.Items.Add do
begin
caption:=lvw_lb2.Selected.Caption;
subitems.Add(lvw_lb2.Selected.SubItems[0]);
subitems.Add(lvw_lb2.Selected.SubItems[1]);
subitems.Add(lvw_lb2.Selected.SubItems[2]);
lvw_lb2.Selected.Delete;
end;
selectok1:=false;
end;
//
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Action6Execute(Sender: TObject);
var I:integer;
begin
for i:=0 to lvw_lb1.Items.Count-1 do
begin
with lvw_lb2.Items.Add do
begin
caption:=lvw_lb1.Items.Item[i].Caption;
subitems.Add(lvw_lb1.Items.Item[i].SubItems[0]);
subitems.Add(lvw_lb1.Items.Item[i].SubItems[1]);
subitems.Add(lvw_lb1.Items.Item[i].SubItems[2]);
end;
end;
lvw_lb1.Items.Clear;
//
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Action7Execute(Sender: TObject);
var I:integer;
begin
for i:=0 to lvw_lb2.Items.Count-1 do
begin
with lvw_lb1.Items.Add do
begin
caption:=lvw_lb2.Items.Item[i].Caption;
subitems.Add(lvw_lb2.Items.Item[i].SubItems[0]);
subitems.Add(lvw_lb2.Items.Item[i].SubItems[1]);
subitems.Add(lvw_lb2.Items.Item[i].SubItems[2]);
end;
end;
lvw_lb2.Items.Clear;
//
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Lvw_lb1SelectItem(Sender: TObject;
Item: TListItem; Selected: Boolean);
begin
selectok:=true;
end;
procedure TFrm_Zhgl_Zhgl_QtZj.Lvw_lb2SelectItem(Sender: TObject;
Item: TListItem; Selected: Boolean);
begin
selectok1:=true;
end;
procedure TFrm_Zhgl_Zhgl_QtZj.SpeedButton5Click(Sender: TObject);
var I:integer;
A1,A2,A3,A4:string;
aa:string;
bb:string;
begin
if cmx_lb.Text='' then
begin
application.MessageBox('增减类别不能为空','明日科技有限公司');
exit;
end;
if self.Lvw_lb2.Items.Count=0 then
begin
application.MessageBox('请选取择要增减款的人员','明日科技有限公司');
exit;
end;
a4:='';
data.G_con.Open();
for i:=0 to lvw_lb2.Items.Count-1 do
begin
a1:=lvw_lb2.Items.Item[i].Caption;
a2:=lvw_lb2.Items.Item[i].SubItems[0];
a3:=lvw_lb2.Items.Item[i].SubItems[1];
bb:=lvw_lb2.Items.Item[i].SubItems[2];
data.G_Rst_Temp1.SQL.Clear;
aa:='insert into mr_zjb(sj,bh,xm,kh,bmmc,ye,zjje,zjhye,zjfs,zjzl,sfy,fs) values(';
aa:=aa+quotedstr(formatdatetime('yyyy年mm月dd日',now)) +',';
aa:=aa+quotedstr(a2)+',';
aa:=aa+quotedstr(a1)+',';
aa:=aa+quotedstr(a3)+',';
aa:=aa+quotedstr(cmx_gs.Text)+',';
aa:=aa+quotedstr(bb)+',';
aa:=aa+quotedstr(edt_je.Text)+',';
if lbl_fs.Caption ='增款' then
begin
bb:= floattostr(strtofloat(bb)+strtofloat(edt_je.Text));
end
else
begin
bb:= floattostr(strtofloat(bb)-strtofloat(edt_je.Text));
end;
aa:=aa+quotedstr(bb)+',';
aa:=aa+quotedstr(cmx_lb.Text)+',';
aa:=aa+quotedstr(lbl_fs.Caption)+',';
aa:=aa+quotedstr(g_str_name)+',';
aa:=aa+quotedstr('集体')+')';
data.G_Rst_temp.SQL.Clear;
data.G_Rst_temp.SQL.Add(aa);
data.G_Rst_temp.ExecSQL;
aa:='update mr_people set ycje='+quotedstr(bb)+'where bh='+quotedstr(a2);
data.G_Rst_temp.SQL.Clear;
data.G_Rst_temp.SQL.Add(aa);
data.G_Rst_temp.ExecSQL;
close;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -