You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.2 KiB
92 lines
2.2 KiB
unit udelPoli_Faixa;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, umstMaster, Vcl.ComCtrls, Data.DB,
|
|
Vcl.StdCtrls, Vcl.DBCtrls;
|
|
|
|
type
|
|
TdelPoli_faixa = class(TmstMaster)
|
|
lbl_nomepol: TLabel;
|
|
lbl_nomefaixa: TLabel;
|
|
rbtn_politica: TRadioButton;
|
|
rbtn_faixa: TRadioButton;
|
|
btn_ok: TButton;
|
|
btn_cancelar: TButton;
|
|
Label1: TLabel;
|
|
dbl_pol: TDBLookupComboBox;
|
|
dbl_polfaixa: TDBLookupComboBox;
|
|
dbl_faixa: TDBLookupComboBox;
|
|
procedure rbtn_politicaClick(Sender: TObject);
|
|
procedure rbtn_faixaClick(Sender: TObject);
|
|
procedure btn_okClick(Sender: TObject);
|
|
procedure FormCreate(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
delPoli_faixa: TdelPoli_faixa;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses udtmSystem;
|
|
|
|
//funcionalidade parecida com o cadastro de políticas e faixas, mas ao invés de
|
|
//cadastrar você está apagando políticas ou faixas
|
|
|
|
procedure TdelPoli_faixa.btn_okClick(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
if rbtn_politica.Checked then
|
|
begin
|
|
dtmSystem.dtsPoliticas.DataSet.Delete;
|
|
end;
|
|
if rbtn_faixa.Checked then
|
|
begin
|
|
dtmSystem.dtsFaixas.DataSet.Delete;
|
|
end;
|
|
end;
|
|
|
|
procedure TdelPoli_faixa.FormCreate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
dbl_pol.KeyValue := dtmSystem.tblPoliticasID_POLITICA.AsInteger;
|
|
dbl_polfaixa.KeyValue := dtmSystem.tblPoliticasID_POLITICA.AsInteger;
|
|
dbl_faixa.KeyValue := dtmSystem.tblFaixasID_FAIXA.AsInteger;
|
|
dbl_pol.Enabled := false;
|
|
dbl_polfaixa.Enabled := false;
|
|
dbl_polfaixa.Enabled := false;
|
|
end;
|
|
|
|
procedure TdelPoli_faixa.rbtn_faixaClick(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
if rbtn_faixa.Checked then
|
|
begin
|
|
dbl_pol.Enabled := false;
|
|
dbl_polfaixa.Enabled := true;
|
|
dbl_faixa.Enabled := true;
|
|
rbtn_politica.Checked := false;
|
|
end;
|
|
end;
|
|
|
|
procedure TdelPoli_faixa.rbtn_politicaClick(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
if rbtn_politica.Checked then
|
|
begin
|
|
dbl_pol.Enabled := true;
|
|
dbl_polfaixa.Enabled := false;
|
|
dbl_faixa.Enabled := false;
|
|
rbtn_faixa.Checked := false;
|
|
end;
|
|
end;
|
|
|
|
end.
|