示例#1
0
        private bool ExcelImport()
        {
            using (var excelizer = new Excelizer(_ExcelFileName, Excelizer.Direction.Import))
            {
                var importedRows = excelizer.Import();
                importedRows = importedRows.Where(x => string.Compare(_DwgPath, x.DwgPath, StringComparison.OrdinalIgnoreCase) == 0).ToList();

                Import(importedRows);
            }

            return(true);
        }
示例#2
0
        private bool ExcelExport()
        {
            if (_ColsForExcel.Count == 0)
            {
                return(true);
            }
            using (var excelizer = new Excelizer(_ExcelFileName, Excelizer.Direction.Export))
            {
                excelizer.Export(_ColsForExcel);
            }

            return(true);
        }
示例#3
0
        private _AcDb.ResultBuffer GetDwgNames(string excelFileName)
        {
            List <string> dwgNames = new List <string>();

            using (var excelizer = new Excelizer(excelFileName, Excelizer.Direction.Import))
            {
                var importedRows         = excelizer.Import();
                var perDwgName           = importedRows.GroupBy(x => x.DwgPath);
                _AcDb.ResultBuffer rbRet = new _AcDb.ResultBuffer();
                foreach (var pdn in perDwgName)
                {
                    string dwgName = pdn.Key;
                    dwgNames.Add(dwgName);
                    rbRet.Add(new _AcDb.TypedValue((int)_AcBrx.LispDataType.Text, dwgName));
                }

                var dwgString = string.Join(", ", dwgNames.Select(x => System.IO.Path.GetFileName(x)).ToArray());
                log.InfoFormat("\nDatei '{0}' enthält Informationen folgende dwgs: {1}", excelFileName, dwgString);

                return(rbRet);
            }
        }