This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
qryUsuarios.SQL.Clear; | |
qryUsuarios.SQL.Add('select *'); | |
qryUsuarios.SQL.Add(' from user'); | |
qryUsuarios.SQL.Add(' where login = ' + QuotedStr(edtUsuario.Text)); | |
qryUsuarios.SQL.Add(' and password = ' + edtSenha.Text); | |
qryUsuarios.Open(); | |
if qryUsuarios.IsEmpty then | |
ShowMessage('ERRO!!!') | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE User ( | |
ID INTEGER PRIMARY KEY NOT NULL, | |
NAME VARCHAR (100), | |
LOGIN VARCHAR (20) NOT NULL, | |
PASSWORD INTEGER NOT NULL | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TVenda = record | |
Valor: Currency; | |
QuantidadeItensVendidos: Integer; | |
class operator Equal(AVenda1, AVenda2: TVenda): Boolean; | |
end; | |
var | |
LVenda1, LVenda2: TVenda; | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TVenda = record | |
QuantidadeItensVendidos: Integer; | |
class operator Inc(AVenda: TVenda): TVenda; | |
end; | |
var | |
LVenda: TVenda; | |
begin | |
LVenda.QuantidadeItensVendidos := 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TVenda = record | |
Valor: Currency; | |
class operator Implicit(AValor: string): TVenda; | |
end; | |
var | |
LVenda: TVenda; | |
begin | |
LVenda := '300'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
LVenda: TVenda; | |
begin | |
LVenda.Valor := StrToCurr('300'); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
LVenda1, LVenda2: TVenda; | |
begin | |
LVenda1.Valor := 100; | |
LVenda2.Valor := 50; | |
ShowMessage(CurrToStr(LVenda1.Valor + LVenda2.Valor)); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TVenda = record | |
Valor: Currency; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TVenda = record | |
Valor: Currency; | |
class operator Add(AVenda1, AVenda2: TVenda): Currency; | |
end; | |
var | |
LVenda1, LVenda2: TVenda; | |
begin | |
LVenda1.Valor := 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Solid.DIP.Correcao; | |
interface | |
type | |
IConnection = interface | |
['{9C68D361-8374-443A-AC99-80EEF63F9BE6}'] | |
procedure Connect; | |
end; |