123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "AppGlobalF.h"
- #include "ITSLangTransF.h"
- #include "ITSLangTransF.h"
- #pragma hdrstop
- #include "IDB00401F.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 resource "*.dfm"
- TIDB00401 *IDB00401 = NULL;
- //---------------------------------------------------------------------------
- __fastcall TIDB00401::TIDB00401(TComponent* Owner)
- : TForm(Owner)
- {
- LangTrans->Translate(this, ITSDb_GetConnection());
- ITSSkin_Load(this);
- //CMM_LoadForm(g_sFormsDir, this);
- FUpdated = false;
- }
- //---------------------------------------------------------------------------
- /*
- * 닫기버튼 이나 x버튼 클릭시 공통으로 처리하는 로직이들어간다..
- * Form과 DataModule class를 delete시킨다.
- * arguments
- *
- * return
- * void
- */
- void __fastcall TIDB00401::CommClose()
- {
- try
- {
- //CMM_SaveForm(g_sFormsDir, this);
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
- /*
- * Form을 보여줄때 호출되는 event 메서드이다.
- * arguments
- * Sender : event handler 객체
- * return
- * void
- */
- void __fastcall TIDB00401::FormShow(TObject *Sender)
- {
- Refresh();
- }
- //---------------------------------------------------------------------------
- /*
- * Close 버튼 클릭 이벤트 핸들러
- * arguments
- * Sender : event handler 객체
- * return
- * void
- */
- void __fastcall TIDB00401::BtnCloseClick(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TIDB00401::FormClose(TObject *Sender, TCloseAction &Action)
- {
- CommClose();
- IDB00401 = NULL;
- //Action = caFree;
- }
- //---------------------------------------------------------------------------
- void __fastcall TIDB00401::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();
- String sStNm = EdStNm->Text.Trim();
- String sEdNm = EdEdNm->Text.Trim();
- try
- {
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_GetConnection()->BeginTrans();
- // 세부코드 삭제
- sQry = "UPDATE TB_ROAD \r\n"
- " SET ROAD_NAME = :p02, \r\n"
- " STRT_NM = :p03, \r\n"
- " END_NM = :p04 \r\n"
- " WHERE ROAD_ID = :p01 \r\n";
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", sId);
- ITSDb_SQLBind(pADO, "p02", sNm);
- ITSDb_SQLBind(pADO, "p03", sStNm);
- ITSDb_SQLBind(pADO, "p04", sEdNm);
- 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);
- ShowMessage(String(E.ClassName()) + E.Message);
- }
- catch(Exception &exception)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(String(exception.ClassName()) + exception.Message);
- }
- catch(...)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(FrmLang->lblDbErr->Caption);//"데이터 수정 중에 알수없는 DB 오류가 발생하였습니다.");
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- }
- }
- //---------------------------------------------------------------------------
|