Прекрасный пример из разряда "Найти приключение на свою зад... Ой! голову" Add(MainForm,2953706,21,105) { Point(onClose) link(onCreate,7739588:doOpen,[]) link(onClose,7739588:doClose,[]) } Add(DS_SQLite,7739588,84,119) { Name="bd" FileName=":memory:" link(onOpen,10439328:doEvent1,[]) } Add(DSC_Exec,7361588,182,119) { SQL="CREATE TABLE lesplus(\r\n[poroda] TEXT,\r\n[kub] REAL,\r\n[operacia] TEXT);\r\nINSERT INTO lesplus values('Хвоя', 5, 'Расход');\r\nINSERT INTO lesplus values('Хвоя', 20, 'поступление' );\r\nINSERT INTO lesplus values('Береза', 10, 'поступление');\r\nINSERT INTO lesplus values('Хвоя', 5, 'Расход');" DSManager="bd" } Add(Hub,10439328,133,119) { OutCount=5 link(onEvent1,7361588:doExec,[]) link(onEvent2,6186142:doClear,[(173,132)(173,160)]) link(onEvent3,8505231:doQuery,[(165,139)(165,174)]) link(onEvent4,4179386:doQuery,[(160,146)(160,209)]) link(onEvent5,12823672:doQuery,[(155,153)(155,251)]) } Add(DSC_Query,12823672,182,245) { SQL="SELECT poroda, sum( case when operacia='Расход' then (kub*-1) else kub end),'В наличии' FROM lesplus GROUP BY poroda;" DSManager="bd" link(onQuery,12518594:doWork3,[(235,251)]) } Add(StringTable,6186142,329,147) { Left=15 Top=10 Width=355 Height=185 Columns=#1:1|1:2|1:3| } Add(MT_String,1361166,252,203) { link(onResult,6186142:doAdd,[(300,209)(300,153)]) } Add(DSC_Query,8505231,182,168) { SQL="SELECT * FROM lesplus;" DSManager="bd" link(onQuery,12518594:doWork1,[(235,174)]) } Add(DSC_Query,4179386,182,203) { SQL="SELECT '========================';" DSManager="bd" link(onQuery,12518594:doWork2,[]) } Add(HubEx,12518594,231,203) { link(onEvent,1361166:doStr,[]) }
Редактировалось 1 раз(а), последний 2018-02-12 11:07:32
|