b;, rn, m_ID: longint; _Name: string;. Clear;. InitializeLocal;. OpenDatabase (m_CatDBFilename, true); i: = 1 to db.RecordCount do_ID: = db.DirectReadLong (i, 1); _Name: = alltrim (db.DirectReadString (i, 2));. Items.AddObject (m_Name, TObject (m_ID));; CatCB.Items.Count> 0 then.ItemIndex : = 0;. DBClose; CatCB.Items.Count> 0 then;;
TMainForm.OnSelectCat;: tdb;, rn, m_CatID, m_RecID: longint; _Name: string; _BadList: TList; _BadList: = TList.Create;. Clear; _CurCatID: = longint (CatCB.Items . Objects [CatCB.ItemIndex]);. InitializeLocal;. OpenDatabase (m_RecDBFilename); i: = 1 to db.RecordCount do_CatID: = db.DirectReadLong (i, 2); m_CatID <> m_CurCatID then; _RecID: = db . DirectReadLong (i, 1); _name: = alltrim (db.DirectReadString (i, 3)); fileExists (m_DataFolder + along2str (m_RecID) + '. rec') then.AddItem (m_name, TObject (m_RecID)) _BadList. Add (TObject (i));; l.Items.Count> 0 then.Itemindex: = 0;; m_BadList.Count> 0 thenI: = m_BadList.Count - 1 to 0 do_lib.PhisicalDeleteRecordLocalInDB (db, longint (m_BadList [i]));. DBClose; _BadList.Clear; _BadList.Free;;
TMainForm.OnSelectRecept;: string; l.ItemIndex <0 then.Clear; _curRecID: = -1;;; _curRecID: = longint (l.Items.Objects [l.ItemIndex]); . Clear;: = m_DataFolder + along2str (m_curRecID) + '. rec';. Lines.LoadFromFile (filename);;
TMainForm.PopupMenu1Popup (Sender: TObject);. Enabled: = l.Items.Count> 0;. Enabled: = l.Items.Count> 0;. Enabled: = l.Items . Count> 0;. Enabled: = l.Items.Count> 0;. Enabled: = l.Items.Count> 0;. Enabled: = l.Items.Count> 0;
;
TMainForm.OnDelete; _curIndex: longint; (l.Items.Count <1) then.Run ('В категорії "' + CatCB.Items [CatCB.itemindex] + '" рецепти відсутні ', false, false, true, false);;; l.ItemIndex <0 then.Run (' Не вибрать жодних рецептом ', false, false, true, false);;;. Run (' Ві Дійсно Хочете ВИДАЛИТИ рецепт "'+ l.Items [l.Itemindex] +'"? ', true, true, false, false); AskDialog.m_SelectedItem <> 1 then; _Curindex: = l.ItemIndex; (m_curRecID); ; (l, m_curindex);;;
TMainForm.DeleteRecept (recID: longint);, rn: longint;: tdb;. InitializeLocal;. OpenDatabase (m_RecDBFilename);: = tdb_lib.SeekForLong (db, 1, recID, true); ( db, rn); (m_DataFolder + along2str (recID) + '. rec');. DBClose;; TMainForm.OnDeleteCategory;: tdb;, catid, recid, i, index: longint; CatCB.Items.Count <2 then . Run ('Неможливо ВИДАЛИТИ категорію "' + CatCB.Items [CatCB.itemindex] + '".' + # 13 +
'После видалений винна Залишити хочай б одна категорія.', false, false, true, false);;; l.Count> 0 then.Run ('категорія "' + CatCB.Items [CatCB.itemindex] + '"не порожня!' + # 13 +
'Відаляючі ее, ві Відаль ВСІ рецепти,' + # 13 +
'что знахо...