IDB00201F.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "AppGlobalF.h"
  6. #include "ITSLangTransF.h"
  7. #pragma hdrstop
  8. #include "IDB00201F.h"
  9. //---------------------------------------------------------------------------
  10. #pragma package(smart_init)
  11. #pragma link "FRAME_NodeListF"
  12. #pragma link "cxButtons"
  13. #pragma link "cxContainer"
  14. #pragma link "cxControls"
  15. #pragma link "cxEdit"
  16. #pragma link "cxGraphics"
  17. #pragma link "cxGroupBox"
  18. #pragma link "cxLookAndFeelPainters"
  19. #pragma link "cxLookAndFeels"
  20. #pragma link "cxTextEdit"
  21. #pragma link "dxSkinBlack"
  22. #pragma link "dxSkinBlue"
  23. #pragma link "dxSkinsCore"
  24. #pragma resource "*.dfm"
  25. TIDB00201 *IDB00201 = NULL;
  26. //---------------------------------------------------------------------------
  27. __fastcall TIDB00201::TIDB00201(TComponent* Owner)
  28. : TForm(Owner)
  29. {
  30. LangTrans->Translate(this, ITSDb_GetConnection());
  31. ITSSkin_Load(this);
  32. //CMM_LoadForm(g_sFormsDir, this);
  33. FUpdated = false;
  34. }
  35. //---------------------------------------------------------------------------
  36. void __fastcall TIDB00201::CommClose()
  37. {
  38. try
  39. {
  40. //CMM_SaveForm(g_sFormsDir, this);
  41. }
  42. catch(...)
  43. {
  44. }
  45. }
  46. //---------------------------------------------------------------------------
  47. void __fastcall TIDB00201::FormShow(TObject *Sender)
  48. {
  49. Refresh();
  50. }
  51. //---------------------------------------------------------------------------
  52. void __fastcall TIDB00201::BtnCloseClick(TObject *Sender)
  53. {
  54. Close();
  55. }
  56. //---------------------------------------------------------------------------
  57. void __fastcall TIDB00201::FormClose(TObject *Sender, TCloseAction &Action)
  58. {
  59. CommClose();
  60. IDB00201 = NULL;
  61. //Action = caFree;
  62. }
  63. //---------------------------------------------------------------------------
  64. void __fastcall TIDB00201::BtnSaveClick(TObject *Sender)
  65. {
  66. if (Application->MessageBox(FrmLang->lblChangeInfo->Caption.c_str(), //L"정보를 수정 하시겠습니까?",
  67. Caption.c_str(), MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL) != IDYES) return;
  68. TADOQuery *pADO = NULL;
  69. String sQry;
  70. String sId = EdId->Text.Trim();
  71. String sNm = EdNm->Text.Trim();
  72. try
  73. {
  74. try
  75. {
  76. pADO = new TADOQuery(NULL);
  77. pADO->Close();
  78. pADO->Connection = ITSDb_GetConnection();
  79. ITSDb_GetConnection()->BeginTrans();
  80. // 세부코드 삭제
  81. sQry = "UPDATE TB_LINK \r\n"
  82. " SET ROAD_NAME = :p02 \r\n"
  83. " WHERE LINK_ID = :p01 \r\n";
  84. ITSDb_SQLText(pADO, sQry);
  85. ITSDb_SQLBind(pADO, "p01", sId);
  86. ITSDb_SQLBind(pADO, "p02", sNm);
  87. ITSDb_SQLExec(pADO);
  88. ITSDb_GetConnection()->CommitTrans();
  89. FUpdated = true;
  90. Application->MessageBox(FrmLang->lblChangeOk->Caption.c_str(),//L"정보를 수정 하였습니다.",
  91. Caption.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  92. }
  93. catch(EDatabaseError &E)
  94. {
  95. ITSDb_GetConnection()->RollbackTrans();
  96. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  97. DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
  98. throw Exception(String(E.ClassName()) + E.Message);
  99. }
  100. catch(Exception &e)
  101. {
  102. ITSDb_GetConnection()->RollbackTrans();
  103. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  104. DBERRORMSG(Caption, String(e.ClassName()), e.Message, sQry);
  105. throw Exception(String(e.ClassName()) + e.Message);
  106. }
  107. }
  108. __finally
  109. {
  110. if (pADO)
  111. {
  112. pADO->Close();
  113. delete pADO;
  114. }
  115. }
  116. }
  117. //---------------------------------------------------------------------------