示例#1
0
        public bool SHPFileCopy(string srcShpfilePathName, string dstFilePath, luShpType lyrType)
        {
            string tmpDstFileName;

            if (lyrType == luShpType.jctbType)
            {
                tmpDstFileName = dstFilePath + m_monitorShapeFileName + GetSameFileNum(lyrType).ToString() + ".shp";
                return(DirectCopySHP(srcShpfilePathName, tmpDstFileName));
            }
            else if (lyrType == luShpType.ghhxType)
            {
                tmpDstFileName = dstFilePath + m_planRedLineFileName + GetSameFileNum(lyrType).ToString() + ".shp";
                return(DirectCopySHP(srcShpfilePathName, tmpDstFileName));
            }
            else if (lyrType == luShpType.jbntType)
            {
                tmpDstFileName = dstFilePath + m_baseFarmFileName + GetSameFileNum(lyrType).ToString() + ".shp";
                return(DirectCopySHP(srcShpfilePathName, tmpDstFileName));
            }

            else if (lyrType == luShpType.spsjType)
            {
                tmpDstFileName = dstFilePath + m_useAllowedFileName + GetSameFileNum(lyrType).ToString() + ".shp";
                return(DirectCopySHP(srcShpfilePathName, tmpDstFileName));
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        public int GetSameFileNum(luShpType lyrType)
        {
            string baseDataPath = m_projectPath + m_projectName + "//" + m_projectName + "//" + m_baseData + "//";

            if (lyrType == luShpType.jctbType)
            {
                for (int i = 1; ; i++)
                {
                    if (!File.Exists(baseDataPath + m_monitorShapeFileName + i.ToString() + ".shp"))
                    {
                        return(i);
                    }
                }
            }
            else if (lyrType == luShpType.ghhxType)
            {
                for (int i = 1; ; i++)
                {
                    if (!File.Exists(baseDataPath + m_planRedLineFileName + i.ToString() + ".shp"))
                    {
                        return(i);
                    }
                }
            }
            else if (lyrType == luShpType.jbntType)
            {
                for (int i = 1; ; i++)
                {
                    if (!File.Exists(baseDataPath + m_baseFarmFileName + i.ToString() + ".shp"))
                    {
                        return(i);
                    }
                }
            }
            else if (lyrType == luShpType.spsjType)
            {
                for (int i = 1; ; i++)
                {
                    if (!File.Exists(baseDataPath + m_useAllowedFileName + i.ToString() + ".shp"))
                    {
                        return(i);
                    }
                }
            }
            else
            {
                return(-1);
            }
        }