//---------------------------------------------------------------------------

#ifndef FRAME_IncidentRegistFH
#define FRAME_IncidentRegistFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "CDSCodeF.h"
#include "CDSIncidentF.h"
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include "cxButtons.hpp"
#include "cxCalc.hpp"
#include "cxCalendar.hpp"
#include "cxClasses.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDropDownEdit.hpp"
#include "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxGroupBox.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxMaskEdit.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinMcSkin.hpp"
//---------------------------------------------------------------------------
class TFRAMEIncidentRegist : public TFrame
{
__published:	// IDE-managed Components
    TcxGroupBox *cxGroupBox1;
    TcxGroupBox *cxGroupBox2;
    TcxSplitter *cxSplitter1;
    TPanel *PnlBottom;
    TLabel *LblRecords;
    TcxButton *BtnExlSave;
    TPanel *PnlTitle;
    TcxGroupBox *cxGroupBox3;
    TPanel *Panel1;
    TcxButton *BtnSave;
    TcxGroupBox *cxGroupBox4;
    TImage *ImgDesc01;
    TcxLabel *cxLabel1;
    TcxTextEdit *EdINCD_OCRR_ID;
    TcxLabel *cxLabel2;
    TImage *ImgDesc02;
    TcxTextEdit *EdRGST_DT;
    TcxLabel *cxLabel3;
    TImage *ImgDesc03;
    TcxComboBox *CbINCD_ORGN_CD;
    TImage *ImgDesc04;
    TcxLabel *cxLabel4;
    TcxTextEdit *EdOCRR_LCTN_NM;
    TcxLabel *cxLabel5;
    TImage *ImgDesc05;
    TcxTextEdit *EdINCD_EXPL;
    TcxLabel *cxLabel6;
    TImage *ImgDesc06;
    TcxComboBox *CbCMTR_GRAD_CD;
    TcxGroupBox *cxGroupBox5;
    TImage *ImgDesc07;
    TImage *ImgDesc08;
    TImage *ImgDesc09;
    TcxLabel *cxLabel7;
    TcxLabel *cxLabel8;
    TcxLabel *cxLabel9;
    TcxLabel *cxLabel10;
    TcxLabel *cxLabel11;
    TcxLabel *cxLabel12;
    TcxLabel *cxLabel13;
    TcxTextEdit *EdIFMR_NM;
    TcxComboBox *CbINCD_CNFM_MTHD_CD;
    TcxComboBox *CbINCD_SERN_CD;
    TcxLabel *cxLabel14;
    TImage *ImgDesc10;
    TcxLabel *cxLabel15;
    TImage *ImgDesc11;
    TcxComboBox *CbINCD_TYPE_CLSF_CD;
    TcxComboBox *CbINCD_TYPE_CD;
    TImage *ImgDesc12;
    TImage *ImgDesc13;
    TImage *ImgDesc14;
    TcxLabel *cxLabel16;
    TcxLabel *cxLabel17;
    TcxLabel *cxLabel18;
    TcxDateEdit *DtINCD_CNFM_DT;
    TcxDateEdit *DtINCD_STRT_DT;
    TcxDateEdit *DtINCD_END_PRAR_DT;
    TcxLabel *cxLabel19;
    TLabel *LbDef;
    TImage *ImgDesc17;
    TcxLabel *cxLabel27;
    TcxTextEdit *EdINCD_TITL;
    TcxLabel *cxLabel29;
    TcxPageControl *cxPageControl1;
    TcxTabSheet *cxTabSheet1;
    TcxTabSheet *cxTabSheet2;
    TcxGrid *CxList2;
    TcxGridTableView *TvList2;
    TcxGridColumn *ColumnA01;
    TcxGridColumn *ColumnA02;
    TcxGridColumn *ColumnA03;
    TcxGridColumn *ColumnA04;
    TcxGridColumn *ColumnA05;
    TcxGridColumn *ColumnA99;
    TcxGridColumn *ColumnA06;
    TcxGridColumn *ColumnA07;
    TcxGridColumn *ColumnA08;
    TcxGridColumn *ColumnA09;
    TcxGridLevel *GlList2;
    TcxGrid *CxList;
    TcxGridTableView *TvList;
    TcxGridColumn *Column01;
    TcxGridColumn *Column02;
    TcxGridColumn *Column04;
    TcxGridColumn *Column03;
    TcxGridColumn *Column05;
    TcxGridColumn *Column09;
    TcxGridColumn *Column10;
    TcxGridColumn *Column11;
    TcxGridColumn *Column12;
    TcxGridColumn *Column13;
    TcxGridColumn *Column15;
    TcxGridColumn *Column16;
    TcxGridColumn *Column35;
    TcxGridColumn *Column17;
    TcxGridColumn *Column18;
    TcxGridColumn *Column14;
    TcxGridColumn *Column06;
    TcxGridColumn *Column07;
    TcxGridColumn *Column08;
    TcxGridColumn *Column19;
    TcxGridColumn *Column20;
    TcxGridColumn *Column21;
    TcxGridColumn *Column22;
    TcxGridColumn *Column23;
    TcxGridColumn *Column24;
    TcxGridColumn *Column25;
    TcxGridColumn *Column26;
    TcxGridColumn *Column27;
    TcxGridColumn *Column28;
    TcxGridColumn *Column29;
    TcxGridColumn *Column30;
    TcxGridColumn *Column31;
    TcxGridColumn *Column32;
    TcxGridColumn *Column33;
    TcxGridColumn *Column34;
    TcxGridColumn *Column99;
    TcxGridLevel *GlList;
    TcxTextEdit *EdLinkId;
    TcxTextEdit *EdRegDt;
    TcxButton *BtnMissInfo;
    TcxButton *BtnNew;
    TcxButton *BtnMoveGis;
    TcxLabel *lblFileName;
    TcxLabel *lblFileName1;
    void __fastcall TvListDataControllerFilterChanged(TObject *Sender);
    void __fastcall BtnExlSaveClick(TObject *Sender);
    void __fastcall CbINCD_TYPE_CLSF_CDClick(TObject *Sender);
    void __fastcall BtnSaveClick(TObject *Sender);
    void __fastcall TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton,
          TShiftState AShift, bool &AHandled);
    void __fastcall TvList2CellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton,
          TShiftState AShift, bool &AHandled);
    void __fastcall BtnNewClick(TObject *Sender);
    void __fastcall BtnMissInfoClick(TObject *Sender);
    void __fastcall BtnMoveGisClick(TObject *Sender);
    void __fastcall cxPageControl1PageChanging(TObject *Sender, TcxTabSheet *NewPage,
          bool &AllowChange);
