IDB0130MF.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "ITSDbF.h"
  6. #include "AppGlobalF.h"
  7. #include "ITSLangTransF.h"
  8. #pragma hdrstop
  9. #include "IDB0130MF.h"
  10. //---------------------------------------------------------------------------
  11. #pragma package(smart_init)
  12. #pragma link "cxButtons"
  13. #pragma link "cxCalc"
  14. #pragma link "cxCheckBox"
  15. #pragma link "cxClasses"
  16. #pragma link "cxContainer"
  17. #pragma link "cxControls"
  18. #pragma link "cxCustomData"
  19. #pragma link "cxData"
  20. #pragma link "cxDataStorage"
  21. #pragma link "cxDropDownEdit"
  22. #pragma link "cxEdit"
  23. #pragma link "cxFilter"
  24. #pragma link "cxGraphics"
  25. #pragma link "cxGrid"
  26. #pragma link "cxGridCustomTableView"
  27. #pragma link "cxGridCustomView"
  28. #pragma link "cxGridLevel"
  29. #pragma link "cxGridTableView"
  30. #pragma link "cxLabel"
  31. #pragma link "cxLookAndFeelPainters"
  32. #pragma link "cxLookAndFeels"
  33. #pragma link "cxStyles"
  34. #pragma link "cxTextEdit"
  35. #pragma link "dxSkinBlack"
  36. #pragma link "dxSkinBlue"
  37. #pragma link "dxSkinsCore"
  38. #pragma link "dxSkinscxPCPainter"
  39. #pragma resource "*.dfm"
  40. TIDB0130M *IDB0130M = NULL;
  41. //---------------------------------------------------------------------------
  42. __fastcall TIDB0130M::TIDB0130M(TComponent* Owner)
  43. : TForm(Owner)
  44. {
  45. LangTrans->Translate(this, ITSDb_GetConnection());
  46. ITSSkin_Load(this);
  47. CMM_LoadForm(g_sFormsDir, this);
  48. FTitle = Caption;//"운영자그룹 메뉴관리";
  49. FDbUpdate = false;
  50. }
  51. //---------------------------------------------------------------------------
  52. /*
  53. * 닫기버튼 이나 x버튼 클릭시 공통으로 처리하는 로직이들어간다..
  54. * Form과 DataModule class를 delete시킨다.
  55. * arguments
  56. *
  57. * return
  58. * void
  59. */
  60. void __fastcall TIDB0130M::CommClose()
  61. {
  62. try
  63. {
  64. CMM_SaveForm(g_sFormsDir, this);
  65. }
  66. catch(...)
  67. {
  68. }
  69. }
  70. //---------------------------------------------------------------------------
  71. /*
  72. * Form을 보여줄때 호출되는 event 메서드이다.
  73. * arguments
  74. * Sender : event handler 객체
  75. * return
  76. * void
  77. */
  78. void __fastcall TIDB0130M::FormShow(TObject *Sender)
  79. {
  80. Refresh();
  81. FormInit();
  82. TmrShow->Enabled = true;
  83. }
  84. //---------------------------------------------------------------------------
  85. /*
  86. * form 초기화
  87. *
  88. * arguments
  89. *
  90. * return
  91. * void
  92. */
  93. void __fastcall TIDB0130M::FormInit()
  94. {
  95. m_pGDC = TvList->DataController;
  96. TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<현재 등록된 운영자그룹 메뉴 정보가 없습니다>";
  97. InitColumnProperties();
  98. }
  99. //---------------------------------------------------------------------------
  100. void __fastcall TIDB0130M::InitColumnProperties()
  101. {
  102. FInitCombo1 = "";
  103. FInitCombo2 = "";
  104. try
  105. {
  106. try
  107. {
  108. //메뉴권한
  109. TcxComboBoxProperties *pcxColumn12 = (TcxComboBoxProperties *)Column12->Properties;
  110. pcxColumn12->Items->Clear();
  111. FInitCombo1 = lblY->Caption;//"[Y] 권한있음";
  112. pcxColumn12->Items->Add(lblY->Caption);//"[Y] 권한있음");
  113. pcxColumn12->Items->Add(lblN->Caption);//"[N] 권한없음");
  114. }
  115. catch(EDatabaseError &E)
  116. {
  117. throw Exception(String(E.ClassName()) + E.Message);
  118. }
  119. catch(Exception &exception)
  120. {
  121. throw Exception(String(exception.ClassName()) + exception.Message);
  122. }
  123. catch(...)
  124. {
  125. throw Exception(FrmLang->lblDbErr->Caption);//"알수없는 DB 오류가 발생하였습니다.");
  126. }
  127. }
  128. __finally
  129. {
  130. }
  131. }
  132. //---------------------------------------------------------------------------
  133. /*
  134. * Form이 Show되고 난 후 최초 1회 수행되는 타이머 이벤트
  135. * arguments
  136. * Sender : event handler 객체
  137. * return
  138. * void
  139. */
  140. void __fastcall TIDB0130M::TmrShowTimer(TObject *Sender)
  141. {
  142. TmrShow->Enabled = false;
  143. BtnSearchClick((TObject*)BtnSearch);
  144. }
  145. //---------------------------------------------------------------------------
  146. /*
  147. * Search 버튼 클릭 이벤트 핸들러
  148. * arguments
  149. * Sender : event handler 객체
  150. * return
  151. * void
  152. */
  153. void __fastcall TIDB0130M::BtnSearchClick(TObject *Sender)
  154. {
  155. Application->ProcessMessages();
  156. TSqlCursor sqlCrs((TControl*)BtnSearch);
  157. RefreshData();
  158. CxList->SetFocus();
  159. }
  160. //---------------------------------------------------------------------------
  161. /*
  162. * Refresh Data Event Function
  163. * arguments
  164. *
  165. * return
  166. * void
  167. */
  168. void __fastcall TIDB0130M::RefreshData()
  169. {
  170. SelListData();
  171. }
  172. //---------------------------------------------------------------------------
  173. void __fastcall TIDB0130M::SelListData()
  174. {
  175. FUpdate = false;
  176. CMM_ClearGridTableView(TvList);
  177. String sQry;
  178. TADOQuery *pADO = NULL;
  179. try
  180. {
  181. TvList->BeginUpdate();
  182. try
  183. {
  184. pADO = new TADOQuery(NULL);
  185. pADO->Close();
  186. pADO->Connection = ITSDb_GetConnection();
  187. #if 0
  188. sQry = "SELECT X.GROP_ID, X.GROP_NM, X.OPERSYST_MENU_ID, X.ATHR_YN, \r\n"
  189. " Y.GROP_MENU_NAME, Y.MENU_NAME \r\n"
  190. " FROM (SELECT A.GROP_ID, B.GROP_NM, A.OPERSYST_MENU_ID, A.ATHR_YN \r\n"
  191. " FROM TB_GROP_MENU_ATHR A, \r\n"
  192. " TB_USERGROP_INFR B \r\n"
  193. " WHERE A.GROP_ID = B.GROP_ID \r\n"
  194. " AND B.DEL_YN = 'N' ) X, \r\n"
  195. " (SELECT B.GROP_MENU_NAME, A.OPERSYST_MENU_ID, A.MENU_NAME \r\n"
  196. " FROM TB_OPERSYST_MENU A, \r\n"
  197. " (SELECT OPERSYST_MENU_ID AS OPER_SYST_ID, \r\n"
  198. " MENU_NAME AS GROP_MENU_NAME \r\n"
  199. " FROM TB_OPERSYST_MENU \r\n"
  200. " WHERE MENU_LEVL = 1 \r\n"
  201. " AND DEL_YN = 'N') B \r\n"
  202. " WHERE A.OPER_SYST_ID = B.OPER_SYST_ID \r\n"
  203. " AND A.MENU_LEVL = 2 \r\n"
  204. " AND A.DEL_YN = 'N' ) Y \r\n"
  205. " WHERE X.OPERSYST_MENU_ID = Y.OPERSYST_MENU_ID \r\n"
  206. " ORDER BY X.GROP_ID, Y.GROP_MENU_NAME, Y.MENU_NAME \r\n";
  207. #else
  208. sQry = "SELECT X.GROP_ID, X.GROP_NM, Y.OPERSYST_MENU_ID, \r\n"
  209. " NVL((SELECT ATHR_YN \r\n"
  210. " FROM TB_GROP_MENU_ATHR \r\n"
  211. " WHERE GROP_ID = X.GROP_ID \r\n"
  212. " AND OPERSYST_MENU_ID = Y.OPERSYST_MENU_ID), 'Y') AS ATHR_YN, \r\n"
  213. " Y.GROP_MENU_NAME, Y.MENU_NAME \r\n"
  214. " FROM TB_USERGROP_INFR X, \r\n"
  215. " (SELECT B.GROP_MENU_NAME, A.OPERSYST_MENU_ID, A.MENU_NAME \r\n"
  216. " FROM TB_OPERSYST_MENU A, \r\n"
  217. " (SELECT OPERSYST_MENU_ID AS OPER_SYST_ID, \r\n"
  218. " MENU_NAME AS GROP_MENU_NAME \r\n"
  219. " FROM TB_OPERSYST_MENU \r\n"
  220. " WHERE MENU_LEVL = 1 \r\n"
  221. " AND DEL_YN = 'N') B \r\n"
  222. " WHERE A.OPER_SYST_ID = B.OPER_SYST_ID \r\n"
  223. " AND A.MENU_LEVL = 2 \r\n"
  224. " AND A.DEL_YN = 'N' ) Y \r\n";
  225. #endif
  226. pADO->SQL->Clear();
  227. pADO->SQL->Text = sQry;
  228. pADO->Open();
  229. int nRow;
  230. for( ; !pADO->Eof; pADO->Next())
  231. {
  232. nRow = m_pGDC->AppendRecord();
  233. m_pGDC->Values[nRow][Column00->Index] = "-";
  234. m_pGDC->Values[nRow][Column01->Index] = pADO->FieldByName("GROP_ID")->AsString;
  235. m_pGDC->Values[nRow][Column02->Index] = pADO->FieldByName("GROP_NM")->AsString;
  236. m_pGDC->Values[nRow][Column03->Index] = pADO->FieldByName("GROP_MENU_NAME")->AsString;
  237. m_pGDC->Values[nRow][Column04->Index] = pADO->FieldByName("OPERSYST_MENU_ID")->AsString;
  238. m_pGDC->Values[nRow][Column05->Index] = pADO->FieldByName("MENU_NAME")->AsString;
  239. m_pGDC->Values[nRow][Column14->Index] = pADO->FieldByName("ATHR_YN")->AsString;
  240. String sATHR_YN = pADO->FieldByName("ATHR_YN")->AsString; //권한
  241. if (sATHR_YN == "Y")
  242. m_pGDC->Values[nRow][Column12->Index] = lblY->Caption;//"[Y] 권한있음";
  243. else
  244. m_pGDC->Values[nRow][Column12->Index] = lblN->Caption;//"[N] 권한없음";
  245. }
  246. }
  247. catch(EDatabaseError &E)
  248. {
  249. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  250. throw Exception(String(E.ClassName()) + E.Message);
  251. }
  252. catch(Exception &exception)
  253. {
  254. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  255. throw Exception(String(exception.ClassName()) + exception.Message);
  256. }
  257. catch(...)
  258. {
  259. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  260. throw Exception(FrmLang->lblDbErr->Caption);//"알수없는 DB 오류가 발생하였습니다.");
  261. }
  262. }
  263. __finally
  264. {
  265. if (pADO)
  266. {
  267. pADO->Close();
  268. delete pADO;
  269. }
  270. LblRecords->Caption = "("+FormatFloat("##,##0", m_pGDC->FilteredRecordCount) +"/"+FormatFloat("##,##0", m_pGDC->RecordCount) + ")";
  271. TvList->EndUpdate();
  272. TvList->DataController->GotoFirst();
  273. TvList->DataController->FocusedRecordIndex = 0;
  274. //CxList->SetFocus();
  275. }
  276. }
  277. //---------------------------------------------------------------------------
  278. /*
  279. * Close 버튼 클릭 이벤트 핸들러
  280. * arguments
  281. * Sender : event handler 객체
  282. * return
  283. * void
  284. */
  285. void __fastcall TIDB0130M::BtnCloseClick(TObject *Sender)
  286. {
  287. Close();
  288. }
  289. //---------------------------------------------------------------------------
  290. /*
  291. * 저장 버튼 클릭 이벤트 핸들러
  292. * arguments
  293. * Sender : event handler 객체
  294. * return
  295. * void
  296. */
  297. void __fastcall TIDB0130M::BtnExlSaveClick(TObject *Sender)
  298. {
  299. TcxGrid *pGrid = CxList;
  300. TcxGridTableView *pView = TvList;
  301. String sTitle= Caption;//"운영자그룹 메뉴";
  302. CMM_ExportToExcelFile(sTitle, pGrid, pView, this);
  303. }
  304. //---------------------------------------------------------------------------
  305. void __fastcall TIDB0130M::FormClose(TObject *Sender, TCloseAction &Action)
  306. {
  307. CommClose();
  308. IDB0130M = NULL;
  309. Action = caFree;
  310. }
  311. //---------------------------------------------------------------------------
  312. void __fastcall TIDB0130M::BtnEditClick(TObject *Sender)
  313. {
  314. TListFocus tvFocus(TvList);
  315. if (BtnEdit->Caption == FrmLang->lblCancel->Caption)//"취소")
  316. {
  317. CxList->SetFocus();
  318. Application->ProcessMessages();
  319. SaveData();
  320. }
  321. FrmLang->ITSSkin_ButtonClick(BtnSearch, BtnEdit, BtnInsert, BtnDelete, BtnApply);
  322. ChangeEditMode(BtnEdit->Down);
  323. RefreshData();
  324. }
  325. //---------------------------------------------------------------------------
  326. void __fastcall TIDB0130M::ChangeEditMode(bool AEdit)
  327. {
  328. bool bEditing = AEdit;
  329. try
  330. {
  331. TvList->BeginUpdate();
  332. Column00->Visible = bEditing;
  333. Column12->Options->Editing = bEditing;
  334. }
  335. __finally
  336. {
  337. TvList->EndUpdate();
  338. if (bEditing)
  339. {
  340. BtnEdit->Caption = FrmLang->lblCancel->Caption;//"취소";
  341. BtnEdit->Hint = FrmLang->lblCancel->Hint;//데이터 편집 취소";
  342. }
  343. else
  344. {
  345. BtnEdit->Caption = FrmLang->lblEdit->Caption;//"편집";
  346. BtnEdit->Hint = FrmLang->lblEdit->Hint;//데이터 편집";
  347. }
  348. }
  349. }
  350. //---------------------------------------------------------------------------
  351. void __fastcall TIDB0130M::TvListColumnPropertiesValidate(TObject *Sender, Variant &DisplayValue, TCaption &ErrorText, bool &Error)
  352. {
  353. if (TvList->Controller->FocusedRow->IsFilterRow) return;
  354. int nRow = m_pGDC->FocusedRecordIndex;
  355. if (nRow < 0) return;
  356. String ATHR_YN_ORG = VarToStr(m_pGDC->Values[nRow][Column14->Index]);
  357. String ATHR_YN = VarToStr(m_pGDC->Values[nRow][Column12->Index]);
  358. TcxGridColumn *pColumn = TvList->Controller->FocusedColumn;
  359. if (pColumn == Column12) ATHR_YN = DisplayValue;
  360. ATHR_YN = ITSUtil_GetCode(ATHR_YN);
  361. if (ATHR_YN_ORG != ATHR_YN )
  362. {
  363. m_pGDC->Values[nRow][Column00->Index] = FrmLang->lblModify->Caption;//"수정";
  364. }
  365. else
  366. {
  367. TvList->DataController->Values[nRow][Column00->Index] = "-";
  368. }
  369. }
  370. //---------------------------------------------------------------------------
  371. void __fastcall TIDB0130M::BtnBestFitClick(TObject *Sender)
  372. {
  373. try
  374. {
  375. TvList->BeginUpdate();
  376. TvList->ApplyBestFit(NULL, false, false);
  377. }
  378. __finally
  379. {
  380. TvList->EndUpdate();
  381. }
  382. }
  383. //---------------------------------------------------------------------------
  384. void __fastcall TIDB0130M::ChkAutoWidthPropertiesChange(TObject *Sender)
  385. {
  386. try
  387. {
  388. TvList->BeginUpdate();
  389. TvList->OptionsView->ColumnAutoWidth = ChkAutoWidth->Checked;
  390. BtnBestFit->Visible = !ChkAutoWidth->Checked;
  391. }
  392. __finally
  393. {
  394. TvList->EndUpdate();
  395. }
  396. }
  397. //---------------------------------------------------------------------------
  398. void __fastcall TIDB0130M::MnuDeleteCancelClick(TObject *Sender)
  399. {
  400. //
  401. }
  402. //---------------------------------------------------------------------------
  403. void __fastcall TIDB0130M::BtnApplyClick(TObject *Sender)
  404. {
  405. FUpdate = true;
  406. BtnEdit->Down = false;
  407. BtnEdit->Click();
  408. }
  409. //---------------------------------------------------------------------------
  410. bool __fastcall TIDB0130M::IsUpdate()
  411. {
  412. try
  413. {
  414. TcxGridDataController *pGDC = TvList->DataController;
  415. TvList->BeginUpdate();
  416. for(int ii = 0; ii < pGDC->RecordCount; ii++)
  417. {
  418. String sEdit = VarToStr(pGDC->Values[ii][Column00->Index]);
  419. if (sEdit != "-") return true;
  420. }
  421. }
  422. __finally
  423. {
  424. TvList->EndUpdate();
  425. }
  426. return false;
  427. }
  428. //---------------------------------------------------------------------------
  429. void __fastcall TIDB0130M::SaveData()
  430. {
  431. if (!IsUpdate()) return;
  432. if (!FUpdate)
  433. {
  434. if (Application->MessageBox(FrmLang->lblEidtConfirm->Caption.c_str(),//L"변경된 정보가 있습니다.\r\n변경된 정보를 저장 하시겠습니까?",
  435. FTitle.c_str(), MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL) != IDYES) return;
  436. }
  437. TADOQuery *pADOU = NULL;
  438. String sQryU;
  439. try
  440. {
  441. #if 0
  442. sQryU = "UPDATE TB_GROP_MENU_ATHR \r\n"
  443. " SET ATHR_YN = :p03 \r\n"
  444. " WHERE GROP_ID = :p01 \r\n"
  445. " AND OPERSYST_MENU_ID = :p02 \r\n";
  446. #else
  447. sQryU= "MERGE INTO TB_GROP_MENU_ATHR L \r\n"
  448. "USING (SELECT :p01 AS GROP_ID, \r\n"
  449. " :p02 AS OPERSYST_MENU_ID, \r\n"
  450. " :p03 AS ATHR_YN, \r\n"
  451. " :p04 AS LAST_CRPR_NMBR \r\n"
  452. " FROM DUAL \r\n"
  453. " ) M \r\n"
  454. "ON (L.GROP_ID = M.GROP_ID AND L.OPERSYST_MENU_ID = M.OPERSYST_MENU_ID) \r\n"
  455. "WHEN MATCHED THEN \r\n"
  456. " UPDATE SET L.ATHR_YN = M.ATHR_YN, \r\n"
  457. " L.LAST_CRPR_NMBR = M.LAST_CRPR_NMBR, \r\n"
  458. " L.LAST_CRCT_DT = TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS') \r\n"
  459. "WHEN NOT MATCHED THEN \r\n"
  460. " INSERT (L.GROP_ID, L.OPERSYST_MENU_ID, L.ATHR_YN, \r\n"
  461. " L.LAST_CRPR_NMBR, L.LAST_CRCT_DT) \r\n"
  462. " VALUES (M.GROP_ID, M.OPERSYST_MENU_ID, M.ATHR_YN, \r\n"
  463. " M.LAST_CRPR_NMBR, \r\n"
  464. " TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')) \r\n";
  465. #endif
  466. int nRow;
  467. TvList->BeginUpdate();
  468. try
  469. {
  470. pADOU = new TADOQuery(NULL);
  471. pADOU->Close();
  472. pADOU->Connection = ITSDb_GetConnection();
  473. ITSDb_SQLText(pADOU, sQryU);
  474. ITSDb_GetConnection()->BeginTrans();
  475. try
  476. {
  477. TcxGridDataController *pGDC = TvList->DataController;
  478. for(int ii = 0; ii < pGDC->RecordCount; ii++)
  479. {
  480. String sEdit = VarToStr(pGDC->Values[ii][Column00->Index]);
  481. if (sEdit == "-") continue;
  482. String GROP_ID = VarToStr(pGDC->Values[ii][Column01->Index]);
  483. String OPERSYST_MENU_ID = VarToStr(pGDC->Values[ii][Column04->Index]);
  484. String ATHR_YN = VarToStr(pGDC->Values[ii][Column12->Index]);
  485. ATHR_YN = ITSUtil_GetCode(ATHR_YN);
  486. ITSDb_SQLBind(pADOU, "p01", GROP_ID);
  487. ITSDb_SQLBind(pADOU, "p02", OPERSYST_MENU_ID);
  488. ITSDb_SQLBind(pADOU, "p03", ATHR_YN);
  489. ITSDb_SQLBind(pADOU, "p04", g_pLOGIN->sUserId);
  490. ITSDb_SQLExec(pADOU);
  491. pGDC->Values[ii][Column14->Index] = ATHR_YN;
  492. }
  493. }
  494. catch(...)
  495. {
  496. }
  497. ITSDb_GetConnection()->CommitTrans();
  498. Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"운영자그룹 메뉴권한 정보를 저장 하였습니다.",
  499. FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  500. FDbUpdate = true;
  501. }
  502. catch(EDatabaseError &E)
  503. {
  504. ITSDb_GetConnection()->RollbackTrans();
  505. ShowMessage(String(E.ClassName()) + E.Message);
  506. }
  507. catch(Exception &exception)
  508. {
  509. ITSDb_GetConnection()->RollbackTrans();
  510. ShowMessage(String(exception.ClassName()) + exception.Message);
  511. }
  512. catch(...)
  513. {
  514. ITSDb_GetConnection()->RollbackTrans();
  515. ShowMessage(FrmLang->lblDbDelErr->Caption);//"데이터 삭제 중에 알수없는 DB 오류가 발생하였습니다.");
  516. }
  517. }
  518. __finally
  519. {
  520. if (pADOU)
  521. {
  522. pADOU->Close();
  523. delete pADOU;
  524. }
  525. TvList->EndUpdate();
  526. }
  527. }
  528. //---------------------------------------------------------------------------
  529. void __fastcall TIDB0130M::FormCloseQuery(TObject *Sender, bool &CanClose)
  530. {
  531. SaveData();
  532. }
  533. //---------------------------------------------------------------------------
  534. void __fastcall TIDB0130M::TvListDataControllerFilterChanged(TObject *Sender)
  535. {
  536. CMM_SetFilterLike(TvList);
  537. LblRecords->Caption = "("+FormatFloat("##,##0", m_pGDC->FilteredRecordCount) +"/"+FormatFloat("##,##0", m_pGDC->RecordCount) + ")";
  538. }
  539. //---------------------------------------------------------------------------
  540. void __fastcall TIDB0130M::TvListCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
  541. bool &ADone)
  542. {
  543. if (AViewInfo)
  544. {
  545. String sType = AViewInfo->GridRecord->DisplayTexts[Column00->Index];
  546. if (sType == FrmLang->lblModify->Caption)//"수정")
  547. {
  548. ACanvas->Brush->Color = clOlive;
  549. }
  550. else if (sType == FrmLang->lblDelete->Caption)//"삭제")
  551. {
  552. ACanvas->Brush->Color = clRed;
  553. }
  554. else if (sType == FrmLang->lblNew->Caption)//"신규")
  555. {
  556. ACanvas->Brush->Color = clLime;
  557. if (AViewInfo->Focused) ACanvas->Font->Color = clBlack;
  558. }
  559. else
  560. {
  561. String sAuth = AViewInfo->GridRecord->DisplayTexts[Column12->Index];
  562. if (sAuth.Pos("N"))
  563. {
  564. ACanvas->Brush->Color = clPurple;
  565. }
  566. }
  567. }
  568. }
  569. //---------------------------------------------------------------------------