📄 breakinfo.pas
字号:
flatcombobox9.ItemIndex :=-1;
//flatcombobox10.ItemIndex :=-1;
dateedit1.Date :=0 ;
dateedit2.Date :=0 ;
dateedit3.Date :=0 ;
flatedit1.Text :='';
flatedit2.Text :='';
flatedit3.Text :='';
flatedit4.Text :='';
flatedit5.Text :='';
flatedit6.Text :='';
flatedit7.Text :='';
flatedit8.Text :='';
flatedit9.Text :='';
//Flatedit.Text :='';
//DataShare_frm.Query1.Close ;
DataShare_frm.Query1.Active :=false;
changed:=false;
RMD_Record_Count:=0;
Add_Delete:=false;
RMD.Close ;
end;
function TBreakinfo_frm.whetherChanged ;
{var
i:integer; }
begin
//if not DataShare_frm.Query1.Active then Result:=false;
Result:=changed;
{//----------------------20040610-------------------
Result:=false;
if not changed then exit;
if DataShare_frm.Query1.Active then
with DataShare_frm.Query1 do
begin
if (Flatcombobox7.ItemIndex=7 ) and (Fields[5].AsInteger<>9) then
begin
Result:=true;
exit;
end;
if (Fields[2].AsInteger<>Flatcombobox6.ItemIndex)
or (Dateedit1.Date<>Fields[3].AsDateTime) or
(trim(Flatedit5.Text)<>trim(Fields[6].AsString)) or
(trim(Flatedit6.Text)<>trim(Fields[7].AsString)) or
(trim(flatedit7.Text)<>trim(Fields[8].AsString)) or
(dateedit2.Date<>Fields[9].AsDateTime) or
(flatcombobox8.ItemIndex<>Fields[10].AsInteger) or
(flatcombobox10.ItemIndex<>Fields[11].AsInteger) or
(dateedit3.Date<>Fields[12].AsDateTime) or
(flatcombobox9.ItemIndex<>Fields[13].AsInteger ) or
(trim(flatedit9.Text)<>trim(Fields[14].AsString)) then
Result:=true;
end;
//---------------------------20040610-------------------}
end;
procedure TBreakinfo_frm.SaveV1 ;
begin
//////////////////////////////////// 更新数据 sbdz_pspause
try
DataShare_frm.Dbs.StartTransaction ;
with DataShare_frm.Query5 do
begin
close;
sql.Clear ; // status=:param9,
sql.Add('update sbdb_psarch set sex=:param1,bdate=:param2,identity=:param3,tel=:param4,address=:param5,zip=:param6,wkdate=:param7,wkattr=:param8,joindate=:param10,household=:param11,notes=:param12');
sql.Add('where psseno=:param13');
if Flatcombobox6.ItemIndex>=0 then parambyname('param1').AsInteger :=Flatcombobox6.ItemIndex else parambyname('param1').Value:=null;
if Dateedit1.Date<>0 then parambyname('param2').AsDate :=dateedit1.Date else parambyname('param2').Value:=null;
if Flatcombobox7.ItemIndex>=0 then
begin
if Flatcombobox7.ItemIndex=7 then parambyname('param3').AsInteger :=9
else parambyname('param3').AsInteger :=Flatcombobox7.ItemIndex ;
end else parambyname('param3').Value :=null;
parambyname('param4').AsString :=Flatedit5.Text ;
parambyname('param5').AsString :=Flatedit6.Text ;
parambyname('param6').AsString :=flatedit7.Text ;
if dateedit2.Date<>0 then parambyname('param7').AsDate:=dateedit2.Date else parambyname('param7').Value :=null;
if Flatcombobox8.ItemIndex>=0 then parambyname('param8').AsInteger :=Flatcombobox8.ItemIndex else parambyname('param8').Value :=null;
//if Flatcombobox10.ItemIndex>=0 then parambyname('param9').AsInteger :=Flatcombobox10.ItemIndex+1 else parambyname('param9').Value :=null;
if dateedit3.Date<>0 then parambyname('param10').AsDate:=dateedit3.Date else parambyname('param10').Value :=null;
if Flatcombobox9.ItemIndex>=0 then parambyname('param11').AsInteger :=Flatcombobox9.ItemIndex else parambyname('param11').Value :=null;
parambyname('param12').AsString :=flatedit9.Text ;
parambyname('param13').AsString :=FlatCombobox2.Items[index];
prepare;
execsql;
end;
with DataShare_frm.Query8 do
begin
close;
sql.Clear ;
sql.Add('insert into SBDZ_PSPAUSE(');
sql.Add('PSSENO,cpseno,PSNAME,ISCODE,SEX,BDATE,WKDATE,JOINDATE,HOUSEHOLD,WKATTR,ADDRESS,TEL,ZIP,OPCODE,OPDATE,PROCFLG)');
sql.Add('select PSSENO,cpseno,PSNAME,ISCODE,SEX,BDATE,WKDATE,JOINDATE,HOUSEHOLD,WKATTR,ADDRESS,TEL,ZIP,'+Quotedstr(main_frm.user.OPNAME)+','+Quotedstr(datetimetostr(now))+',1 from sbdb_psarch');
sql.Add('where psseno=:param');
parambyname('param').AsString :=FlatCombobox2.Items[index];
prepare;
execsql;
end;
Datashare_frm.Dbs.Commit ;
except
Datashare_frm.Dbs.Rollback ;
application.MessageBox('数据更新异常!','恩普软件',mb_iconerror+mb_ok);
end;
end;
procedure TBreakInfo_frm.FlatComboBox3Change(Sender: TObject);
var
b1,b2:boolean;
begin
b1:= whetherchanged;
b2:=whetherchangedv1;
if whetherchanged or whetherchangedv1 then
if (application.MessageBox('数据已改动,是否保存?','恩普软件',mb_iconquestion+mb_okcancel)=id_ok) then
begin
if whetherchanged then
saveV1;
if whetherchangedv1 then
savev2;
end;
init;
index:=-1;
with DataShare_frm.BreakInfo_Query do
begin
close;
sql.Clear ;
sql.Add('select psseno,psname,iscode from sbdb_psarch where cpseno=:param and (status=2 or status=5)');
parambyname('param').AsString :=Flatcombobox5.Items[Flatcombobox3.itemindex];
prepare;
open ;
Flatcombobox1.Text :='' ;
Flatcombobox1.Items.Clear ; //记录职工姓名
Flatcombobox2.Items.Clear ; //记录职工内码
Flatcombobox4.Items.Clear ; //记录职工身份证号
while not eof do
begin
Flatcombobox4.Items.Add(Fieldbyname('iscode').AsString);
FlatCombobox2.Items.Add(Fieldbyname('psseno').AsString);
Flatcombobox1.Items.Add(Fieldbyname('psname').AsString);
next;
end;
close;
end;
ndx:=FlatComboBox3.itemindex;
flatbutton2.Enabled :=false;
flatbutton5.Enabled :=false;
flatbutton6.Enabled :=false;
flatbutton1.Enabled :=false;
flatbutton7.Enabled :=false;
end;
procedure TBreakInfo_frm.FormCreate(Sender: TObject);
var
i:integer;
begin
inherited;
RMD_Record_Count:=0;
Add_Delete:=false;
with DataShare_frm.BreakInfo_Query do
begin
close;
sql.Clear ;
sql.Add('select cpseno,cpname,industry from sbdb_cparch');
prepare;
open;
Flatcombobox3.Items.Clear ; //记录单位名称
FlatCombobox5.Items.Clear ; //记录单位编号
FlatComboBox11.Items.Clear ;//行业代号,用于读取对应的行业利息
while not eof do
begin
Flatcombobox3.Items.Add(Fieldbyname('cpname').AsString);
Flatcombobox5.Items.Add(Fieldbyname('cpseno').AsString);
Flatcombobox11.Items.Add(Fieldbyname('industry').AsString);
next;
end;
close;
end;
DataShare_frm.Query1.Close ;
Scaled:=true;
if screen.Width<>screenwidth then
begin
//height:=longint(height)*longint(screen.height) div screenheight;
//width:=longint(width)*longint(screen.width) div screenwidth;
scaleby(screen.Width,screenwidth);
{for i:=0 to componentcount-1 do
with components[i] do
begin
if GetPropInfo(ClassInfo, 'font') <> nil then
font.size := (screen.Width DIV screenWidth) * font.size;
end; }
for i:=0 to self.ControlCount-1 do
begin
controls[i].Width:=longint(controls[i].Width)*longint(screen.width) div screenwidth;
controls[i].Height:=longint(controls[i].Height)*longint(screen.height) div screenheight;
end;
end;
changed:=false;
RMD_Record_Count:=0;
flatbutton2.Enabled :=false;
flatbutton5.Enabled :=false;
flatbutton6.Enabled :=false;
flatbutton1.Enabled :=false;
flatbutton7.Enabled :=false;
end;
procedure TBreakInfo_frm.ShowData ;
var
interest,lysum,lyints, lycycpints,lycypsints:double;
begin
index:=flatcombobox1.ItemIndex ;
with DataShare_frm.Query1 do
begin
close;
sql.Clear ;
sql.Add('select psseno,psname,sex,bdate,iscode,identity,tel,address,zip,wkdate,wkattr,status,joindate,household,notes from sbdb_psarch where psseno=:param');
parambyname('param').AsString :=flatcombobox2.Items[Flatcombobox1.itemindex];
prepare;
open;
if recordcount>0 then
begin
Flatedit1.Text :=Fields[0].AsString ;
flatedit2.Text :=Fields[1].AsString ;
if not Fields[2].IsNull then
begin
flatcombobox6.ItemIndex :=Fields[2].AsInteger ;
flatedit10.Text :=flatcombobox6.Items[flatcombobox6.ItemIndex];
end;
if not Fields[3].IsNull then dateedit1.Date :=Fields[3].AsDateTime ;
flatedit4.Text :=Fields[4].AsString ;
if not Fields[5].IsNull then
if Fields[5].AsInteger>7 then
begin
Flatcombobox7.ItemIndex :=7;
flatedit11.Text :=Flatcombobox7.Items[Flatcombobox7.itemindex];
end
else
begin
Flatcombobox7.ItemIndex :=Fields[5].AsInteger ;
flatedit11.Text :=Flatcombobox7.Items[Flatcombobox7.itemindex];
end;
flatedit5.Text :=Fields[6].AsString ;
flatedit6.Text :=Fields[7].AsString ;
flatedit7.Text :=Fields[8].AsString ;
if not Fields[9].IsNull then dateedit2.Date :=Fields[9].AsDateTime ;
if not Fields[10].IsNull then
begin
Flatcombobox8.ItemIndex :=Fields[10].AsInteger ;
flatedit12.Text :=Flatcombobox8.Items[flatcombobox8.itemindex];
end;
if Fields[11].AsInteger=2 then flatedit3.Text :='中断' else flatedit3.Text :='异地转出';
//if not Fields[11].IsNull then flatcombobox10.ItemIndex:=Fields[1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -