123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "CDSFacilityF.h"
- #include "CDSCompanyF.h"
- #include "FrmResourceF.h"
- #include "ITSLangTransF.h"
- #include "CDSLayerF.h"
- #pragma hdrstop
- #include "FRAME_UnRegFacilityListF.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "cxButtons"
- #pragma link "cxCalc"
- #pragma link "cxCheckBox"
- #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 "cxTextEdit"
- #pragma link "dxSkinBlack"
- #pragma link "dxSkinBlue"
- #pragma link "dxSkinsCore"
- #pragma link "dxSkinscxPCPainter"
- #pragma link "cxContainer"
- #pragma link "dxSkinMcSkin"
- #pragma resource "*.dfm"
- //---------------------------------------------------------------------------
- __fastcall TFRAMEUnRegFacilityList::TFRAMEUnRegFacilityList(TComponent* Owner)
- : TFrame(Owner)
- {
- LangTrans->Translate(this, ITSDb_GetConnection());
- ColumnSel->Options->Filtering = false;
- m_pGDC = TvList->DataController;
- LangTrans->Translate(this, ITSDb_GetConnection());
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEUnRegFacilityList::UpdateList()
- {
- CMM_ClearGridTableView(TvList);
- TItsLayer *pLayer;
- int nRow = 0;
- try
- {
- TvList->BeginUpdate();
- try
- {
- ItsFacilityManager->FRegLists.Lock();
- FOR_STL(TItsRegFacility*, pObj, ItsFacilityManager->FRegLists)
- {
- if (pObj->UnRegisterd == "N") continue;
- nRow = m_pGDC->AppendRecord();
- pObj->GridIndex = nRow;
- m_pGDC->Values[nRow][ColumnSel->Index] = true; //선택
- pLayer = ItsLayerManager->FLists.Find(pObj->Type);
- if (pLayer)
- {
- m_pGDC->Values[nRow][Column01->Index] = pLayer->Name; // FCLT_TYPE VARCHAR(7 BYTE) NOT NULL, '시설물유형';
- }
- else
- {
- m_pGDC->Values[nRow][Column01->Index] = pObj->Type;
- }
- m_pGDC->Values[nRow][Column02->Index] = pObj->Id;
- m_pGDC->Values[nRow][Column03->Index] = pObj->Name;
- m_pGDC->Values[nRow][Column99->Index] = (int)pObj;
- }
- }
- __finally
- {
- ItsFacilityManager->FRegLists.UnLock();
- }
- }
- __finally
- {
- LblRecords->Caption = "("+FormatFloat("##,##0", m_pGDC->FilteredRecordCount) +"/"+FormatFloat("##,##0", m_pGDC->RecordCount) + ")";
- TvList->EndUpdate();
- TvList->DataController->GotoFirst();
- TvList->DataController->FocusedRecordIndex = 0;
- //CxList->SetFocus();
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEUnRegFacilityList::BtnAllSelectClick(TObject *Sender)
- {
- TcxButton *pBtn = (TcxButton*)Sender;
- CMM_CheckAllListItem(TvList, ColumnSel->Index, pBtn->Tag);
- }
- //---------------------------------------------------------------------------
- int __fastcall TFRAMEUnRegFacilityList::GetSelectIds(String &ALinkIds)
- {
- ALinkIds = "";
- if (TvList->ViewData->RecordCount <= 0) return 0;
- int nIndex = m_pGDC->FocusedRecordIndex;
- if( nIndex < 0 )
- return 0;
- String sLinkId = VarToStr(m_pGDC->Values[nIndex][Column01->Index]);
- ALinkIds = sLinkId;
- return 1;
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEUnRegFacilityList::TvListDataControllerFilterChanged(TObject *Sender)
- {
- CMM_SetFilterLike(TvList);
- LblRecords->Caption = "("+FormatFloat("##,##0", m_pGDC->FilteredRecordCount) +"/"+FormatFloat("##,##0", m_pGDC->RecordCount) + ")";
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEUnRegFacilityList::BtnExlSaveClick(TObject *Sender)
- {
- TcxGrid *pGrid = CxList;
- TcxGridTableView *pView = TvList;
- String sTitle= lblTitle->Caption;//"미등록시설물정보";
- CMM_ExportToExcelFile(sTitle, pGrid, pView, (TForm*)this);
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEUnRegFacilityList::TvListMouseMove(TObject *Sender, TShiftState Shift, int X, int Y)
- {
- try
- {
- TcxGridSite *ASite = (TcxGridSite *)Sender;
- //Screen->Cursor = crDefault;
- //TcxCustomGridHitTest *AHitTest = tvSel->GetHitTest(X, Y);
- TcxCustomGridHitTest *AHitTest = dynamic_cast<TcxGridRecordHitTest*>(ASite->ViewInfo->GetHitTest(X, Y));
- if (dynamic_cast<TcxGridRecordHitTest*>(ASite->ViewInfo->GetHitTest(X, Y)))
- {
- int ARow = ((TcxGridRecordCellHitTest*)AHitTest)->GridRecord->Index;
- if (((TcxGridRecordCellHitTest*)AHitTest)->Item == NULL) return;
- int ACol = ((TcxGridRecordCellHitTest*)AHitTest)->Item->Index;
- if (ACol == ColumnSel->Index &&
- ARow < ASite->GridView->DataController->RecordCount-1)
- {
- Screen->Cursor = crHandPoint;
- }
- }
- else
- {
- Screen->Cursor = crDefault;
- }
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
|