123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "AppGlobalF.h"
- #include "ITSLangTransF.h"
- #include "ITS_OPLibF.h"
- #pragma hdrstop
- #include "IDB00201F.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "FRAME_NodeListF"
- #pragma link "cxButtons"
- #pragma link "cxContainer"
- #pragma link "cxControls"
- #pragma link "cxEdit"
- #pragma link "cxGraphics"
- #pragma link "cxGroupBox"
- #pragma link "cxLookAndFeelPainters"
- #pragma link "cxLookAndFeels"
- #pragma link "cxTextEdit"
- #pragma link "dxSkinBlack"
- #pragma link "dxSkinBlue"
- #pragma link "dxSkinsCore"
- #pragma link "dxSkinMcSkin"
- #pragma resource "*.dfm"
- TIDB00201 *IDB00201 = NULL;
- //---------------------------------------------------------------------------
- __fastcall TIDB00201::TIDB00201(TComponent* Owner)
- : TForm(Owner)
- {
- LangTrans->Translate(this, ITSDb_GetConnection());
- ITSSkin_Load(this);
- //CMM_LoadForm(g_sFormsDir, this);
- FUpdated = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TIDB00201::CommClose()
- {
- try
- {
- //CMM_SaveForm(g_sFormsDir, this);
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TIDB00201::FormShow(TObject *Sender)
- {
- Refresh();
- }
- //---------------------------------------------------------------------------
- void __fastcall TIDB00201::BtnCloseClick(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TIDB00201::FormClose(TObject *Sender, TCloseAction &Action)
- {
- CommClose();
- IDB00201 = NULL;
- //Action = caFree;
- }
- //---------------------------------------------------------------------------
- void __fastcall TIDB00201::BtnSaveClick(TObject *Sender)
- {
- if (Application->MessageBox(FrmLang->lblChangeInfo->Caption.c_str(), //L"정보를 수정 하시겠습니까?",
- Caption.c_str(), MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL) != IDYES) return;
- TADOQuery *pADO = NULL;
- String sQry;
- String sId = EdId->Text.Trim();
- String sNm = EdNm->Text.Trim();
- try
- {
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_GetConnection()->BeginTrans();
- // 세부코드 삭제
- sQry = "UPDATE TB_LINK \r\n"
- " SET ROAD_NAME = :p02 \r\n"
- " WHERE LINK_ID = :p01 \r\n";
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", sId);
- ITSDb_SQLBind(pADO, "p02", sNm);
- ITSDb_SQLExec(pADO);
- ITSDb_GetConnection()->CommitTrans();
- FUpdated = true;
- Application->MessageBox(FrmLang->lblChangeOk->Caption.c_str(),//L"정보를 수정 하였습니다.",
- Caption.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
- }
- catch(EDatabaseError &E)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
- throw Exception(String(E.ClassName()) + E.Message);
- }
- catch(Exception &e)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- DBERRORMSG(Caption, String(e.ClassName()), e.Message, sQry);
- throw Exception(String(e.ClassName()) + e.Message);
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- }
- }
- //---------------------------------------------------------------------------
|