private HcCtgCodeInfo convertFromCodeExcel(FileInfo nextFile)
        {
            var ctgCodeInfo = new HcCtgCodeInfo();

            ExcelOptions.GetExcelData(nextFile.FullName, s => setCodeInfo(s, ctgCodeInfo));
            return ctgCodeInfo;
        }
        public static void WriteOutPut(String path, HcCtgCodeInfo info)
        {
            if(genertor == null)
            {
                genertor = new GenertorToCode();
            }
            genertor.creatCtgCodeInfo(path, info.Codes);

            genertor.creatCtgCodeInfoForScene(path, info.SceneCodes);
        }
        private void getCtgCodeInfo(Worksheet sheet, HcCtgCodeInfo ctgCodeInfo)
        {
            Range range = null;
            var starRow = 11;
            HcCodeInfo codeInfo = null;
            while (((Range)sheet.Cells[starRow, 5]).Value != null &&
                !string.IsNullOrEmpty(((Range)sheet.Cells[starRow, 5]).Value.ToString()))
            {
                HcCodeItemInfo codeItemInfo = new HcCodeItemInfo();
                range = (Range)sheet.Cells[starRow, 5];
                codeItemInfo.ENName = range.Value.ToString();

                range = (Range)sheet.Cells[starRow, 6];
                codeItemInfo.Code = range.Value.ToString();

                range = (Range)sheet.Cells[starRow, 7];
                codeItemInfo.Caption = range.Value;

                range = (Range)sheet.Cells[starRow, 8];
                codeItemInfo.Note = range.Value;

                range = (Range)sheet.Cells[starRow, 2];
                if (range.Value != null)
                {
                    if (codeInfo != null)
                    {
                        ctgCodeInfo.Codes.Add(codeInfo);
                    }
                    codeInfo = new HcCodeInfo();
                    codeInfo.Name = range.Value;

                    range = (Range)sheet.Cells[starRow, 3];
                    codeInfo.Table = range.Value;

                    range = (Range)sheet.Cells[starRow, 4];
                    codeInfo.Column = range.Value;
                }

                codeInfo.Codes.Add(codeItemInfo);
                starRow += 1;
            }

            if (codeInfo != null)
            {
                ctgCodeInfo.Codes.Add(codeInfo);
            }
        }
 private void setCodeInfo(Worksheet sheet, HcCtgCodeInfo ctgCodeInfo)
 {
     var name = sheet.Name;
     switch (name)
     {
         case "区分代码一览":
             // 获得区分代码一览
             getCtgCodeInfo(sheet, ctgCodeInfo);
             break;
         case "区分代码一览(画面表示用)":
             // 区分代码一览(画面表示用)
             getCtgCodeInfoForScene(sheet, ctgCodeInfo);
             break;
         default:
             break;
     }
 }