GetProductData fonksiyonunda veritabanından çektiğim verilerin her birini ekranda ayrı kartlar halinde görüntülemek istiyorum. Ancak şu anda sadece en sonuncu veri ekranda kalıyor. Tüm verileri ayrı kartlarda nasıl gösterebilirim?
Kodum: void GetProductData; { selectedUserName = Clomosy.GlobalVariableString;
try Qry = Clomosy.DBSQLiteQueryWith('SELECT * FROM allPaidsTBL WHERE username = ' + QuotedStr(selectedUserName)); Qry.OpenOrExecute; for h = 0 to Qry.RecordCount { dbProductName = Qry.FieldByName('productname').AsString; dbProductCategory = Qry.FieldByName('productcategory').AsString; dbProductPrice = Qry.FieldByName('productprice').AsString; dbCurrencyType = Qry.FieldByName('currency_type').AsString; dbPaidDate = Qry.FieldByName('paid_date').AsString; ListView.clLoadProListViewDataFromDataset( Clomosy.ClDataSetFromJSON('[ { "productName": "Ürün İsmi: ' + dbProductName + '", "productCategory": "Ürün Kategorisi: ' + dbProductCategory + '", "productPrice": "Ürün Fiyatı: ' + dbProductPrice + '", "currencyType": "Para Birimi: ' + dbCurrencyType + '", "boughtDate": "Alım Tarihi: ' + dbPaidDate + '" } ]') ); Qry.Next; } except ShowMessage('Exc class' + LastExceptionClassName + 'Exc' + LastExceptionMessage); }
CreateData fonksiyonum: void CreateData; { productName = uVeriListeleme.AddNewProLabel(DesignerPanel, 'productName', ''); productName.Align = AlVertCenter; productName.Margins.Top = -60; productName.Margins.Right = 10; productName.Margins.Left = 10; productName.clProSettings.FontColor = clAlphaColor.clHexToColor('#000000'); productName.clProSettings.FontSize = 9; productName.clProSettings.AutoSize=True; productName.clProSettings.WordWrap=True; productName.SetclProSettings(productName.clProSettings); DesignerPanel.AddPanelObject(productName, clCaption); productCategory = uVeriListeleme.AddNewProLabel(DesignerPanel, 'productCategory', ''); productCategory.Align = AlVertCenter; productCategory.Margins.Top = -20; productCategory.Margins.Right = 10; productCategory.Margins.Left = 10; productCategory.clProSettings.FontColor = clAlphaColor.clHexToColor('#000000'); productCategory.clProSettings.FontSize = 9; productCategory.clProSettings.AutoSize=True; productCategory.SetclProSettings(productCategory.clProSettings); DesignerPanel.AddPanelObject(productCategory, clText); productPrice = uVeriListeleme.AddNewProLabel(DesignerPanel, 'productPrice', ''); productPrice.Align = AlVertCenter; productPrice.Margins.Top = 5; productPrice.Margins.Right = 10; productPrice.Margins.Left = 10; productPrice.clProSettings.FontColor = clAlphaColor.clHexToColor('#000000'); productPrice.clProSettings.FontSize = 9; productPrice.clProSettings.AutoSize=True; productPrice.SetclProSettings(productPrice.clProSettings); DesignerPanel.AddPanelObject(productPrice, clText1);
currencyType = uVeriListeleme.AddNewProLabel(DesignerPanel, 'currencyType', ''); currencyType.Align = AlVertCenter; currencyType.Margins.Top = 15; currencyType.Margins.Right = 10; currencyType.Margins.Left = 10; currencyType.clProSettings.FontColor = clAlphaColor.clHexToColor('#000000'); currencyType.clProSettings.FontSize = 9; currencyType.clProSettings.AutoSize=True; currencyType.SetclProSettings(currencyType.clProSettings); DesignerPanel.AddPanelObject(currencyType, clText2); boughtDate = uVeriListeleme.AddNewProLabel(DesignerPanel, 'boughtDate', ''); boughtDate.Align = AlVertCenter; boughtDate.Margins.Top = 40; boughtDate.Margins.Right = 10; boughtDate.Margins.Left = 10; boughtDate.clProSettings.FontColor = clAlphaColor.clHexToColor('#000000'); boughtDate.clProSettings.FontSize = 9; boughtDate.clProSettings.AutoSize=True; boughtDate.SetclProSettings(boughtDate.clProSettings); DesignerPanel.AddPanelObject(boughtDate, clText3); }
|