var
HastaForm : TclStyleForm;
HastaAdSoyadLbL,HastaTCLbl,HastaSifreLbl,PanelAdLbl,KayitLbl: TClProLabel;
HastaAdSoyadEdt,HastaTCEdt,HastaSifreEdt:TclProEdit;
GirisBtn,KayitBtn:TClProButton;
HastaGiris : TclUnit;
selectQuery:TClSQLiteQuery;
database, password : String;
void GoToHastaGiris;
{
HastaForm.clShow;
HastaGiris.UnitName = 'HastaGiris';
HastaGiris.CallerForm = HastaForm;
HastaGiris.Run;
}
void InsertToDatabase;
{
try
Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO HastaKayit (HastaAdSoyad,HastaTC,HastaSifre) VALUES (
'+QuotedStr(HastaAdsoyadEdt.Text)+','+HastaTCEdt.Text+','+HastaSifreEdt.Text+')';
Clomosy.DBSQLiteQuery.OpenOrExecute;
ShowMessage('Veri Ekleme Başarılı.');
except
ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage);
}
}
{
HastaForm = TclStyleForm.Create(Self);
HastaForm.SetFormBGImage(' https://img.freepik.com/free-vector/abstract-medical-wallpaper-template-design_53876-61805.jpg" rel="nofollow - https://img.freepik.com/free-vector/abstract-medical-wallpaper-template-design_53876-61805.jpg ');
HastaGiris = TclUnit.Create;
Clomosy.DBSQLiteConnect(Clomosy.AppFilesPath + 'HastaneSistemi.db3', '');
database = Clomosy.AppFilesPath + 'HastaneSistemi.db3';
password = '';
PanelAdLbl=HastaForm.AddNewProLabel(HastaForm, 'PanelAdLbl', 'HASTA KAYIT İŞLEMİ');
clComponent.SetupComponent(PanelAdLbl,
'{"Align" : "Center",
"MarginBottom":535,
"MarginLeft":210,
"Width" :400,
"Height":30,
"TextColor":"#928d9a",
"TextSize":20,
"TextBold":"yes"}');
HastaAdsoyadLbL=HastaForm.AddNewProLabel(HastaForm, 'HastaAdsoyadLbL', 'Adınız:');
clComponent.SetupComponent(HastaAdsoyadLbL,
'{"Align" : "Center",
"MarginBottom":420,
"MarginLeft":90,
"Width" :400,
"Height":30,
"TextColor":"#928d9a",
"TextSize":17,
"TextBold":"yes"}');
HastaTCLbl=HastaForm.AddNewProLabel(HastaForm, 'HastaTCLbl', 'Kimlik No:');
clComponent.SetupComponent(HastaTCLbl,
'{"Align" : "Center",
"MarginBottom":320,
"MarginLeft":90,
"Width" :400,
"Height":30,
"TextColor":"#928d9a",
"TextSize":17,
"TextBold":"yes"}');
HastaSifreLbl=HastaForm.AddNewProLabel(HastaForm, 'HastaSifreLbl', 'Şifre:');
clComponent.SetupComponent(HastaSifreLbl,
'{"Align" : "Center",
"MarginBottom":220,
"MarginLeft":90,
"Width" :400,
"Height":30,
"TextColor":"#928d9a",
"TextSize":17,
"TextBold":"yes"}');
KayitLbl=HastaForm.AddNewProLabel(HastaForm, 'KayitLbl', 'Hesabınız Var İse Giriş Yapın.');
clComponent.SetupComponent(KayitLbl,
'{"Align" : "Center",
"MarginTop":180,
"MarginLeft":160,
"Width" :400,
"Height":30,
"TextColor":"#928d9a",
"TextSize":17,
"TextBold":"yes"}');
GirisBtn = HastaForm.AddNewProButton(HastaForm,'GirisBtn','');
clComponent.SetupComponent(GirisBtn,
'{"caption":"Giriş Yap",
"Align" : "Center",
"MarginTop":260,
"Width" :80,
"Height":40,
"RoundHeight":2,
"RoundWidth":2,
"BorderColor":"#928d9a",
"BorderWidth":3}');
KayitBtn = HastaForm.AddNewProButton(HastaForm,'KayitBtn','');
clComponent.SetupComponent(KayitBtn,
'{"caption":"Kaydol",
"Align" : "Center",
"MarginTop":10,
"Width" :80,
"Height":40,
"RoundHeight":2,
"RoundWidth":2,
"BorderColor":"#928d9a",
"BorderWidth":3}');
HastaAdSoyadEdt=HastaForm.AddNewProEdit(HastaForm, 'HastaAdSoyadEdt', '');
clComponent.SetupComponent(HastaAdSoyadEdt,
'{"Align" : "Center",
"MarginBottom":420,
"MarginLeft":30,
"Width" :160,
"Height":30,
"RoundHeight":5,
"RoundWidth":5,
"BorderWidth":2,
"BorderColor":"#928d9a"
}');
HastaTCEdt=HastaForm.AddNewProEdit(HastaForm, 'HastaTCEdt', '');
clComponent.SetupComponent(HastaTCEdt,
'{"Align" : "Center",
"MarginBottom":320,
"MarginLeft":30,
"Width" :160,
"Height":30,
"RoundHeight":5,
"RoundWidth":5,
"BorderWidth":2,
"BorderColor":"#928d9a"
}');
HastaSifreEdt=HastaForm.AddNewProEdit(HastaForm, 'HastaSifreEdt', '');
clComponent.SetupComponent(HastaSifreEdt,
'{"Align" : "Center",
"MarginBottom":220,
"MarginLeft":30,
"Width" :160,
"Height":30,
"RoundHeight":5,
"RoundWidth":5,
"BorderWidth":2,
"BorderColor":"#928d9a"
}');
try
Clomosy.DBSQLiteConnect(database , password);
Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE HastaKayit(HastaAdSoyad Text, HastaTC INTEGER, HastaSifre INTEGER)';
Clomosy.DBSQLiteQuery.OpenOrExecute;
ShowMessage('Veri tabanına tablo ekleme işlemi başarılı!');
except
ShowMessage('Exception Class: '+LastExceptionClassName+' Exception Message: '+LastExceptionMessage);
}
HastaForm.AddNewEvent(KayitBtn,tbeOnClick,'InsertToDatabase');
HastaForm.AddNewEvent(GirisBtn,tbeOnClick,'GoToHastaGiris');
HastaForm.Run;
}