var AddAppointmentForm: TclStyleForm; testListView: TclListView; btnSaveAppointment: TClProButton;
void SaveAppointmentToDatabase; { Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO Appointments (DoctorName, AppointmentDate, Notes) VALUES (' + QuotedStr(testListView.clSelectedItemData('MAIN_TEXT')) + ', ' + QuotedStr(testListView.clSelectedItemData('SUB_TEXT')) + ', ' + QuotedStr(testListView.clSelectedItemData('FOOTER_TEXT')) + ')'; Clomosy.DBSQLiteQuery.OpenOrExecute(); ShowMessage('Randevu kaydedildi'); }
void onItemClicked; { ShowMessage('Seçilen Randevu: ' + testListView.clSelectedItemData('MAIN_TEXT')); }
{ AddAppointmentForm = TclStyleForm.Create(Self); AddAppointmentForm.SetFormColor('#20262f', '#', clGNone);
testListView = AddAppointmentForm.AddNewListView(AddAppointmentForm, 'testListView'); testListView.Align = alClient; AddAppointmentForm.AddNewEvent(testListView, tbeOnItemClick, 'onItemClicked');
// Kullanıcı bilgilerini veritabanından çekelim ve JSON formatına çevirelim Clomosy.DBSQLiteQuery.SQL.Text = 'SELECT TC as MAIN_TEXT, Isim as SUB_TEXT FROM Users'; Clomosy.DBSQLiteQuery.Open; UserJsonData: TClDataSet; UserJsonData = Clomosy.DBSQLiteQuery.DataSet; testListView.clLoadListViewDataFromDataset(UserJsonData);
testListView.Margins.Right = -10; testListView.Margins.Top = -10;
btnSaveAppointment = AddAppointmentForm.AddNewButton(AddAppointmentForm, 'btnSaveAppointment', 'Kaydet'); btnSaveAppointment.Align = alBottom; btnSaveAppointment.Margins.Top = -10; AddAppointmentForm.AddNewEvent(btnSaveAppointment, tbeOnClick, 'SaveAppointmentToDatabase');
AddAppointmentForm.Run; } Syntax hatası alıyorum
|