private:	// User declarations
    //TcxDataController *m_pGDC;
    String             FTitle;
    int                FOcrrType;
    String             FIncidentId;

    TItsCode   *FCodeIST;	//돌발상황 원본 코드 : IST
    TItsCode   *FCodeLTCU;	//소통 등급 코드 : LTCU
    TItsCode   *FCodeICM;	//돌발상황 확인 방법 코드 : ICM
    TItsCode   *FCodeIDTU;	//돌발상황 유형 분류 코드 : IDTU

    TItsCode   *FCodeACTU;	//돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
    TItsCode   *FCodeCRTU;	//돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
    TItsCode   *FCodeEVTU;	//돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
    TItsCode   *FCodeWETU;	//돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
    TItsCode   *FCodeCNTU;	//돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
    TItsCode   *FCodeCATU;	//돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나

    TItsCode   *FCodeSRLU;	//돌발상황 심각도 코드 : SRLU
    TItsCode   *FCodePRTU;	//통행 제한 유형 코드 : PRTU
    TItsCode   *FCodeRSL;	//대응 수준 코드 : RSL
    TItsCode   *FCodeISS;	//돌발상황 진행 단계 코드 : ISS
    //TItsCode   *FCodeICM;	//돌발상황 종료 확인 방법 코드 : ICM
    TItsCode   *FCodeDFW;	//기상 코드 : DFW
    TItsCode   *FCodeVIT;	//VMS 돌발 유형 코드 : VIT
    TItsCode   *FCodeIDT;	//VMS 돌발 유형 세부 코드 : IDT
    TItsCode   *FCodeEDT;	//VMS 돌발 유형 세부 코드 : EDT

public:
    String  FINCD_OCRR_ID;
    bool    FInsert;

    void __fastcall InitForm();
    void __fastcall UpdateList();
    bool __fastcall InsertToDb(String AINCD_OCRR_ID,      //돌발ID
                               String AINCD_ORGN_CD,      //돌발상황 원본 코드 : IST
                               String AOCRR_LCTN_NM,      //발생 위치 명
                               String AINCD_EXPL,         //돌발상황 설명
                               String ACMTR_GRAD_CD,      //소통 등급 코드 : LTCU
                               String AIFMR_NM,           //제보자 명
                               String AINCD_CNFM_MTHD_CD, //돌발상황 확인 방법 코드 : ICM
                               String AINCD_SERN_CD,      //돌발상황 심각도 코드 : SRLU
                               String AINCD_TYPE_CLSF_CD, //돌발상황 유형 분류 코드 : IDTU
                               String AINCD_TYPE_CD,      //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
                               String AINCD_CNFM_DT,      //돌발상황 확인 일시
                               String AINCD_STRT_DT,      //돌발상황 시작 일시
                               String AINCD_END_PRAR_DT,  //돌발상황 종료 예정 일시
                               String AINCD_TITL);        //돌발제목
    bool __fastcall UpdateToDb(String AINCD_OCRR_ID,      //돌발ID
                               String AINCD_ORGN_CD,      //돌발상황 원본 코드 : IST
                               String AOCRR_LCTN_NM,      //발생 위치 명
                               String AINCD_EXPL,         //돌발상황 설명
                               String ACMTR_GRAD_CD,      //소통 등급 코드 : LTCU
                               String AIFMR_NM,           //제보자 명
                               String AINCD_CNFM_MTHD_CD, //돌발상황 확인 방법 코드 : ICM
                               String AINCD_SERN_CD,      //돌발상황 심각도 코드 : SRLU
                               String AINCD_TYPE_CLSF_CD, //돌발상황 유형 분류 코드 : IDTU
                               String AINCD_TYPE_CD,      //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
                               String AINCD_CNFM_DT,      //돌발상황 확인 일시
                               String AINCD_STRT_DT,      //돌발상황 시작 일시
                               String AINCD_END_PRAR_DT,  //돌발상황 종료 예정 일시
                               String AINCD_TITL);        //돌발제목

    void __fastcall InitScreen();
    void __fastcall UpdateAutoList();
    bool __fastcall UpdateMissIncident(String AINCD_OCRR_ID);
    bool __fastcall UpdateAutoIncident(String ALINK_ID, String ARGST_DT, String AREAL_YN);

public:		// User declarations
    __fastcall TFRAMEIncidentRegist(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFRAMEIncidentRegist *FRAMEIncidentRegist;
//---------------------------------------------------------------------------
#endif

