Veritabanından tek bir endpoint ile bütün kategorilerin resimlerini ve adlarını göstermek istiyorum.
void FillItemsPnlV(FQry: TCLJSONQuery)
var
I : Integer;
TempCategoryNameLbl: TclProLabel;
TempItemImageBtn : TLCProImage;
TempItemsPnl : TclProPanel;
TempImageBase64 : String;
LMemStream:TCLMemoryStream;
{
I = 0;
Try
with FQry do
{
if (Found)
{
First;
while (not EOF)
{
Try
TempCategoryNameLbl = MainForm.clFindComponent('CategoryNameLbl' + IntToStr(I)) as TclProLabel;
if (TempTableLbl <> nil)
{
TempCategoryNameLbl.Text = FieldByName('category_name').AsString;
}
TempItemsPnl = MainForm.clFindComponent('ItemsPnl' + IntToStr(I)) as TclProPanel;
if (TempOrdersPnl <> nil)
{
ItemsPnl.height = (MainForm.clHeight * 0.2101); // 176.25 / 839 ≈ 0.2101
ItemsPnl.width = (MainForm.clWidth * 0.4200); // 165 / 393 ≈ 0.4200
}
TempItemImageBtn = MainForm.clFindComponent('ItemImageBtn' + IntToStr(I));
if(TempItemImageBtn <> nil)
{
TempImageBase64 = FieldByName('category_image_base64').AsString;
LMemStream = Clomosy.Base64ToStream(TempImageBase64);
TempItemImageBtn.Bitmap.LoadFromStream(LMemStream);
//TempItemImageBtn.clProSettings.PictureSource =
}
Next;
Inc(I);
except
ShowMessage('Index ' + IntToStr(I) + ' için hata: ' + LastExceptionMessage);
Next;
Inc(I);
}
}
LMemStream.Free;
}
}
ShowMessage(' Veriler dolduruldu. Toplam: ' + IntToStr(I) + ' kayıt');
except
ShowMessage('FillOrdersPnlV hatası: ' + LastExceptionMessage);
}
}
https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">