BD6_Rabota_s_polyami
.pdf11
Внесение изменений в НД
СanModify:Boolean
1.Изменение текущей записи
Edit
Table1.Edit;
Table1.FieldByName(‘Oklad’):=inttostr(Edit1.text);
Table1.Post;
SetFields(const Values:array of const) Table1.SetFields([‘Вася’,'Бухгалтер'])
2.Добавление новой записи
Insert Table1.Insert; Table1.Post;
Append;
Table1.Append;
Table1.Post;
InsertRecord(const Values:array of const); AppendRecord(const Values:array of const);
3.Запоминание изменений – Post
4.Отмена сделанных изменений – Cancel
5.Удаление записи – Delete;
procedure TForm_Calc.Button2Click(Sender: TObject); begin
case radiogroup1.ItemIndex of
0:begin datasource1.dataset:=table1;
if table1.Filtered=true then table1.Filtered:=false;
Table1.IndexFieldNames:='FIO';
end;
1:begin datasource1.dataset:=table1;
if table1.Filtered=true then table1.Filtered:=false; Table1.IndexFieldNames:='B1’;
end end; end;
Суммирование
Table1.first;
S:=0;
While not(Table1.EOF) do Begin
S:=s+table1.fieldByname[‘b1’].asinteger;
Table1.Next;
End;
12