}//ctor #region Add definitions /// <summary> /// Declare a new import sheet in IMPORT_DEF and set that sheet as the default for new orders and bindings /// with this ImportMgr. (Unnecessary for CAF imports -- all imports use the "CAF" sheet) /// </summary> /// <param name="SheetOrder">The order of this sheet relative to other sheets</param> /// <param name="SheetName">The name used to identify this sheet</param> /// <param name="OverrideImportDefId">Manually set the ImportDefId for this import. Use only when a sheet /// has been deleted with removeImportDef and a new one must be defined with the same importdefid.</param> public void importDef(int SheetOrder, string SheetName, int OverrideImportDefId = int.MinValue) { DataRow row = _importDefTable.NewRow(); if (OverrideImportDefId != int.MinValue) { row["importdefid"] = OverrideImportDefId; } row["sheetname"] = SheetName; row["sheetorder"] = SheetOrder; row["definitionname"] = _DefinitionName; _importDefTable.Rows.Add(row); _SheetDefinitions = SchemaModTrnsctn.createImportDefinitionEntries(_DefinitionName, _importDefTable); }
/// <summary> /// Public accessor for the _CAFOrder dictionary so we can use it to change the order in the future /// </summary> //public Dictionary<string, Int32> CAFImportOrder //{ // get { return _CAFOrder; } //} /// <summary> /// Build a new UpdateImportMgr for a particular definition /// </summary> /// <param name="SchemaModTrnsctn">The schema script resources class</param> /// <param name="DefinitionName">The IMPORT_DEF definition (use "CAF" for caf imports)</param> /// <param name="CafDbLink">Legacy: this should probably change/go away after case 31124</param> /// <param name="ImporterSetUpMode">NbtExe or NbtWeb - depending on where you are using the Imp mgr</param> public CswNbtSchemaUpdateImportMgr(CswNbtSchemaModTrnsctn SchemaModTrnsctn, string DefinitionName, string CafDbLink = null, CswEnumSetupMode ImporterSetUpMode = CswEnumSetupMode.NbtExe) { _CAFDbLink = CafDbLink ?? CswScheduleLogicNbtCAFImport.CAFDbLink; _NbtImporter = new CswNbtImporter(SchemaModTrnsctn.Accessid, ImporterSetUpMode); this.SchemaModTrnsctn = SchemaModTrnsctn; _importDefTable = SchemaModTrnsctn.makeCswTableUpdate("Import_getDefs", "import_def").getTable(); _importOrderTable = SchemaModTrnsctn.makeCswTableUpdate("Import_getOrder", "import_def_order").getTable(); _importBindingsTable = SchemaModTrnsctn.makeCswTableUpdate("Import_getBindings", "import_def_bindings").getTable(); _importRelationshipsTable = SchemaModTrnsctn.makeCswTableUpdate("Import_getRelationships", "import_def_relationships").getTable(); _DefinitionName = DefinitionName; _SourceColumns = new CswCommaDelimitedString(); _SheetDefinitions = SchemaModTrnsctn.createImportDefinitionEntries(DefinitionName, _importDefTable); }//ctor