var
mainform: TCLForm;
AtistirmaliklarPage: TclProPanel;
Button: TClProButton;
ProductID: Integer;
ProductName: string;
ProductPrice: Double;
ProductImageURL: string;
ProductQuery: TclSqlQuery;
PriceLabel,NameLabel:TClProLabel;
i:integer;
procedure SetupDatabaseConnection;
begin
try
Clomosy.DBSQLServerConnect('SQL Server', 'clomosybakkal.database.windows.net', 'nrs', 'n.12345678', 'Bakkal', 1433);
ShowMessage('Veritabanı bağlantısı başarıyla kuruldu!');
except
ShowMessage('Veritabanı bağlantısı kurulamadı: ' );
end;
end;
procedure LoadProductsToPage;
var
PriceLabel, NameLabel: TClLabel; // Fiyat ve ürün adını göstermek için label eklendi
begin
ProductQuery := TclSqlQuery.Create(nil);
try
ProductQuery.Connection := Clomosy.DBSQLServerConnection;
ProductQuery.SQL.Text := 'SELECT ProductID, ProductName, ProductPrice, ProductImageURL FROM Products';
try
ProductQuery.Open;
except
ShowMessage('Ürün sorgusu açılamadı: ' );
end;
while not ProductQuery.Eof do
begin
try
ProductID := ProductQuery.FieldByName('ProductID').AsInteger;
ProductName := ProductQuery.FieldByName('ProductName').AsString;
ProductPrice := ProductQuery.FieldByName('ProductPrice').AsFloat;
ProductImageURL := ProductQuery.FieldByName('ProductImageURL').AsString;
// Buton oluştur ve yapılandır
Button := mainform.AddNewProButton(AtistirmaliklarPage, 'Button'+IntToStr(i), '');
try
i := i + 1;
Button.Width := 120;
Button.Height := 120;
if Assigned(mainform) then
mainform.SetImage(Button, ProductImageURL);
// Diğer buton özelliklerini ayarla
Button.Margins.Bottom := 400 - i * 300;
Button.Margins.Right := 100;
Button.clProSettings.RoundHeight := 10;
Button.clProSettings.RoundWidth := 10;
Button.clProSettings.FontVertAlign := palCenter;
Button.clProSettings.FontHorzAlign := palCenter;
Button.clProSettings.TextSettings.Font.Style := [fsBold];
Button.clProSettings.BorderColor := clAlphaColor.clHexToColor('#d1d1d1');
Button.clProSettings.BorderWidth := 1;
Button.SetclProSettings(Button.clProSettings);
// Create and configure the price label
// PriceLabel := TClProLabel.Create(AtistirmaliklarPage);
PriceLabel := AtistirmaliklarPage.AddNewProLabel(AtistirmaliklarPage,'PriceLabel'+IntToStr(i),'');
PriceLabel.Margins.Bottom := Button.Margins.Bottom + Button.Height + 10;
PriceLabel.Margins.Right := Button.Margins.Right;
PriceLabel.Width := Button.Width;
PriceLabel.Text := 'Fiyat: ' + FloatToStr(ProductPrice) + ' TL';
PriceLabel.clProSettings.TextSettings.Font.Style := [fsBold];
PriceLabel.clProSettings.FontColor := clAlphaColor.clHexToColor('#000000');
PriceLabel.FontVertAlign := palCenter;
PriceLabel.FontHorzAlign := palCenter;
PriceLabel.SetclProSettings(PriceLabel.clProSettings);
// Create and configure the name label
//NameLabel := TClProLabel.Create(AtistirmaliklarPage);
// NameLabel.Parent := AtistirmaliklarPage;
NameLabel := MyForm.AddNewProLabel(AtistirmaliklarPage,'NameLabel'+IntToStr(i),'');
NameLabel.Top := PriceLabel.Top + PriceLabel.Height + 5;
NameLabel.Margins.Right := Button.Margins.Right;
NameLabel.Width := Button.Width;
NameLabel.Text := ProductName;
NameLabel.clProSettings.TextSettings.Font.Style := [fsBold];
NameLabel.clProSettings.FontColor := clAlphaColor.clHexToColor('#000000');
NameLabel.FontVertAlign := palCenter;
NameLabel.FontHorzAlign := palCenter;
NameLabel.SetclProSettings(NameLabel.clProSettings);
except
ShowMessage('Buton oluşturulurken hata: ' );
end;
ProductQuery.Next;
except
ShowMessage('Ürün bilgileri işlenirken hata: ' );
end;
end;
finally
ProductQuery.Close;
ProductQuery.Free;
end;
end;
begin
mainform := TCLForm.Create(self);
mainform.Run;
end;
--------------------------------------------------------------------
Unknown member method: 'AddNewProLabel'.
Source position: 67,106
Clomosy Build : 20240709.111531
--------------------------------------------------------------------
LastUnitName:AtistirmaliklarPage
var
mainform: TCLForm;
AtistirmaliklarPage: TclProPanel;
Button: TClProButton;
ProductID: Integer;
ProductName: string;
ProductPrice: Double;
ProductImageURL: string;
ProductQuery: TclSqlQuery;
PriceLabel,NameLabel:TClProLabel;
i:integer;
procedure SetupDatabaseConnection;
begin
try
Clomosy.DBSQLServerConnect('SQL Server', 'clomosybakkal.database.windows.net', 'nrs', 'n.12345678', 'Bakkal', 1433);
ShowMessage('Veritabanı bağlantısı başarıyla kuruldu!');
except
ShowMessage('Veritabanı bağlantısı kurulamadı: ' );
end;
end;
procedure LoadProductsToPage;
var
PriceLabel, NameLabel: TClLabel; // Fiyat ve ürün adını göstermek için label eklendi
begin
ProductQuery := TclSqlQuery.Create(nil);
try
ProductQuery.Connection := Clomosy.DBSQLServerConnection;
ProductQuery.SQL.Text := 'SELECT ProductID, ProductName, ProductPrice, ProductImageURL FROM Products';
try
ProductQuery.Open;
except
ShowMessage('Ürün sorgusu açılamadı: ' );
end;
while not ProductQuery.Eof do
begin
try
ProductID := ProductQuery.FieldByName('ProductID').AsInteger;
ProductName := ProductQuery.FieldByName('ProductName').AsString;
ProductPrice := ProductQuery.FieldByName('ProductPrice').AsFloat;
ProductImageURL := ProductQuery.FieldByName('ProductImageURL').AsString;
// Buton oluştur ve yapılandır
Button := mainform.AddNewProButton(AtistirmaliklarPage, 'Button'+IntToStr(i), '');
try
i := i + 1;
Button.Width := 120;
Button.Height := 120;
if Assigned(mainform) then
mainform.SetImage(Button, ProductImageURL);
// Diğer buton özelliklerini ayarla
Button.Margins.Bottom := 400 - i * 300;
Button.Margins.Right := 100;
Button.clProSettings.RoundHeight := 10;
Button.clProSettings.RoundWidth := 10;
Button.clProSettings.FontVertAlign := palCenter;
Button.clProSettings.FontHorzAlign := palCenter;
Button.clProSettings.TextSettings.Font.Style := [fsBold];
Button.clProSettings.BorderColor := clAlphaColor.clHexToColor('#d1d1d1');
Button.clProSettings.BorderWidth := 1;
Button.SetclProSettings(Button.clProSettings);
// Create and configure the price label
// PriceLabel := TClProLabel.Create(AtistirmaliklarPage);
PriceLabel := AtistirmaliklarPage.AddNewProLabel(AtistirmaliklarPage,'PriceLabel'+IntToStr(i),'');
PriceLabel.Margins.Bottom := Button.Margins.Bottom + Button.Height + 10;
PriceLabel.Margins.Right := Button.Margins.Right;
PriceLabel.Width := Button.Width;
PriceLabel.Text := 'Fiyat: ' + FloatToStr(ProductPrice) + ' TL';
PriceLabel.clProSettings.TextSettings.Font.Style := [fsBold];
PriceLabel.clProSettings.FontColor := clAlphaColor.clHexToColor('#000000');
PriceLabel.FontVertAlign := palCenter;
PriceLabel.FontHorzAlign := palCenter;
PriceLabel.SetclProSettings(PriceLabel.clProSettings);
// Create and configure the name label
//NameLabel := TClProLabel.Create(AtistirmaliklarPage);
// NameLabel.Parent := AtistirmaliklarPage;
NameLabel := MyForm.AddNewProLabel(AtistirmaliklarPage,'NameLabel'+IntToStr(i),'');
NameLabel.Top := PriceLabel.Top + PriceLabel.Height + 5;
NameLabel.Margins.Right := Button.Margins.Right;
NameLabel.Width := Button.Width;
NameLabel.Text := ProductName;
NameLabel.clProSettings.TextSettings.Font.Style := [fsBold];
NameLabel.clProSettings.FontColor := clAlphaColor.clHexToColor('#000000');
NameLabel.FontVertAlign := palCenter;
NameLabel.FontHorzAlign := palCenter;
NameLabel.SetclProSettings(NameLabel.clProSettings);
except
ShowMessage('Buton oluşturulurken hata: ' );
end;
ProductQuery.Next;
except
ShowMessage('Ürün bilgileri işlenirken hata: ' );
end;
end;
finally
ProductQuery.Close;
ProductQuery.Free;
end;
end;
begin
mainform := TCLForm.Create(self);
mainform.Run;
end;
var
mainform: TCLForm;
AtistirmaliklarPage: TclProPanel;
Button: TClProButton;
ProductID: Integer;
ProductName: string;
ProductPrice: Double;
ProductImageURL: string;
ProductQuery: TclSqlQuery;
PriceLabel,NameLabel:TClProLabel;
i:integer;
procedure SetupDatabaseConnection;
begin
try
Clomosy.DBSQLServerConnect('SQL Server', 'clomosybakkal.database.windows.net', 'nrs', 'n.12345678', 'Bakkal', 1433);
ShowMessage('Veritabanı bağlantısı başarıyla kuruldu!');
except
ShowMessage('Veritabanı bağlantısı kurulamadı: ' );
end;
end;
procedure LoadProductsToPage;
var
PriceLabel, NameLabel: TClLabel; // Fiyat ve ürün adını göstermek için label eklendi
begin
ProductQuery := TclSqlQuery.Create(nil);
try
ProductQuery.Connection := Clomosy.DBSQLServerConnection;
ProductQuery.SQL.Text := 'SELECT ProductID, ProductName, ProductPrice, ProductImageURL FROM Products';
try
ProductQuery.Open;
except
ShowMessage('Ürün sorgusu açılamadı: ' );
end;
while not ProductQuery.Eof do
begin
try
ProductID := ProductQuery.FieldByName('ProductID').AsInteger;
ProductName := ProductQuery.FieldByName('ProductName').AsString;
ProductPrice := ProductQuery.FieldByName('ProductPrice').AsFloat;
ProductImageURL := ProductQuery.FieldByName('ProductImageURL').AsString;
// Buton oluştur ve yapılandır
Button := mainform.AddNewProButton(AtistirmaliklarPage, 'Button'+IntToStr(i), '');
try
i := i + 1;
Button.Width := 120;
Button.Height := 120;
if Assigned(mainform) then
mainform.SetImage(Button, ProductImageURL);
// Diğer buton özelliklerini ayarla
Button.Margins.Bottom := 400 - i * 300;
Button.Margins.Right := 100;
Button.clProSettings.RoundHeight := 10;
Button.clProSettings.RoundWidth := 10;
Button.clProSettings.FontVertAlign := palCenter;
Button.clProSettings.FontHorzAlign := palCenter;
Button.clProSettings.TextSettings.Font.Style := [fsBold];
Button.clProSettings.BorderColor := clAlphaColor.clHexToColor('#d1d1d1');
Button.clProSettings.BorderWidth := 1;
Button.SetclProSettings(Button.clProSettings);
// Create and configure the price label
// PriceLabel := TClProLabel.Create(AtistirmaliklarPage);
PriceLabel := AtistirmaliklarPage.AddNewProLabel(AtistirmaliklarPage,'PriceLabel'+IntToStr(i),'');
PriceLabel.Margins.Bottom := Button.Margins.Bottom + Button.Height + 10;
PriceLabel.Margins.Right := Button.Margins.Right;
PriceLabel.Width := Button.Width;
PriceLabel.Text := 'Fiyat: ' + FloatToStr(ProductPrice) + ' TL';
PriceLabel.clProSettings.TextSettings.Font.Style := [fsBold];
PriceLabel.clProSettings.FontColor := clAlphaColor.clHexToColor('#000000');
PriceLabel.FontVertAlign := palCenter;
PriceLabel.FontHorzAlign := palCenter;
PriceLabel.SetclProSettings(PriceLabel.clProSettings);
// Create and configure the name label
//NameLabel := TClProLabel.Create(AtistirmaliklarPage);
// NameLabel.Parent := AtistirmaliklarPage;
NameLabel := MyForm.AddNewProLabel(AtistirmaliklarPage,'NameLabel'+IntToStr(i),'');
NameLabel.Top := PriceLabel.Top + PriceLabel.Height + 5;
NameLabel.Margins.Right := Button.Margins.Right;
NameLabel.Width := Button.Width;
NameLabel.Text := ProductName;
NameLabel.clProSettings.TextSettings.Font.Style := [fsBold];
NameLabel.clProSettings.FontColor := clAlphaColor.clHexToColor('#000000');
NameLabel.FontVertAlign := palCenter;
NameLabel.FontHorzAlign := palCenter;
NameLabel.SetclProSettings(NameLabel.clProSettings);
except
ShowMessage('Buton oluşturulurken hata: ' );
end;
ProductQuery.Next;
except
ShowMessage('Ürün bilgileri işlenirken hata: ' );
end;
end;
finally
ProductQuery.Close;
ProductQuery.Free;
end;
end;
begin
mainform := TCLForm.Create(self);
mainform.Run;
end;
--------------------------------------------------------------------
Unknown member method: 'AddNewProLabel'.
Source position: 67,106
Clomosy Build : 20240709.111531
--------------------------------------------------------------------
LastUnitName:AtistirmaliklarPage
--------------------------------------------------------------------
Unknown member method: 'AddNewProLabel'.
Source position: 67,106
Clomosy Build : 20240709.111531
--------------------------------------------------------------------
LastUnitName:AtistirmaliklarPage