uCAsel формасының прогаммалық коды
unit uCAsel;
…
var
frmCaProp: TfrmCaProp;
implementation
uses uDMCredits;
{$R *.dfm}
procedure TfrmCaProp.btnOKClick(Sender: TObject);
begin
if dmCreditsMain.tblContragents.Modified then
begin
dmCreditsMain.tblContragents.Edit;
dmCreditsMain.tblContragents.Post;
end;
end;
procedure TfrmCaProp.btnAddClick(Sender: TObject);
begin
with dmCreditsMain do
begin
tblContragents.Append;
edtCName.SetFocus;
end;
end;
procedure TfrmCaProp.radioClientTypeChange(Sender: TObject);
begin
if radioClientType.Value='1' then
begin
with dmCreditsMain do
begin
if not tblCa_fizik.Locate('caf_usid', tblContragents.FieldByName('ca_id').AsInteger, [loCaseInsensitive]) then
begin
tblCa_fizik.Append;
tblCa_fizik.FieldByName('caf_usid').AsInteger:=tblContragents.FieldByName('ca_id').AsInteger;
tblCa_fizik.Post;
end;
end;
nbClientData.ActivePage:='Fizik';
end
else if radioClientType.Value='2' then
begin
with dmCreditsMain do
begin
if not tblCa_urik.Locate('cau_us_id', tblContragents.FieldByName('ca_id').AsInteger, [loCaseInsensitive]) then
begin
tblCa_urik.Append;
tblCa_urik.FieldByName('cau_us_id').AsInteger:=tblContragents.FieldByName('ca_id').AsInteger;
tblCa_urik.Post;
end;
end;
nbClientData.ActivePage:='Urik';
end;
end;
procedure TfrmCaProp.edtCNameChange(Sender: TObject);
begin
with dmCreditsMain do
begin
if tblContragents.Modified then
begin
tblContragents.Edit;
tblContragents.Post;
end;
end;
end;
procedure TfrmCaProp.btnDelClick(Sender: TObject);
begin
with dmCreditsMain do
begin
tblContragents.Edit;
tblContragents.Delete;
// tblContragents.Post;
end;
end;
end.
Достарыңызбен бөлісу: |