unit Unit_alx_atores;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids, DBGrids, ComCtrls, jpeg, ExtCtrls, DB,
ADODB, Unit_alx_DataModule;
type
Tfrm_alx_atores = class(TForm)
Panel1: TPanel;
Image1: TImage;
Panel2: TPanel;
StatusBar1: TStatusBar;
DBGrid1: TDBGrid;
Edit1: TEdit;
Edit2: TEdit;
Panel3: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
ID: TLabel;
Nome: TLabel;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
BitBtn6: TBitBtn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure DBGrid1CellClick(Column: TColumn);
procedure DBGrid1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure BitBtn6Click(Sender: TObject);
private
{ Private declarations }
procedure alx_voi_Popular_Grid_Atores();
procedure alx_voi_Atualizar_Cartao_Atores();
public
{ Public declarations }
constructor alx_voi_Create(alx_obj_owner: TComponent);
end;
implementation
{$R *.dfm}
//==============================================================================
constructor Tfrm_alx_atores.alx_voi_Create(alx_obj_owner: TComponent);
begin
inherited Create(alx_obj_owner);
self.alx_voi_Popular_Grid_Atores(); //... POPULAR O GRID DE ATORES ...
self.alx_voi_Atualizar_Cartao_Atores(); //... atualizar o cartão de atores...
self.Show();
end;
//==============================================================================
procedure Tfrm_alx_atores.alx_voi_Popular_Grid_Atores();
var
alx_str_sql_texto: TStrings;
begin
try
alx_str_sql_texto:= TStringList.Create();
alx_str_sql_texto.Add('SELECT * FROM ATORES ORDER BY ATOR_NOME ;');
self.ADOQuery1.Active:= False;
self.ADOQuery1.SQL.Clear();
self.ADOQuery1.SQL:= alx_str_sql_texto;
self.ADOQuery1.Active:= True;
except
on E: Exception do begin
showmessage('Ôpa, ocorreu um erro ao popular o grid de atores! VEja: ' + E.Message );
end;
end;
end;
//==============================================================================
procedure Tfrm_alx_atores.alx_voi_Atualizar_Cartao_Atores();
begin
try
self.Edit1.Text:= self.ADOQuery1.Fields[0].AsString;
self.Edit2.Text:= self.ADOQuery1.Fields[1].AsString;
except
on E: Exception do begin
showmessage('Ôpa, ocorreu um erro ao atualizar o cartão de atores! VEja: ' + E.Message );
end;
end;
end;
//==============================================================================
procedure Tfrm_alx_atores.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
SELF:= NIL;
end;
procedure Tfrm_alx_atores.DBGrid1CellClick(Column: TColumn);
begin
self.alx_voi_Atualizar_Cartao_Atores();
end;
procedure Tfrm_alx_atores.DBGrid1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
self.alx_voi_Atualizar_Cartao_Atores();
end;
procedure Tfrm_alx_atores.BitBtn6Click(Sender: TObject);
begin
self.ADOQuery1.Next();
self.alx_voi_Atualizar_Cartao_Atores();
end;
end.
Assinar:
Postar comentários (Atom)
Nenhum comentário:
Postar um comentário