Пример #1
0
 public static void Init(string filePath)
 {
     _dict = ExcelClass.GainXZ(filePath);
     _XZQ  = null;
     _XZC  = null;
     _XZDC = null;
 }
        /// <summary>
        /// 作用:生成具体问题明细表格
        /// </summary>
        /// <param name="sheet"></param>
        /// <param name="concurrentBag"></param>
        private static void SaveList(ISheet sheet)
        {
            var  list     = Questions.Where(e => e.Project != CheckProject.数据库查询).OrderBy(e => e.Code).ThenBy(e => e.TableName).ToList();
            var  i        = 2;
            var  serial   = 1;
            IRow row      = null;
            var  modelrow = sheet.GetRow(i);

            foreach (var item in list.Take(MAXNUMBER))
            {
                row = sheet.GetRow(i) ?? sheet.CreateRow(i);
                i++;
                var cell = ExcelClass.GetCell(row, 0, modelrow);
                cell.SetCellValue(serial++);
                ExcelClass.GetCell(row, 1, modelrow).SetCellValue(item.Code);
                ExcelClass.GetCell(row, 2, modelrow).SetCellValue(item.Name);
                ExcelClass.GetCell(row, 3, modelrow).SetCellValue(item.TableName);
                ExcelClass.GetCell(row, 4, modelrow).SetCellValue(item.BSM);
                ExcelClass.GetCell(row, 5, modelrow).SetCellValue(item.Description);
                ExcelClass.GetCell(row, 6, modelrow).SetCellValue(item.Project.ToString());
            }
            if (list.Count > MAXNUMBER)
            {
                row = sheet.GetRow(MAXNUMBER + 1) ?? sheet.CreateRow(MAXNUMBER + 1);
                ExcelClass.GetCell(row, 0, modelrow).SetCellValue(string.Format("错误列表超过{0},超过部分不再显示", MAXNUMBER));
            }
        }
Пример #3
0
        private static void SaveList(ISheet sheet, ConcurrentBag <Question> concurrentBag)
        {
            var  list     = concurrentBag.OrderBy(e => e.Code).ThenBy(e => e.TableName).ToList();
            var  i        = 1;
            IRow row      = null;
            var  modelrow = sheet.GetRow(i);

            foreach (var item in list)
            {
                row = sheet.GetRow(i) ?? sheet.CreateRow(i);
                var cell = ExcelClass.GetCell(row, 0, modelrow);
                cell.SetCellValue(i++);
                ExcelClass.GetCell(row, 1, modelrow).SetCellValue(item.Code);
                ExcelClass.GetCell(row, 2, modelrow).SetCellValue(item.Name);
                ExcelClass.GetCell(row, 3, modelrow).SetCellValue(item.TableName);
                ExcelClass.GetCell(row, 4, modelrow).SetCellValue(item.BSM);
                ExcelClass.GetCell(row, 5, modelrow).SetCellValue(item.Description);
                ExcelClass.GetCell(row, 6, modelrow).SetCellValue(item.Project.ToString());
            }
        }
        /// <summary>
        /// 作用:生成质检过程中存在的问题表格
        /// </summary>
        /// <param name="sheet"></param>
        /// <param name="list"></param>
        private static void SaveInfo(ISheet sheet, ConcurrentBag <string> list)
        {
            var  i        = 2;
            IRow row      = null;
            var  modelrow = sheet.GetRow(1);

            foreach (var item in list.Take(MAXNUMBER))
            {
                row = sheet.GetRow(i) ?? sheet.CreateRow(i);
                var cell = ExcelClass.GetCell(row, 0, modelrow);
                cell.SetCellValue(i++);
                ExcelClass.GetCell(row, 1, modelrow).SetCellValue(item);
            }

            if (list.Count > MAXNUMBER)
            {
                row = sheet.GetRow(MAXNUMBER + 1) ?? sheet.CreateRow(MAXNUMBER + 1);
                ExcelClass.GetCell(row, 0, modelrow).SetCellValue(string.Format("错误列表超过{0},超过部分不再显示", MAXNUMBER));
            }
        }
Пример #5
0
        public static void Init(string filePath)
        {
            var list = ExcelClass.GainXZ(filePath);

            List = list;
        }