var loginForm: TclStyleForm; Edit, nameEdit: TclEdit; loginButton: TclButton; userTC, userName: string; AddAppointmentUnit, AnaSayfaUnitUnit : TclUnit;
void CreateDatabase; { Clomosy.DBSQLiteConnect(Clomosy.AppFilesPath + 'UserDatabase.db3', ''); Clomosy.DBSQLiteQuery.SQL.Text = ' CREATE TABLE IF NOT EXISTS Users ( id INTEGER PRIMARY KEY AUTOINCREMENT, tc TEXT, name TEXT ); CREATE TABLE IF NOT EXISTS Appointments ( id INTEGER PRIMARY KEY AUTOINCREMENT, DoctorName TEXT, AppointmentDate TEXT, Notes TEXT, UserID TEXT, UserName TEXT ); '; Clomosy.DBSQLiteQuery.OpenOrExecute(); }
// Kullanıcı bilgilerini veritabanına kaydetme fonksiyonu void SaveUserInfo; { Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO Users (tc, name) VALUES (:tc, :name)'; Clomosy.DBSQLiteQuery.ParamByName('tc').Value = userTC; Clomosy.DBSQLiteQuery.ParamByName('name').Value = userName; Clomosy.DBSQLiteQuery.OpenOrExecute();
ShowMessage('Kullanıcı bilgileri kaydedildi.'); }
void GoToAnaSayfaUnit; {
AnaSayfaUnitUnit = TclUnit.Create; AnaSayfaUnitUnit.UnitName = 'AnaSayfaUnitUnit'; AnaSayfaUnitUnit.CallerForm = loginForm; AnaSayfaUnitUnit.Run; }
// Randevu formuna geçiş void GoToAddAppointmentUnit; { AddAppointmentUnit = TclUnit.Create; AddAppointmentUnit.UnitName = 'AddAppointmentUnit'; AddAppointmentUnit.CallerForm = loginForm; AddAppointmentUnit.Run; }
{ loginForm = TclStyleForm.Create(Self);
// TC edit tcEdit = loginForm.AddNewEdit(loginForm, 'tcEdit', 'TC Kimlik Numarası'); tcEdit.Align = alTop; tcEdit.Height = 40; tcEdit.Margins.Top = 50; tcEdit.Margins.Left = 20; tcEdit.Margins.Right = 20;
nameEdit = loginForm.AddNewEdit(loginForm, 'nameEdit', 'İsim'); nameEdit.Align = alTop; nameEdit.Height = 40; nameEdit.Margins.Top = 10; nameEdit.Margins.Left = 20; nameEdit.Margins.Right = 20;
loginButton = loginForm.AddNewButton(loginForm, 'loginButton', 'Giriş'); loginButton.Align = alTop; loginButton.Height = 40; loginButton.Margins.Top = 20; loginButton.Margins.Left = 20; loginButton.Margins.Right = 20;
loginForm.AddNewEvent(loginButton, tbeOnClick, 'SaveUserInfo');
CreateDatabase(); // Veritabanı oluşturma çağrısı
loginForm.Run; } bu hatayi alıyorum
|