//--------------------------------------------------------------------------- #include #include "ITSSkinF.h" #include "ITSUtilF.h" #include "ITSDbF.h" #include "AppGlobalF.h" #include "CDSCodeF.h" #include "CDSNodeF.h" #include "CDSLinkF.h" #include "CDSIfscF.h" #include "CDSRoadF.h" #include "ITSLangTransF.h" #pragma hdrstop #include "IDB0040MF.h" #include "IDB00401F.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "FRAME_RoadListF" #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 "cxSplitter" #pragma link "dxSkinBlack" #pragma link "dxSkinBlue" #pragma link "dxSkinsCore" #pragma link "FRAME_IfscListF" #pragma resource "*.dfm" TIDB0040M *IDB0040M = NULL; //--------------------------------------------------------------------------- __fastcall TIDB0040M::TIDB0040M(TComponent* Owner) : TForm(Owner) { LangTrans->Translate(this, ITSDb_GetConnection()); ITSSkin_Load(this); CMM_LoadForm(g_sFormsDir, this); FRAMERoadList1->PnlTop->Visible = false; FRAMERoadList1->ChkDispExt->Visible = false; FRAMEIfscList1->PnlTop->Visible = false; FRAMEIfscList1->ChkDispExt->Visible = false; FRAMEIfscList1->ColumnSeq->Visible = true; } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::CommClose() { try { CMM_SaveForm(g_sFormsDir, this); } catch(...) { } } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::FormInit() { //m_pGDC = TvList->DataController; //TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<¸µÅ© Á¤º¸°¡ ¾ø½À´Ï´Ù>"; FCodeRDU = ItsCodeManager->FLists.Find("RDU"); // µµ·Î»ç¿ë¿©ºÎ FCodeRDR = ItsCodeManager->FLists.Find("RDR"); // µµ·Îµî±Þ FCodeRDT = ItsCodeManager->FLists.Find("RDT"); // µµ·ÎÀ¯Çü FCodeMLT = ItsCodeManager->FLists.Find("MLT"); // Á߿뱸°£ FCodeCTR = ItsCodeManager->FLists.Find("CTR"); // ¿¬°á·Î FCodePLV = ItsCodeManager->FLists.Find("PLV"); // ÅëÇàÁ¦ÇÑÂ÷·® } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::FormShow(TObject *Sender) { Refresh(); FormInit(); TmrShow->Enabled = true; FRAMERoadList1->UpdateList(); } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::TmrShowTimer(TObject *Sender) { TmrShow->Enabled = false; BtnSearchClick((TObject*)BtnSearch); } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::RefreshData() { } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::SelListData() { } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::BtnSearchClick(TObject *Sender) { Application->ProcessMessages(); TSqlCursor sqlCrs((TControl*)BtnSearch); RefreshData(); //CxList->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::BtnCloseClick(TObject *Sender) { Close(); } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::DisplayListData() { } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::FormClose(TObject *Sender, TCloseAction &Action) { CommClose(); IDB0040M = NULL; Action = caFree; } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::MnuMovePosClick(TObject *Sender) { #if 0 TMenuItem *pMenu = (TMenuItem *)Sender; if (TvList->ViewData->RecordCount <= 0) return; int nIndex = m_pGDC->FocusedRecordIndex; if( nIndex < 0 ) return; String sLinkId = VarToStr(m_pGDC->Values[nIndex][Column01->Index]); #endif } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::FRAMERoadList1TvListFocusedRecordChanged(TcxCustomGridTableView *Sender, TcxCustomGridRecord *APrevFocusedRecord, TcxCustomGridRecord *AFocusedRecord, bool ANewItemRecordFocusingChanged) { int nIndex = FRAMERoadList1->TvList->DataController->FocusedRecordIndex; if (nIndex < 0) return; TLabel *pLabel = FRAMEIfscList1->LblRecords; TcxGridTableView *TvList = FRAMEIfscList1->TvList; TcxDataController *m_pGDC = TvList->DataController; pLabel->Caption = "0 °Ç"; CMM_ClearGridTableView(TvList); try { int nRow; TvList->BeginUpdate(); try { TItsSubCode *pSubCode; TItsCode *FCodeIFD = ItsCodeManager->FLists.Find("IFD"); // ¹æÇâÄÚµå TItsCode *FCodeSRT = ItsCodeManager->FLists.Find("SRT"); // ±¸°£µî±ÞÄÚµå String sRoadId = VarToStr(FRAMERoadList1->TvList->DataController->Values[nIndex][FRAMERoadList1->Column01->Index]); TItsRoad *pRoad = ItsRoadManager->FLists.Find(sRoadId); if (!pRoad) return; TItsIfsc *pIfsc; String sFNodeName, sTNodeName; int nSeq; std::map::iterator itPos; for(itPos = pRoad->FIfscs.begin(); itPos != pRoad->FIfscs.end(); ++itPos) { nRow = m_pGDC->AppendRecord(); nSeq = itPos->first; String sSvcLinkId = itPos->second; m_pGDC->Values[nRow][FRAMEIfscList1->ColumnSeq->Index] = nSeq; m_pGDC->Values[nRow][FRAMEIfscList1->Column00->Index] = sSvcLinkId; m_pGDC->Values[nRow][FRAMEIfscList1->Column01->Index] = sSvcLinkId; pIfsc = ItsIfscManager->FLists.Find(sSvcLinkId); if (!pIfsc) { continue; } m_pGDC->Values[nRow][FRAMEIfscList1->Column00->Index] = pIfsc->IFSC_ID; //'Á¤º¸Á¦°ø±¸°£ ID' m_pGDC->Values[nRow][FRAMEIfscList1->Column01->Index] = pIfsc->IFSC_ID; //'Á¤º¸Á¦°ø±¸°£ ID' m_pGDC->Values[nRow][FRAMEIfscList1->Column02->Index] = pIfsc->IFSC_NM; //'Á¤º¸Á¦°ø±¸°£ ¸í' String sIFD = "[" + pIfsc->DRCT_CD + "] "; pSubCode = FCodeIFD->FSubLists.Find(pIfsc->DRCT_CD); // ¹æÇâÄÚµå if (pSubCode) sIFD = sIFD + pSubCode->CMMN_CD_KOR_NM; m_pGDC->Values[nRow][FRAMEIfscList1->Column03->Index] = sIFD; //'¹æÇâ ÄÚµå' m_pGDC->Values[nRow][FRAMEIfscList1->Column04->Index] = pIfsc->RMRK; //'ºñ°í' m_pGDC->Values[nRow][FRAMEIfscList1->Column05->Index] = pIfsc->EXTR_CNCT_SECT_YN; //'¿ÜºÎ ¿¬°è ±¸°£ ¿©ºÎ' m_pGDC->Values[nRow][FRAMEIfscList1->Column06->Index] = pIfsc->DEL_YN; //'»èÁ¦ ¿©ºÎ' m_pGDC->Values[nRow][FRAMEIfscList1->Column07->Index] = pIfsc->SECT_LNGT; //'±¸°£ ±æÀÌ' String sSRT = "[" + pIfsc->SECT_GRAD_CD + "] "; pSubCode = FCodeSRT->FSubLists.Find(pIfsc->SECT_GRAD_CD); // ±¸°£µî±ÞÄÚµå if (pSubCode) sSRT = sSRT + pSubCode->CMMN_CD_KOR_NM; m_pGDC->Values[nRow][FRAMEIfscList1->Column08->Index] = sSRT; //'±¸°£ µî±Þ ÄÚµå' m_pGDC->Values[nRow][FRAMEIfscList1->Column09->Index] = pIfsc->F_NODE_ID; //'½ÃÀÛ³ëµåID' m_pGDC->Values[nRow][FRAMEIfscList1->Column10->Index] = pIfsc->T_NODE_ID; //'Á¾·á³ëµåID' m_pGDC->Values[nRow][FRAMEIfscList1->Column11->Index] = pIfsc->STRT_NM; //'½ÃÁ¡ ¸í' m_pGDC->Values[nRow][FRAMEIfscList1->Column12->Index] = pIfsc->END_NM; //'Á¾Á¡ ¸í' } } catch(...) { } } __finally { TvList->EndUpdate(); pLabel->Caption = FormatFloat("##,##0", m_pGDC->RecordCount) + " °Ç"; } } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::FRAMERoadList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton, TShiftState AShift, bool &AHandled) { BtnEditClick((TObject*)BtnEdit); } //--------------------------------------------------------------------------- void __fastcall TIDB0040M::BtnEditClick(TObject *Sender) { TcxGridTableView *TvList = FRAMERoadList1->TvList; TcxDataController *m_pGDC = TvList->DataController; if (TvList->ViewData->RecordCount <= 0) return; int nRow = m_pGDC->FocusedRecordIndex; if( nRow < 0 ) return; String sId = m_pGDC->Values[nRow][FRAMERoadList1->Column01->Index]; //ID String sNm = m_pGDC->Values[nRow][FRAMERoadList1->Column02->Index]; //¸íĪ String sStNm = m_pGDC->Values[nRow][FRAMERoadList1->Column11->Index]; //½ÃÁ¡¸í String sEdNm = m_pGDC->Values[nRow][FRAMERoadList1->Column12->Index]; //Á¾Á¡¸í try { TIDB00401 *pDlg = new TIDB00401(this); pDlg->EdId->Text = sId; pDlg->EdNm->Text = sNm; pDlg->EdStNm->Text = sStNm; pDlg->EdEdNm->Text = sEdNm; pDlg->ShowModal(); if (pDlg->FUpdated) { sNm = pDlg->EdNm->Text.Trim(); sStNm = pDlg->EdStNm->Text.Trim(); sEdNm = pDlg->EdEdNm->Text.Trim(); m_pGDC->Values[nRow][FRAMERoadList1->Column02->Index] = sNm; m_pGDC->Values[nRow][FRAMERoadList1->Column11->Index] = sStNm; m_pGDC->Values[nRow][FRAMERoadList1->Column12->Index] = sEdNm; int nMemPtr = m_pGDC->Values[nRow][FRAMERoadList1->Column18->Index]; TItsRoad *pObj = (TItsRoad*)nMemPtr; pObj->ROAD_NM = sNm; pObj->STRT_NM = sStNm; pObj->END_NM = sEdNm; } delete pDlg; } catch(...) { } } //---------------------------------------------------------------------------