private string getLocalRemoteStoragePath(string puid, string szTargetId, string szFileName) { string localPath = null; string fileName = BVSDKAdapter.ParsePathGetFileName(szFileName); puid = puid.Replace("UA_", "PU_"); szTargetId = szTargetId.Replace("UA_", "PU_"); if (szTargetId == puid) { localPath = getLocalPath2(puid, szFileName); localPath += "\\" + fileName; } //else if (szTargetId.StartsWith("NRU_")) //{ // localPath = GetLocalSaveDir(szTargetId, szFileName); // localPath += "\\" + fileName; // // BVCU_FTP_RecordFileInfo info = new BVCU_FTP_RecordFileInfo(); // // info.szFileName = szFileName; // // //localPath = GetLocalSaveDir(szTargetId, info); // // localPath = GetLocalSaveDir(szTargetId, info); // // if (localPath == null || localPath.Length == 0) { return null; } // // localPath += "\\" + fileName; //} return(localPath); }
public void showRecord(EventHandler.BVSearchResponse searchRes, string szTargetID) { if (dataGridViewRecord.RowCount != 0) { dataGridViewRecord.Rows.Clear(); } m_szTarID = szTargetID; int channelNo; float percent = 0; foreach (BVCU_Search_FileInfo fileInfo in searchRes.fileInfo) { int index = this.dataGridViewRecord.Rows.Add(); dataGridViewRecord.Rows[index].Cells[0].Value = index.ToString(); dataGridViewRecord.Rows[index].Cells[1].Value = szTargetID; string fileName = BVSDKAdapter.ParsePathGetFileName(fileInfo.filePath); int.TryParse(fileName.Substring(0, fileName.Length), out channelNo); string channelNoStr = channelNo.ToString("00"); dataGridViewRecord.Rows[index].Cells[2].Value = channelNoStr; dataGridViewRecord.Rows[index].Cells[3].Value = BVSDKAdapter.GetRecordReason(fileInfo.iRecordType); dataGridViewRecord.Rows[index].Cells[4].Value = BVSDKAdapter.getDateTimeFromMicroSecond(fileInfo.iTimeBegin * 1000000).ToString("yyyy-MM-dd HH:mm:ss");; dataGridViewRecord.Rows[index].Cells[5].Value = BVSDKAdapter.getDateTimeFromMicroSecond(fileInfo.iTimeEnd * 1000000).ToString("yyyy-MM-dd HH:mm:ss");; dataGridViewRecord.Rows[index].Cells[6].Value = getFileType(fileInfo.iFileType); dataGridViewRecord.Rows[index].Cells[7].Value = (float)Math.Round((fileInfo.iFileSize / (float)(1024 * 1024)), 2); dataGridViewRecord.Rows[index].Cells[8].Value = (float)Math.Round(percent * 100, 2); dataGridViewRecord.Rows[index].Cells[9].Value = BVSDKAdapter.ParsePathGetFileName(fileInfo.filePath); dataGridViewRecord.Rows[index].Cells[10].Value = fileInfo.filePath; dataGridViewRecord.Rows[index].Cells[11].Value = fileInfo.desc1; dataGridViewRecord.Rows[index].Cells[12].Value = fileInfo.desc2; dataGridViewRecord.Rows[index].Tag = fileInfo; dataGridViewRecord.Rows[index].ContextMenuStrip = contextMenuStripFileDown; } }