Bu kodlar Kullanıcının yetkisine gore de ayarlanabilir...
const
SOOku = 1;
SOYaz = 2 ;
var
Form1:TForm1;
.....
.....
.....
Function TFStokGir.SaltOkunurMu(Qu:TQuery;Drm:Byte):Boolean ;
var
i:integer;
Bool :Boolean;
begin
Bool := False;
Case Drm of
SOOku :
Begin
for i:=0 to Qu.FieldCount -1 do
begin
Qu.Fields[i].ReadOnly := True;
end;
Result := True;
Bool:= True;
end;
SoYaz :
Begin
for i:=0 to Qu.FieldCount -1 do
begin
Qu.Fields[i].ReadOnly := False;
end;
Result := False;
Bool:= False;;
end;
end;
Result := Bool;
end;
//Kullanımı
procedure TForm1.StokDuzenle();
begin
if not SaltOkunurMu (QStok,2) then
sowmessage('yazma modunda');
end;