//--------------------------------------------------------------------------- #include #pragma hdrstop #include "AppGlobalF.h" #include "ITSDbF.h" #include "ITSUtilF.h" #include "CDSCodeF.h" #include //--------------------------------------------------------------------------- #pragma package(smart_init) //--------------------------------------------------------------------------- int g_nPid = -1; // Application Process ID String g_sAppDir = ""; // Application Directory String g_sAppName= ""; // Program name String g_sCfgDir = ""; // Config File Directory String g_sLogDir = ""; // Program Log Directory String g_sTempDir = ""; // Program Temp Directory String g_sFormsDir = ""; // Program Forms Directory String g_sBlackBox = ""; String g_sLangDir = ""; String g_sImageDir = ""; String g_sVideoDir = ""; String g_sMapDir = ""; APP_CONFIG g_AppCfg; LOG_INFO g_LogCfg; TITSLog *ITSLog = NULL; String g_sLang = "kr"; String g_IniFileDir = ""; String g_IniFileName = "Option"; bool g_bControlAuth = true; //--------------------------------------------------------------------------- bool CheckApplicationParam() { int nArgs = ParamCount(); if (nArgs != 2) { return false; } g_AppCfg.MAGIC_ID = ParamStr(1); g_AppCfg.OPER_ID = ParamStr(2); g_AppCfg.OPER_ID = g_AppCfg.OPER_ID.SubString(1, 10); if (g_AppCfg.MAGIC_ID.UpperCase() != "ICAIR") { return false; } return true; } //--------------------------------------------------------------------------- void ActiveProgram(String AClassName, String ATitle) { //String AClassName = "TFrmVmsFormEdit"; //String ATitle = g_AppCfg.sTitle + " - Active"; HWND hExeForm = FindWindow(AClassName.c_str(), ATitle.c_str()); if (hExeForm) { bool bResult = SetWindowPos(hExeForm, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); if (bResult) { bResult = ShowWindow(hExeForm, SW_RESTORE); SetForegroundWindow(hExeForm); } } } //--------------------------------------------------------------------------- bool ApplicationSingleRun(String AClassName, String ATitle) { HANDLE hMutex; try { String sLockFile = ChangeFileExt(ExtractFileName(Application->ExeName), ".lock"); String sProgMutexNm = "ICAIR_" + sLockFile; if ((hMutex=OpenMutex(MUTEX_ALL_ACCESS, false, sProgMutexNm.c_str()))==NULL) hMutex = CreateMutex(NULL, true, sProgMutexNm.c_str()); else { ActiveProgram(AClassName, ATitle); return false; } } catch (Exception &exception) { Application->ShowException(&exception); return false; } return true; } //--------------------------------------------------------------------------- void LoadIcon(TIniFile* AIniFile, String ASection, String AItem, String& AValue) { try { AValue = AIniFile->ReadString(ASection, AItem, ""); if (AValue != "") { AValue = g_sAppDir + "Image\\" + AValue; if (!FileExists(AValue)) AValue = ""; } } catch(Exception &e) { } } //--------------------------------------------------------------------------- #include #include #pragma comment (lib, "shlwapi.lib") bool IsDirectoryExists(LPCTSTR path) { return PathFileExists(path); #if 0 struct _stat buffer; int iRetTemp = 0; memset((void*)&buffer, 0, sizeof(buffer)); iRetTemp = _stat(path, &buffer); if (iRetTemp == 0) { if (buffer.st_mode & _S_IFDIR) { return true; } } return false; #endif } //--------------------------------------------------------------------------- bool LoadDefaultConfigInfo(String ACfgFile/*=""*/) { String sCfgFile; TIniFile *pIniFile = NULL; String sIniFile = ACfgFile + ".ini"; sCfgFile = g_sCfgDir + sIniFile; g_AppCfg.sConfigFile = sCfgFile; pIniFile = new TIniFile(sCfgFile); try { g_AppCfg.sLang = "kr"; g_sLang = g_AppCfg.sLang; g_AppCfg.sLogDay = pIniFile->ReadString("VMS", "LOGDAY", ""); g_AppCfg.sSkinName = pIniFile->ReadString("VMS", "SKINNAME", "Silver"); g_AppCfg.bSaveForm = pIniFile->ReadString("VMS", "SAVEFORM", "0").ToIntDef(1) == 1 ? true : false; g_AppCfg.isDispOfflineMsg = pIniFile->ReadString("VMS", "DISPOFFLINEMSG", "1").ToIntDef(1) == 1 ? true : false; g_AppCfg.itsdb.bSqlLog = pIniFile->ReadString("DB", "SQLLOG", "0").ToIntDef(0) == 1 ? true : false; g_AppCfg.itsdb.sConnectStr = pIniFile->ReadString("DB", "CONNECTSTR", ""); if (g_AppCfg.itsdb.sConnectStr == "") { g_AppCfg.itsdb.sProvider = pIniFile->ReadString("DB", "PROVIDER", "OraOLEDB.Oracle.1"); //g_AppCfg.itsdb.sProvider = pIniFile->ReadString("DB", "PROVIDER", "MSDAORA.1"); g_AppCfg.itsdb.sServerName = pIniFile->ReadString("DB", "NAME", "ORCL"); g_AppCfg.itsdb.sUserName = pIniFile->ReadString("DB", "USER", "ICAIR"); g_AppCfg.itsdb.sPassword = pIniFile->ReadString("DB", "PASS", "ICAIR"); } //VMS FTP g_AppCfg.vmsFtp.SERVER = pIniFile->ReadString("VMS_FTP", "SERVER", ""); g_AppCfg.vmsFtp.PORT = pIniFile->ReadString("VMS_FTP", "PORT", "21").ToIntDef(21); g_AppCfg.vmsFtp.USER = pIniFile->ReadString("VMS_FTP", "USER", ""); g_AppCfg.vmsFtp.PSWD = pIniFile->ReadString("VMS_FTP", "PSWD", ""); g_AppCfg.vmsFtp.PASSIVE = pIniFile->ReadString("VMS_FTP", "PASSIVE", "0").ToIntDef(0) == 0 ? false : true; } __finally { if (pIniFile) delete pIniFile; pIniFile = NULL; //WriteConfigInfo(g_AppCfg.sConfigFile, "AUTOLOGOUT", "LOGOUTEXIT", "0"); } return true; } //--------------------------------------------------------------------------- /* * ȯ°æ¼³Á¤ Á¤º¸¸¦ ÀúÀåÇÏ´Â ÇÔ¼ö. * arguments * String : RegisterKey ¶Ç´Â ÆÄÀÏÀ̸§ * return * bool : ½ÇÆÐÇϸé false */ bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue) { String ConfigFile; TIniFile *pIniFile = NULL; ConfigFile = sCfgFile; try { pIniFile = new TIniFile(ConfigFile); if (pIniFile == NULL) { return false; } pIniFile->WriteString(sTitle, sItem, sValue); } catch(...) { } if (pIniFile) { pIniFile->Free(); pIniFile = NULL; } return true; } //--------------------------------------------------------------------------- /* * ȯ°æ¼³Á¤ Á¤º¸¸¦ Àоî¿À´Â ÇÔ¼ö. * arguments * String : RegisterKey ¶Ç´Â ÆÄÀÏÀ̸§ * return * bool : ½ÇÆÐÇϸé false */ bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue) { bool bRes; String ConfigFile; TIniFile *pIniFile = NULL; bRes = false; ConfigFile = sCfgFile; try { pIniFile = new TIniFile(ConfigFile); if (pIniFile == NULL) { return bRes; } sValue = pIniFile->ReadString(sTitle, sItem, ""); if (sValue != "") { bRes = true; } } catch(...) { } if (pIniFile) { pIniFile->Free(); pIniFile = NULL; } return bRes; } //--------------------------------------------------------------------------- void ShowErrorMsg(String ATitle, String AErrMsg) { Application->NormalizeTopMosts(); Application->MessageBox(AErrMsg.c_str(), ATitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL); Application->RestoreTopMosts(); } //---------------------------------------------------------------------------- String APP_FillCode(TcxComboBox *ACombo, String ACode) { String sReturn = ""; if (SysCodeManager == NULL) { SysCodeManager = new TSysCodeManager(); SysCodeManager->LoadFromDb(); } TNotifyEvent evt = ACombo->Properties->OnChange; ACombo->Properties->OnChange = NULL; ACombo->Properties->Items->Clear(); TSysClssCode *pSysClssCd = SysCodeManager->FLists.Find(ACode); if (pSysClssCd) { FOR_STL(TSysCode *, pSubCode, pSysClssCd->FLists) { if (pSubCode->USE_YN == "N") continue; ACombo->Properties->Items->Add(" [" + pSubCode->CODE_NO + "] " + pSubCode->CD_NM); if (sReturn == "") { sReturn = " [" + pSubCode->CODE_NO + "] " + pSubCode->CD_NM; } } } ACombo->ItemIndex = 0; ACombo->Properties->OnChange = evt; return sReturn; } //---------------------------------------------------------------------------- String APP_GetCode(TcxComboBox *ACombo) { String sReturn = ""; if (ACombo->ItemIndex >= 0) { String sDesc = ACombo->Properties->Items->Strings[ACombo->ItemIndex]; String sCode = sDesc.SubString(sDesc.Pos("[") + 1, sDesc.Pos("]") - (sDesc.Pos("[") + 1)); sReturn = sCode; } return sReturn; } //---------------------------------------------------------------------------- String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode) { String sReturn = ""; for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++) { String sDesc = ACombo->Properties->Items->Strings[ii]; String sCode = sDesc.SubString(sDesc.Pos("[") + 1, sDesc.Pos("]") - (sDesc.Pos("[") + 1)); if (ACode == sCode) { sReturn = sDesc; break; } } return sReturn; } //---------------------------------------------------------------------------- String APP_GetCodeName(TcxComboBox *ACombo) { String sReturn = ""; if (ACombo->ItemIndex >= 0) { String sDesc = ACombo->Properties->Items->Strings[ACombo->ItemIndex]; String sName = sDesc.SubString(sDesc.Pos("]") + 1, sDesc.Length()); sReturn = sName.Trim(); } return sReturn; } //---------------------------------------------------------------------------- String APP_GetCodeName(TcxComboBox *ACombo, String ACode) { String sReturn = ""; for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++) { String sDesc = ACombo->Properties->Items->Strings[ii]; String sName = sDesc.SubString(sDesc.Pos("]") + 1, sDesc.Length()); String sCode = sDesc.SubString(sDesc.Pos("[") + 1, sDesc.Pos("]") - (sDesc.Pos("[") + 1)); if (ACode == sCode) { sReturn = sName.Trim(); break; } } return sReturn; } //---------------------------------------------------------------------------- String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName) { String sReturn = "3"; for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++) { String sDesc = ACombo->Properties->Items->Strings[ii]; String sName = sDesc.SubString(sDesc.Pos("]") + 1, sDesc.Length()); String sCode = sDesc.SubString(sDesc.Pos("[") + 1, sDesc.Pos("]") - (sDesc.Pos("[") + 1)); if (sName.Trim() == AName.Trim()) { sReturn = sCode; break; } } return sReturn; } //---------------------------------------------------------------------------- String APP_GetCodeDefCode(TcxComboBox *ACombo) { String sReturn = ""; if (ACombo->Properties->Items->Count > 0) { String sDesc = ACombo->Properties->Items->Strings[0]; String sCode = sDesc.SubString(sDesc.Pos("[") + 1, sDesc.Pos("]") - (sDesc.Pos("[") + 1)); sReturn = sCode; } return sReturn; } //---------------------------------------------------------------------------- String APP_GetCodeDefDesc(TcxComboBox *ACombo) { String sReturn = ""; if (ACombo->Properties->Items->Count > 0) { String sDesc = ACombo->Properties->Items->Strings[0]; sReturn = sDesc; } return sReturn; } //---------------------------------------------------------------------------- int APP_SetCode(TcxComboBox *ACombo, String ACode) { int nItemIndex = -1; for (int ii = 0; ii < ACombo->Properties->Items->Count; ii++) { String sDesc = ACombo->Properties->Items->Strings[ii]; String sCode = sDesc.SubString(sDesc.Pos("[") + 1, sDesc.Pos("]") - (sDesc.Pos("[") + 1)); if (ACode == sCode) { nItemIndex = ii; break; } } ACombo->ItemIndex = nItemIndex; return nItemIndex; } //---------------------------------------------------------------------------- ULONG ProcIDFromWnd(HWND hwnd) // À©µµ¿ì ÇÚµé·Î ÇÁ·Î¼¼½º ¾ÆÀ̵ð ¾ò±â { ULONG idProc; GetWindowThreadProcessId( hwnd, &idProc ); return idProc; } //---------------------------------------------------------------------------- HWND GetWinHandle(ULONG pid) // ÇÁ·Î¼¼½º ¾ÆÀ̵ð·Î À©µµ¿ì ÇÚµé ¾ò±â { HWND tempHwnd = FindWindow(NULL,NULL); // ÃÖ»óÀ§ À©µµ¿ì ÇÚµé ã±â while( tempHwnd != NULL ) { if( GetParent(tempHwnd) == NULL ) // ÃÖ»óÀ§ ÇÚµéÀÎÁö üũ, ¹öư µîµµ ÇÚµéÀ» °¡Áú ¼ö ÀÖÀ¸¹Ç·Î ¹«½ÃÇϱâ À§ÇØ if( pid == ProcIDFromWnd(tempHwnd) ) return tempHwnd; tempHwnd = GetWindow(tempHwnd, GW_HWNDNEXT); // ´ÙÀ½ À©µµ¿ì ÇÚµé ã±â } return NULL; } //---------------------------------------------------------------------------- TColor g_DispColor[MAX_DISPCOLOR]; void APP_InitDisplayColor() { #if 0 g_DispColor[ 0] = Graphics::clBlue; g_DispColor[ 1] = Graphics::clRed; g_DispColor[ 2] = Graphics::clLime; g_DispColor[ 3] = Graphics::clMaroon; g_DispColor[ 4] = Graphics::clGreen; g_DispColor[ 5] = Graphics::clMenuHighlight; g_DispColor[ 6] = Graphics::clBackground; g_DispColor[ 7] = Graphics::clPurple; g_DispColor[ 8] = Graphics::clTeal; g_DispColor[ 9] = Graphics::clYellow; g_DispColor[10] = Graphics::clFuchsia; g_DispColor[11] = Graphics::clAqua; g_DispColor[12] = Graphics::clMoneyGreen; g_DispColor[13] = Graphics::clSkyBlue; g_DispColor[14] = Graphics::clRed; g_DispColor[15] = Graphics::clLime; g_DispColor[16] = Graphics::clYellow; g_DispColor[17] = Graphics::clBlue; g_DispColor[18] = Graphics::clFuchsia; g_DispColor[19] = Graphics::clAqua; g_DispColor[20] = Graphics::clMoneyGreen; g_DispColor[21] = Graphics::clActiveCaption; #else g_DispColor[ 0] = Graphics::clLime; g_DispColor[ 1] = (TColor)RGB(0xFF, 0x00, 0x00); g_DispColor[ 2] = (TColor)RGB(0x00, 0x00, 0xFF); g_DispColor[ 3] = (TColor)RGB(0xFF, 0x82, 0x00); g_DispColor[ 4] = (TColor)RGB(0x94, 0x00, 0xD3); g_DispColor[ 5] = Graphics::clPurple;//(TColor)RGB(0x00, 0x00, 0x00); g_DispColor[ 6] = (TColor)RGB(0x82, 0x82, 0x82); g_DispColor[ 7] = (TColor)RGB(0x1E, 0x90, 0xFF); g_DispColor[ 8] = (TColor)RGB(0xB9, 0x06, 0x2F); g_DispColor[ 9] = (TColor)RGB(0x8c, 0x00, 0x8c); g_DispColor[10] = (TColor)RGB(0xFF, 0x82, 0x00); g_DispColor[11] = (TColor)RGB(0x94, 0x00, 0xD3); g_DispColor[12] = (TColor)RGB(0xB0, 0xC4, 0xDE); g_DispColor[13] = (TColor)RGB(0x00, 0xBF, 0xFF); g_DispColor[14] = (TColor)RGB(0x87, 0xCE, 0xEB); g_DispColor[15] = (TColor)RGB(0x87, 0xCE, 0xFA); g_DispColor[16] = (TColor)RGB(0xAD, 0xD8, 0xE6); g_DispColor[17] = (TColor)RGB(0xB0, 0xE0, 0xE6); g_DispColor[18] = (TColor)RGB(0xE6, 0xE6, 0xFA); g_DispColor[19] = (TColor)RGB(0xF0, 0xF8, 0xFF); #endif } //--------------------------------------------------------------------------- TColor APP_GetDisplayColor(int ASeq) { return g_DispColor[ASeq % MAX_DISPCOLOR]; } //--------------------------------------------------------------------------- void APP_DelVmsSizeCombo(TcxComboBox *cboBox) { TStrings *pStrItems; TVmsSizeType *Ov; pStrItems = ((TcxComboBox *)cboBox)->Properties->Items; for (int ii = pStrItems->Count-1; ii >= 0; ii--) { Ov = (TVmsSizeType *)pStrItems->Objects[ii]; if (Ov != NULL) { delete Ov; Ov = NULL; } } } //--------------------------------------------------------------------------- void APP_FillVmsSizeType(TcxComboBox *cboBox, bool bAddAll/*=false*/) { String sQry; TStrings *pStrItems; TADOQuery *pADO = NULL; if (!VmsTypeManager) { VmsTypeManager = new TVmsTypeManager(); VmsTypeManager->LoadFromDb(); } TNotifyEvent evt = cboBox->Properties->OnChange; cboBox->Properties->OnChange = NULL; APP_DelVmsSizeCombo(cboBox); pStrItems = ((TcxComboBox *)cboBox)->Properties->Items; ((TcxComboBox *)cboBox)->Properties->Items->Clear(); FOR_STL(TVmsType*, pObj, VmsTypeManager->FLists) { String sTypeCd = pObj->VMS_MODL_KIND; String sTypeNm = pObj->VMS_MODL_KIND_NM; int nW = pObj->VMS_WDTH; int nH = pObj->VMS_HGHT; int nR = pObj->VMS_MODL_ROW; int nC = pObj->VMS_MODL_COL; pStrItems->AddObject(" [" + sTypeCd + "] " + sTypeNm + " (" + String(nH) + "*" + String(nW) + ")", new TVmsSizeType(sTypeCd, sTypeNm, nW, nH, nR, nC) ); } if (bAddAll) { String sAllName = "Àüü"; pStrItems->AddObject(" [ALL] Àüü" , new TVmsSizeType("ALL", sAllName, 384, 64, 2, 12)); } cboBox->ItemIndex = 0; cboBox->Properties->OnChange = evt; } //--------------------------------------------------------------------------- TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox) { TStrings *pStrItems; TVmsSizeType *Ov = NULL; int nItemIndex; pStrItems = ((TcxComboBox *)cboBox)->Properties->Items; nItemIndex= ((TcxComboBox *)cboBox)->ItemIndex; if (nItemIndex < 0) { return Ov; } Ov = (TVmsSizeType *)pStrItems->Objects[nItemIndex]; if (Ov == NULL) { Ov = NULL; } return Ov; } //--------------------------------------------------------------------------- void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color) { try { c->Pen->Color = clWhite; c->Pen->Width = 0; c->Pen->Style = psClear; c->Brush->Style = bsSolid; c->Brush->Color = color; c->Rectangle(offX, offY, w+offX+2, h+offY+2); } catch(...) { } } //--------------------------------------------------------------------------- #include TDateTime APP_StrToDateTime(String AStrDateTime) { TDateTime dtReturnValue = NULL; if (AStrDateTime.IsEmpty()) return dtReturnValue; if (AStrDateTime.Length() != 14) return dtReturnValue; AnsiString sDateTime = AnsiString(AStrDateTime); try { #if 0 sDateTime.printf(L"%s-%s-%s %s:%s:%s", AStrDateTime.SubString( 1, 4).c_str(), AStrDateTime.SubString( 5, 2).c_str(), AStrDateTime.SubString( 7, 2).c_str(), AStrDateTime.SubString( 9, 2).c_str(), AStrDateTime.SubString(11, 2).c_str(), AStrDateTime.SubString(13, 2).c_str()); dtReturnValue = StrToDateTime(sDateTime); #endif // swscanf(sRgb.c_str(), L"%d,%d,%d", &r, &g, &b); int year, month, day, hour, minute, second; sscanf(sDateTime.c_str(), "%4d%2d%2d%2d%2d%2d", &year, &month, &day, &hour, &minute, &second); dtReturnValue = EncodeDateTime(year, month, day, hour, minute, second, 0); } catch(...) { } return dtReturnValue; } //--------------------------------------------------------------------------- #include bool APP_CheckBmpFile(String AInFileName, String &AOutFileName) { String sFilePath = ExtractFilePath(AInFileName); String sFileName = ExtractFileName(AInFileName); String sFileExt = ExtractFileExt(AInFileName); AOutFileName = AInFileName; if (sFileExt.UpperCase() == ".BMP") { return true; } AOutFileName = AInFileName + ".bmp"; TImage *Image1 = new TImage(NULL); TMemoryStream *pImgStream = new TMemoryStream(); try { try { pImgStream->LoadFromFile(AInFileName); sFileExt = sFileExt.UpperCase(); if (sFileExt == ".PNG") { TdxPNGImage *img = new TdxPNGImage; img->LoadFromStream(pImgStream); Image1->Picture->Bitmap->Assign(img); Image1->Picture->Bitmap->PixelFormat = pf24bit; Image1->Picture->Bitmap->SaveToFile(AOutFileName); SAFE_DELETE(img); return true; } else if (sFileExt == ".JPG" || sFileExt == ".JPEG") { TJPEGImage *img = new TJPEGImage(); img->LoadFromStream(pImgStream); Image1->Picture->Bitmap->Assign(img); Image1->Picture->Bitmap->PixelFormat = pf24bit; Image1->Picture->Bitmap->SaveToFile(AOutFileName); SAFE_DELETE(img); return true; } } catch(Exception &e) { } } __finally { SAFE_DELETE(pImgStream); SAFE_DELETE(Image1); } return false; } //--------------------------------------------------------------------------- void APP_DbLoading() { try { Application->ProcessMessages(); if (!SysCodeManager) { SysCodeManager = new TSysCodeManager(); SysCodeManager->LoadFromDb(); } if (!CDSFontManager) { CDSFontManager = new TCDSFontManager(); CDSFontManager->LoadFontInfo(); } if (!CDSAtmpManager) { CDSAtmpManager = new TCDSAtmpManager(); #ifdef USE_ATMP // CDSAtmpManager->LoadFromDb(); #endif } if (!CDSParkManager) { CDSParkManager = new TCDSParkManager(); #ifdef USE_PARK // CDSParkManager->LoadFromDb(); #endif } if (!CDSVmsFormManager) { CDSVmsFormManager = new TCDSVmsFormManager(); CDSVmsFormManager->LoadFromDb(); } if (!VmsTypeManager) { VmsTypeManager = new TVmsTypeManager(); VmsTypeManager->LoadFromDb(); } Application->ProcessMessages(); if (!VmsCtlrManager) { VmsCtlrManager = new TVmsCtlrManager(); VmsCtlrManager->LoadVmsModlSize(); VmsCtlrManager->LoadFromDb(); #if 0 VmsCtlrManager->LoadVmsFormUsage(); //VmsCtlrManager->LoadStatusFromDb(); VmsCtlrManager->LoadIfscRltn(); //VmsCtlrManager->LoadEvspRltn(); //VmsCtlrManager->LoadVmsMsg(); #endif } //Á¤º¸Á¦°ø±¸°£-Á¤º¸Á¦°ø±¸°£Á¤º¸¸¸ »ç¿ë(¼ÒÅëÁ¤º¸»ç¿ë¾ÈÇÔ) Application->ProcessMessages(); if (!IfscManager) { IfscManager = new TIfscManager(); #if 0 IfscManager->LoadFromDb(); if (g_AppCfg.isLoadFromFile) { IfscManager->LoadVertexFromFile(); } else { IfscManager->LoadVertexFromDb(); } #endif } } catch(...) { } } //--------------------------------------------------------------------------- String DbPictTypeToReal(String APictType) { if (APictType == "B") return "bmp"; if (APictType == "G") return "gif"; if (APictType == "A") return "gif"; if (APictType == "J") return "jpg"; if (APictType == "P") return "png"; if (APictType == "I") return "ico"; return "bmp"; } //--------------------------------------------------------------------------- String RealPictTypeToDb(String APictType) { if (APictType == "B") return "bmp"; //if (APictType == "gif") return "G"; if (APictType == "gif") return "A"; if (APictType == "jpg") return "J"; if (APictType == "jpeg")return "J"; if (APictType == "png") return "P"; if (APictType == "ico") return "I"; return "B"; } //--------------------------------------------------------------------------- String DbMovieTypeToReal(String APictType) { if (APictType == "AV") return "avi"; if (APictType == "MP") return "mpeg"; if (APictType == "MK") return "mkv"; if (APictType == "M4") return "mp4"; return "avi"; } //--------------------------------------------------------------------------- String RealMovieTypeToDb(String APictType) { if (APictType == "avi") return "AV"; if (APictType == "mpge") return "MP"; if (APictType == "mkv") return "MK"; if (APictType == "mp4") return "M4"; return "AV"; } //---------------------------------------------------------------------------