mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Added a NOTE field in all ActiveRecordDB - the sample has been updated as well
This commit is contained in:
parent
fdcb617801
commit
519d607b90
@ -68,6 +68,9 @@
|
||||
<DCC_CBuilderOutput>All</DCC_CBuilderOutput>
|
||||
<SanitizedProjectName>dmvcframeworkRT</SanitizedProjectName>
|
||||
<RuntimeOnlyPackage>true</RuntimeOnlyPackage>
|
||||
<VerInfo_Locale>1040</VerInfo_Locale>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
<DCC_Description>DMVCFramework - CopyRight (2010-2020) Daniele Teti and the DMVCFramework Team</DCC_Description>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Android)'!=''">
|
||||
<DCC_CBuilderOutput>None</DCC_CBuilderOutput>
|
||||
|
@ -70,6 +70,8 @@ type
|
||||
fCompanyName: string;
|
||||
[MVCTableField('city')]
|
||||
fCity: string;
|
||||
[MVCTableField('note')]
|
||||
fNote: String;
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
@ -77,6 +79,7 @@ type
|
||||
property Code: string read fCode write fCode;
|
||||
property CompanyName: string read fCompanyName write fCompanyName;
|
||||
property City: string read fCity write fCity;
|
||||
property Note: String read fNote write fNote;
|
||||
end;
|
||||
|
||||
[MVCNameCase(ncLowerCase)]
|
||||
|
@ -82,6 +82,7 @@ begin
|
||||
lCustomer.Code := '1234';
|
||||
lCustomer.CompanyName := 'Google Inc.';
|
||||
lCustomer.City := 'Montain View, CA';
|
||||
lCustomer.Note := 'Hello there!';
|
||||
lCustomer.Insert;
|
||||
lID := lCustomer.ID;
|
||||
Log('Just inserted Customer ' + lID.ToString);
|
||||
@ -92,6 +93,7 @@ begin
|
||||
lCustomer := TMVCActiveRecord.GetByPK<TCustomer>(lID);
|
||||
try
|
||||
lCustomer.Code := '5678';
|
||||
lCustomer.Note := lCustomer.Note + sLineBreak + 'Code changed to 5678';
|
||||
lCustomer.Update;
|
||||
Log('Just updated Customer ' + lID.ToString);
|
||||
finally
|
||||
@ -163,6 +165,7 @@ begin
|
||||
lCustomer.City := Cities[Random(high(Cities) + 1)];
|
||||
lCustomer.CompanyName := Format('%s %s %s', [lCustomer.City, Stuff[Random(High(Stuff) + 1)],
|
||||
CompanySuffix[Random(High(CompanySuffix) + 1)]]);
|
||||
lCustomer.Note := lCustomer.CompanyName + ' is from ' + lCustomer.City;
|
||||
lCustomer.Insert;
|
||||
finally
|
||||
lCustomer.Free;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -10,6 +10,7 @@ CREATE TABLE customers (
|
||||
code varchar(20) NOT NULL,
|
||||
description varchar(200),
|
||||
city varchar(200),
|
||||
NOTE BLOB SUB_TYPE 1,
|
||||
CONSTRAINT customers_pk PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
@ -10,6 +10,7 @@ CREATE TABLE customers (
|
||||
code varchar(20) NOT NULL,
|
||||
description varchar(200),
|
||||
city varchar(200),
|
||||
note text DEFAULT NULL,
|
||||
CONSTRAINT customers_pk PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
@ -18,6 +18,7 @@ CREATE TABLE customers (
|
||||
code varchar(20) NULL,
|
||||
description varchar(200) NULL,
|
||||
city varchar(200) NULL,
|
||||
note text NULL,
|
||||
CONSTRAINT customers_pk PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
@ -1447,7 +1447,9 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
raise EMVCJSONRPCException.Create('Response message must have ''result'' or ''error''');
|
||||
raise EMVCJSONRPCException.Create('Response message must have ''result'' or ''error''.' + sLineBreak +
|
||||
'Raw message is: ' + sLineBreak +
|
||||
JSON.ToJSON());
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user