//--------------------------------------------------------------------------- #include #include "ITSDbF.h" #include "ITSUtilF.h" #include "AppGlobalF.h" #include "ITSSkinF.h" #include "ITSLangTransF.h" #pragma hdrstop #include "FrmParkMsgF.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "cxClasses" #pragma link "cxControls" #pragma link "cxCustomData" #pragma link "cxData" #pragma link "cxDataStorage" #pragma link "cxEdit" #pragma link "cxFilter" #pragma link "cxGraphics" #pragma link "cxGrid" #pragma link "cxGridCustomTableView" #pragma link "cxGridCustomView" #pragma link "cxGridLevel" #pragma link "cxGridTableView" #pragma link "cxLabel" #pragma link "cxLookAndFeelPainters" #pragma link "cxLookAndFeels" #pragma link "cxStyles" #pragma link "dxSkinBlack" #pragma link "dxSkinBlue" #pragma link "dxSkinsCore" #pragma link "dxSkinscxPCPainter" #pragma resource "*.dfm" TFrmParkMsg *FrmParkMsg = NULL; //--------------------------------------------------------------------------- __fastcall TFrmParkMsg::TFrmParkMsg(TComponent* Owner, TItsParking *AObj) : TForm(Owner) { LangTrans->Translate(this, ITSDb_GetConnection()); FObj = AObj; pADO->Connection = ITSDb_GetConnection(); TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<ÁÖÂ÷Á¤º¸>"; } //--------------------------------------------------------------------------- void __fastcall TFrmParkMsg::FormClose(TObject *Sender, TCloseAction &Action) { Action = caFree; } //--------------------------------------------------------------------------- void __fastcall TFrmParkMsg::FormShow(TObject *Sender) { TmrShow->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TFrmParkMsg::TmrShowTimer(TObject *Sender) { TmrShow->Enabled = false; if (FObj) { Caption = FObj->CTLR_MNGM_NMBR + ": " + FObj->CTLR_MNGM_NM; } TmrQry->Interval = 100; TmrQry->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TFrmParkMsg::TmrQryTimer(TObject *Sender) { TmrQry->Enabled = false; if (!FObj) return; SelectParkMsg(); TmrQry->Interval = 60 * 1000; TmrQry->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TFrmParkMsg::SelectParkMsg() { String sQry; if (!FObj) { return; } CMM_ClearGridTableView(TvList); sQry = "SELECT A.CTLR_MNGM_NMBR, A.CTLR_MNGM_NM, \r\n" " B.FLOR_NMBR AS FLORID, B.FLOR_NM AS FLORNM, \r\n" " H.* \r\n" " FROM TB_PRLT_CTLR A, \r\n" " TB_PRLT_FLOR B, \r\n" " TB_PRLT_RT_INFR H \r\n" " WHERE A.CTLR_MNGM_NMBR = :p01 \r\n" " AND A.CTLR_MNGM_NMBR = B.CTLR_MNGM_NMBR \r\n" " AND B.CTLR_MNGM_NMBR = H.CTLR_MNGM_NMBR \r\n" " AND B.FLOR_NMBR = H.FLOR_NMBR \r\n" " ORDER BY A.CTLR_MNGM_NMBR, B.FLOR_NMBR, H.UPDT_DT \r\n"; //" AND H.UPDT_DT >= TO_CHAR(SYSDATE-8/1440, 'YYYYMMDDHH24MISS') \r\n"; try { int nRow; TvList->BeginUpdate(); try { pADO->Connection = ITSDb_GetConnection(); ITSDb_SQLText(pADO, sQry); ITSDb_SQLBind(pADO, "p01", FObj->CTLR_MNGM_NMBR); ITSDb_SQLOpen(pADO); for( ; !pADO->Eof; pADO->Next()) { nRow = TvList->DataController->AppendRecord(); TvList->DataController->Values[nRow][Col00->Index] = pADO->FieldByName("FLORID")->AsString; TvList->DataController->Values[nRow][Col01->Index] = pADO->FieldByName("FLORNM")->AsString; //TvList->DataController->Values[nRow][Col02->Index] = pADO->FieldByName("UPDT_DT")->AsString; TvList->DataController->Values[nRow][Col02->Index] = ITSUtil_StrToDateTime(pADO->FieldByName("UPDT_DT")->AsString).FormatString(STR_DATETIME); TvList->DataController->Values[nRow][Col03->Index] = pADO->FieldByName("GNRL_RMND_PRZN_NUM")->AsString; TvList->DataController->Values[nRow][Col04->Index] = pADO->FieldByName("LGVH_RMND_PRZN_NUM")->AsString; TvList->DataController->Values[nRow][Col05->Index] = pADO->FieldByName("HVVH_RMND_PRZN_NUM")->AsString; TvList->DataController->Values[nRow][Col06->Index] = pADO->FieldByName("EMVH_RMND_PRZN_NUM")->AsString; TvList->DataController->Values[nRow][Col07->Index] = pADO->FieldByName("HNDC_RMND_PRZN_NUM")->AsString; TvList->DataController->Values[nRow][Col08->Index] = pADO->FieldByName("WMON_RMND_PRZN_NUM")->AsString; TvList->DataController->Values[nRow][Col09->Index] = pADO->FieldByName("ETC_RMND_PRZN_NUM")->AsString; } ITSDb_SQLClose(pADO); } catch(EDatabaseError &E) { throw Exception(String(E.ClassName()) + E.Message); } catch(...) { throw Exception(FrmLang->lblDbErr->Caption);//"¾Ë¼ö¾ø´Â ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù."); } } __finally { TvList->EndUpdate(); } } //--------------------------------------------------------------------------- void __fastcall TFrmParkMsg::FormDestroy(TObject *Sender) { TmrQry->Enabled = false; try { if (FObj) FObj->FData1 = NULL; } catch(...) {} } //---------------------------------------------------------------------------