//ANA KOD var uForm : TclStyleForm; btnUnit :TclButton; edtUnit :TclEdit; edtUrunAdi, edtUrunAciklamasi,edtUrunStok,edtBarkodBilgi : TclEdit; btnInsert : TclButton; testListview : TClListView; Qry : TClSQLiteQuery; database, password : String; okutBtn: TclButton;
void BarkodOkut; { uForm.CallBarcodeReader(edtBarkodBilgi); }
void SendToMyForm; { CallerForm.clShow; } void GetData; { try Qry = Clomosy.DBSQLiteQueryWith('SELECT UrunAdi as MAIN_TEXT, UrunStok as SIDE_TEXT_TOP, BarkodOkut as FOOTER_TEXT, Aciklamasi as SUB_TEXT FROM Categories'); Qry.OpenOrExecute; testListview.clLoadListViewDataFromDataset(Qry); except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } }
void InsertToDatabase; { try Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO Categories (UrunAdi, Aciklamasi, UrunStok, BarkodOkut) VALUES ('+QuotedStr(edtUrunAdi.Text)+','+QuotedStr(edtUrunAciklamasi.Text)+','+edtUrunStok.Text+','+QuotedStr(edtBarkodBilgi.Text)+')'; Clomosy.DBSQLiteQuery.OpenOrExecute; GetData; ShowMessage('Veri ekleme başarılı'); except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } }
{ uForm = TclStyleForm.Create(Self); edtUrunAdi = uForm.AddNewEdit(uForm, 'edtUrunAdi', 'UrunAdi'); edtUrunAdi.Align = alTop; edtUrunAciklamasi = uForm.AddNewEdit(uForm, 'edtUrunAciklamasi', 'Aciklamasi'); edtUrunAciklamasi.Align = alTop; edtUrunStok=uForm.AddNewEdit(uForm,'edtUrunStok','UrunStok') edtUrunStok.Align = alTop; testListview = uForm.AddNewListView(uForm,'testListview'); testListview.Align = alClient; okutBtn=uForm.AddNewButton(uForm,'okutBtn','Barkodu okutunuz'); okutBtn.TextSettings.Font.Size=40; okutBtn.Align = alTop; edtBarkodBilgi=uForm.AddNewEdit(uForm,'edtBarkodBilgi','Barkod No:'); edtBarkodBilgi.Align = AlTop; uForm.AddNewEvent(okutBtn,tbeOnClick,'BarkodOkut'); btnInsert = uForm.AddNewButton(uForm,'btnInsert', 'Insert'); btnInsert.Align = alBottom; uForm.AddNewEvent(btnInsert, tbeOnClick, 'InsertToDatabase');
database = Clomosy.AppFilesPath + 'ClomosyDatabase.db3' password = ''; try Clomosy.DBSQLiteConnect(database , password); Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE Categories(UrunAdi Text, Aciklamasi Text,UrunStok Text,BarkodOkut Text)'; Clomosy.DBSQLiteQuery.OpenOrExecute; ShowMessage('Veri tabanına tablo ekleme işlemi başarılı!'); except ShowMessage('Exception Class: '+LastExceptionClassName+' Exception Message: '+LastExceptionMessage); } GetData; uForm.Run; } //UNİT1 HATANIN OLDUĞU YER
var uForm : TclStyleForm; btnUnit :TclButton; edtUnit :TclEdit; edtUrunAdi, edtUrunAciklamasi,edtUrunStok,edtBarkodBilgi : TclEdit; btnInsert : TclButton; testListview : TClListView; Qry : TClSQLiteQuery; database, password : String; okutBtn: TclButton;
void BarkodOkut; { uForm.CallBarcodeReader(edtBarkodBilgi); }
void SendToMyForm; { CallerForm.clShow; } void GetData; { try Qry = Clomosy.DBSQLiteQueryWith('SELECT UrunAdi as MAIN_TEXT, UrunStok as SIDE_TEXT_TOP, BarkodOkut as FOOTER_TEXT, Aciklamasi as SUB_TEXT FROM Categories'); Qry.OpenOrExecute; testListview.clLoadListViewDataFromDataset(Qry); except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } }
void InsertToDatabase; { try Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO Categories (UrunAdi, Aciklamasi, UrunStok, BarkodOkut) VALUES ('+QuotedStr(edtUrunAdi.Text)+','+QuotedStr(edtUrunAciklamasi.Text)+','+edtUrunStok.Text+','+QuotedStr(edtBarkodBilgi.Text)+')'; Clomosy.DBSQLiteQuery.OpenOrExecute; GetData; ShowMessage('Veri ekleme başarılı'); except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } }
{ uForm = TclStyleForm.Create(Self); edtUrunAdi = uForm.AddNewEdit(uForm, 'edtUrunAdi', 'UrunAdi'); edtUrunAdi.Align = alTop; edtUrunAciklamasi = uForm.AddNewEdit(uForm, 'edtUrunAciklamasi', 'Aciklamasi'); edtUrunAciklamasi.Align = alTop; edtUrunStok=uForm.AddNewEdit(uForm,'edtUrunStok','UrunStok') edtUrunStok.Align = alTop; testListview = uForm.AddNewListView(uForm,'testListview'); testListview.Align = alClient; okutBtn=uForm.AddNewButton(uForm,'okutBtn','Barkodu okutunuz'); okutBtn.TextSettings.Font.Size=40; okutBtn.Align = alTop; edtBarkodBilgi=uForm.AddNewEdit(uForm,'edtBarkodBilgi','Barkod No:'); edtBarkodBilgi.Align = AlTop; uForm.AddNewEvent(okutBtn,tbeOnClick,'BarkodOkut'); btnInsert = uForm.AddNewButton(uForm,'btnInsert', 'Insert'); btnInsert.Align = alBottom; uForm.AddNewEvent(btnInsert, tbeOnClick, 'InsertToDatabase');
database = Clomosy.AppFilesPath + 'ClomosyDatabase.db3' password = ''; try Clomosy.DBSQLiteConnect(database , password); Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE Categories(UrunAdi Text, Aciklamasi Text,UrunStok Text,BarkodOkut Text)'; Clomosy.DBSQLiteQuery.OpenOrExecute; ShowMessage('Veri tabanına tablo ekleme işlemi başarılı!'); except ShowMessage('Exception Class: '+LastExceptionClassName+' Exception Message: '+LastExceptionMessage); } GetData; uForm.Run; }
|