Nuevo método BuscarID
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@271 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
92da1b8c79
commit
be84f539bd
@ -11,6 +11,8 @@ type
|
|||||||
['{94E5F2B6-64C8-4331-B9CB-3ED730478529}']
|
['{94E5F2B6-64C8-4331-B9CB-3ED730478529}']
|
||||||
function BuscarTodos: IBizFormaPago;
|
function BuscarTodos: IBizFormaPago;
|
||||||
function Buscar(ID: Integer): IBizFormaPago;
|
function Buscar(ID: Integer): IBizFormaPago;
|
||||||
|
function BuscarID(ADescripcion: String): Integer;
|
||||||
|
|
||||||
procedure VerTodos(AFormasPago: IBizFormaPago);
|
procedure VerTodos(AFormasPago: IBizFormaPago);
|
||||||
procedure Ver(AFormaPago: IBizFormaPago);
|
procedure Ver(AFormaPago: IBizFormaPago);
|
||||||
procedure Anadir(AFormaPago : IBizFormaPago);
|
procedure Anadir(AFormaPago : IBizFormaPago);
|
||||||
@ -42,6 +44,7 @@ type
|
|||||||
procedure Anadir(AFormaPago : IBizFormaPago);
|
procedure Anadir(AFormaPago : IBizFormaPago);
|
||||||
function BuscarTodos: IBizFormaPago;
|
function BuscarTodos: IBizFormaPago;
|
||||||
function Buscar(ID: Integer): IBizFormaPago;
|
function Buscar(ID: Integer): IBizFormaPago;
|
||||||
|
function BuscarID(ADescripcion: String): Integer;
|
||||||
procedure VerTodos(AFormasPago: IBizFormaPago);
|
procedure VerTodos(AFormasPago: IBizFormaPago);
|
||||||
procedure Ver(AFormaPago: IBizFormaPago);
|
procedure Ver(AFormaPago: IBizFormaPago);
|
||||||
function Localizar(AFormasPago: IBizFormaPago; ADescripcion:String): Boolean;
|
function Localizar(AFormasPago: IBizFormaPago; ADescripcion:String): Boolean;
|
||||||
@ -68,6 +71,23 @@ begin
|
|||||||
FDataModule := TDataModuleFormasPago.Create(Nil);
|
FDataModule := TDataModuleFormasPago.Create(Nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFormasPagoController.BuscarID(ADescripcion: String): Integer;
|
||||||
|
var
|
||||||
|
AFormaPago : IBizFormaPago;
|
||||||
|
begin
|
||||||
|
Result := -1;
|
||||||
|
ShowHourglassCursor;
|
||||||
|
AFormaPago := BuscarTodos;
|
||||||
|
try
|
||||||
|
AFormaPago.Open;
|
||||||
|
if Localizar(AFormaPago, ADescripcion) then
|
||||||
|
Result := AFormaPago.ID;
|
||||||
|
finally
|
||||||
|
AFormaPago := NIL;
|
||||||
|
HideHourglassCursor;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TFormasPagoController.Buscar(ID: Integer): IBizFormaPago;
|
function TFormasPagoController.Buscar(ID: Integer): IBizFormaPago;
|
||||||
var
|
var
|
||||||
Condicion: TDAWhereExpression;
|
Condicion: TDAWhereExpression;
|
||||||
@ -156,8 +176,6 @@ end;
|
|||||||
|
|
||||||
function TFormasPagoController.ValidarFormaPago(AFormaPago: IBizFormaPago): Boolean;
|
function TFormasPagoController.ValidarFormaPago(AFormaPago: IBizFormaPago): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
|
||||||
|
|
||||||
if not Assigned(AFormaPago) then
|
if not Assigned(AFormaPago) then
|
||||||
raise Exception.Create ('Forma de pago no asignada');
|
raise Exception.Create ('Forma de pago no asignada');
|
||||||
|
|
||||||
@ -217,8 +235,6 @@ end;
|
|||||||
|
|
||||||
function TFormasPagoController.Eliminar(AFormaPago: IBizFormaPago): Boolean;
|
function TFormasPagoController.Eliminar(AFormaPago: IBizFormaPago): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
|
||||||
|
|
||||||
if not Assigned(AFormaPago) then
|
if not Assigned(AFormaPago) then
|
||||||
raise Exception.Create ('Forma de pago no asignada');
|
raise Exception.Create ('Forma de pago no asignada');
|
||||||
|
|
||||||
@ -265,11 +281,17 @@ begin
|
|||||||
try
|
try
|
||||||
with AFormasPago.DataTable do
|
with AFormasPago.DataTable do
|
||||||
begin
|
begin
|
||||||
|
if not Active then
|
||||||
|
Open;
|
||||||
|
|
||||||
DisableControls;
|
DisableControls;
|
||||||
First;
|
try
|
||||||
if not Locate(fld_FormasPagoDESCRIPCION, ADescripcion, []) then
|
First;
|
||||||
Result := False;
|
if not Locate(fld_FormasPagoDESCRIPCION, ADescripcion, []) then
|
||||||
EnableControls;
|
Result := False;
|
||||||
|
finally
|
||||||
|
EnableControls;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
HideHourglassCursor;
|
HideHourglassCursor;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user