I'm trying to implement my application, where the empresa
table has gained a new column named status
, which would be populated according to Radio Button
so that when generating linked client reports, the even if it only brings me the clients with Status = Active , I'm a beginner in Delphi, which is why I can not, according to Radio Button
fill this column. I have already been able to add the Radio Buttons
to the form
The part where you save this information in the bank today looks like this:
begin
sdsEmpresaCadastro.Close;
sdsEmpresaCadastro.CommandText := 'select * from Empresa where Nome = '''+cdsEmpresaNOME.AsString + '''';
sdsEmpresaCadastro.Open;
if not sdsEmpresaCadastro.IsEmpty then
raise Exception.Create('Empresa já incluída');
cdsEmpresaCODIGO.AsInteger := dmDatabase.NextID('EMPRESA');
dmDatabase.SQLConnection.Execute('INSERT INTO Empresa (CODIGO, NOME, VALORIMPRESSAO, '+
'VALORDIGITALIZACAO, VALORIMPRESSAOEXCEDENTE, CONTATO, NOMEREDUZIDO, CNPJ, ENDERECO, BAIRRO, CEP, '+
'CIDADE, TEFONE, UF, INSCRICAOESTADUAL, CONTATONF, EMAIL, EMAILNF, OBSERVACAO, '+
'FRANQUIADIGITALIZACAO, VALORDIGITALIZACAOEXCEDENTE, STATUS) VALUES ('+
cdsEmpresaCODIGO.AsString+','''+cdsEmpresaNOME.AsString+''','+
TrocaVirgPPto(cdsEmpresaVALORIMPRESSAO.AsString)+','+
iif(cdsEmpresaVALORDIGITALIZACAO.AsString='','0', TrocaVirgPPto(cdsEmpresaVALORDIGITALIZACAO.AsString))+','+
iif(cdsEmpresaVALORIMPRESSAOEXCEDENTE.AsString='','0', TrocaVirgPPto(cdsEmpresaVALORIMPRESSAOEXCEDENTE.AsString))+
','''+cdsEmpresaCONTATO.AsString+''','''+cdsEmpresaNOMEREDUZIDO.AsString+ ''','''+
cdsEmpresaCNPJ.AsString +''','''+cdsEmpresaENDERECO.AsString+''','''+
cdsEmpresaBAIRRO.AsString +''','''+cdsEmpresaCEP.AsString+ ''','''+
cdsEmpresaCIDADE.AsString+''','''+cdsEmpresaTEFONE.AsString+''','''+
cdsEmpresaUF.AsString+''','''+cdsEmpresaINSCRICAOESTADUAL.AsString+ ''','''+
cdsEmpresaCONTATONF.AsString+ ''','''+ cdsEmpresaEMAIL.AsString + ''','''+
cdsEmpresaOBSERVACAO.AsString + ''','''+ cdsEmpresaEMAILNF.AsString+''','+
iif(cdsEmpresaFRANQUIADIGITALIZACAO.AsString='','0', cdsEmpresaFRANQUIADIGITALIZACAO.AsString)+','+
iif(cdsEmpresaVALORDIGITALIZACAOEXCEDENTE.AsString='','0', TrocaVirgPPto(cdsEmpresaVALORDIGITALIZACAOEXCEDENTE.AsString))+')', nil);
end
My question then is: How to check which of the Radio Buttons
is selected, in order to assign the bank Status = true or false