Exemplo n.º 1
0
 /// <summary>
 /// Start(TOCdir) - prepare further works with the Documents; setup data from TOC
 /// </summary>
 /// <param name="FileDir">Directory, Path to TSmatch.xlsx</param>
 /// <history> 22.1.2016
 /// 12.3.2016 - multilanguage Heders support
 /// 14.3.2016 - Form class support
 /// 19.3.2016 - use EOL method
 /// 30.3.2016 - Start(TOCdir) and getDoc with #template interaction with Bootstrap
 /// 17.4.2016 - tocStart extracted from Start for initial TOC open
 /// </history>
 public static void Start(Dictionary<string, string> _Templates)
 {
     Log.set("Document.Start(#Templates)");
     Templates = _Templates;
     //2/8            Document toc = tocStart(Templates["#TOC"]);
     toc = tocStart(Templates["#TOC"]);
     Mtr mtr = toc.Body;
     for (int i = toc.i0; i <= toc.il; i++)
     {
         string docName = mtr.Strng(i, Decl.DOC_NAME);
         if (docName != "")
         {
             Document doc = new Document(docName);
             // mtr относится только к TOCmatch, а не ко всем Документам,
             //.. то есть реально загружаем ТОС, а остальные Документы- потом
             if (doc.name == Decl.DOC_TOC) doc = toc;
             Documents.Add(docName, doc);
             doc.MadeTime = Lib.getDateTime(mtr[i, Decl.DOC_TIME]);
             doc.ResLines = Lib.ToIntList(mtr.Strng(i, Decl.DOC_TYPE), '/');
             doc.MadeStep = mtr.Strng(i, Decl.DOC_MADESTEP);
             doc.FileName = mtr.Strng(i, Decl.DOC_FILE);
             doc.FileDirectory = mtr.Strng(i, Decl.DOC_DIR);
             doc.type = mtr.Strng(i, Decl.DOC_TYPE);
             doc.isNewDoc = (doc.type == Decl.DOC_TYPE_N);
             doc.SheetN = mtr.Strng(i, Decl.DOC_SHEET);
             if (doc.type == Decl.TSMATCH_TYPE) doc.Sheet = toc.Wb.Worksheets[doc.SheetN];
             doc.creationDate = Lib.getDateTime(mtr[i, Decl.DOC_CREATED]);
             doc.Supplier = mtr.Strng(i, Decl.DOC_SUPPLIER);
             doc.LoadDescription = mtr.Strng(i, Decl.DOC_STRUCTURE_DESCRIPTION);
             doc.forms = Form.Init(i);
             doc.Loader = mtr.Strng(i, Decl.DOC_LOADER);
             doc.EOL(i);
             int j;
             for (j = i + 1; j <= mtr.iEOL() && mtr.Strng(j, Decl.DOC_NAME) == ""; j++) ;
             doc.stamp = new Stamp(i, j - 1);
         } //if docName !=""
     } // for по строкам TOC
     Log.exit();
 } // end Start
Exemplo n.º 2
0
 private List<int> intListFrCell(Document doc, int row, int col)
 {
     return Lib.ToIntList(doc.Body.Strng(row, col), ',');
 }