X
xiehua822
Unregistered / Unconfirmed
GUEST, unregistred user!
var
i:integer;
list:Tlistitem;
begin
if listview1.Items.Count=0 then exit;
with DataModule1.tempgrp do
begin
if not active then active:=true;
edit;
end;
for i:=0 to listview1.Items.Count-1 do
begin
list:=ListView1.Items.Item;
datamodule1.tempgrp.insert;
DataModule1.tempgrp.fieldbyname('MBRID').asinteger:=strtoint(listview1.Items.Item.Caption);
DataModule1.tempgrp.fieldbyname('MBRNAME').asstring:=list.SubItems.Strings[0];
DataModule1.tempgrp.fieldbyname('PARTID').asinteger:=strtoint(list.SubItems.Strings[1]);
DataModule1.tempgrp.fieldbyname('PARTNAME').asstring:=list.SubItems.Strings[2];
DataModule1.tempgrp.fieldbyname('PHONE').asstring:=list.SubItems.Strings[3];
DataModule1.tempgrp.fieldbyname('MEETROOMID').asstring:=combobox1.text;
DataModule1.tempgrp.fieldbyname('CTROLTIME').asinteger:=secondsbetween(strtodatetime('1970-01-01 08:00:00'),strtodatetime(datetostr(date.date)+' '+timetostr(time.time)));
DataModule1.tempgrp.fieldbyname('TMPGID').asinteger:=c;
DataModule1.tempgrp.fieldbyname('STATUS').asinteger:=1;
end;
try
DataModule1.tempgrp.post;
application.messagebox('保存成功','信息',mb_ok+mb_iconinformation);
close;
except
showmessage('更新失败');
end;
i:integer;
list:Tlistitem;
begin
if listview1.Items.Count=0 then exit;
with DataModule1.tempgrp do
begin
if not active then active:=true;
edit;
end;
for i:=0 to listview1.Items.Count-1 do
begin
list:=ListView1.Items.Item;
datamodule1.tempgrp.insert;
DataModule1.tempgrp.fieldbyname('MBRID').asinteger:=strtoint(listview1.Items.Item.Caption);
DataModule1.tempgrp.fieldbyname('MBRNAME').asstring:=list.SubItems.Strings[0];
DataModule1.tempgrp.fieldbyname('PARTID').asinteger:=strtoint(list.SubItems.Strings[1]);
DataModule1.tempgrp.fieldbyname('PARTNAME').asstring:=list.SubItems.Strings[2];
DataModule1.tempgrp.fieldbyname('PHONE').asstring:=list.SubItems.Strings[3];
DataModule1.tempgrp.fieldbyname('MEETROOMID').asstring:=combobox1.text;
DataModule1.tempgrp.fieldbyname('CTROLTIME').asinteger:=secondsbetween(strtodatetime('1970-01-01 08:00:00'),strtodatetime(datetostr(date.date)+' '+timetostr(time.time)));
DataModule1.tempgrp.fieldbyname('TMPGID').asinteger:=c;
DataModule1.tempgrp.fieldbyname('STATUS').asinteger:=1;
end;
try
DataModule1.tempgrp.post;
application.messagebox('保存成功','信息',mb_ok+mb_iconinformation);
close;
except
showmessage('更新失败');
end;