private void BtnExport_Click(object sender, RibbonControlEventArgs e) { ExcelHelper.ToggleExcelEvents(Globals.ThisAddIn.excelApplication, false); Cursor.Current = Cursors.WaitCursor; RibbonMenu ribbonMenu = (RibbonMenu)dynamicMenuAdd; string addMenuLabel = ribbonMenu.Label; InitializeVariables.InitializeDatabaseTables(); if (backgroundWorker1.IsBusy != true) { alert = new ProgressBarForm(); switch (addMenuLabel) { case "Fields": alert.Text = "Validating and Exporting Fields Data"; break; case "Dropdowns": alert.Text = "Exporting dropdown data"; break; case "Descriptions": alert.Text = "Exporting translated descriptions"; break; case "Fields and Dropdowns": alert.Text = "Validating Fields and Exporting Fields and Dropdowns data"; break; } alert.Show(); backgroundWorker1.RunWorkerAsync(); } Cursor.Current = Cursors.Default; ExcelHelper.ToggleExcelEvents(Globals.ThisAddIn.excelApplication, true); }
private void RibbonLoad() { try { if (Globals.ThisAddIn.excelApplication != null) { string directoryPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string filePath = Path.Combine(directoryPath, "MasterDataOnline.db"); GlobalMembers.InstanceGlobalMembers.SqliteDatabase = new SQLiteDatabase(filePath); InitializeGlobalVariables(); InitializeVariables.InitializeDatabaseTables(); InitializeVariables.InitializeClassVariables(); this.excelWorkbook = Globals.ThisAddIn.excelApplication.ActiveWorkbook; ExcelHelper.ReadTheWebServicePathFromConfigSheet(excelWorkbook); Globals.ThisAddIn.excelApplication.WorkbookBeforeClose -= ExcelApplication_WorkbookBeforeClose; this.excelWorkbook.SheetChange -= ExcelWorkbook_SheetChange; this.excelWorkbook.SheetFollowHyperlink -= ExcelWorkbook_SheetFollowHyperlink; Globals.ThisAddIn.excelApplication.WorkbookBeforeClose += ExcelApplication_WorkbookBeforeClose; this.excelWorkbook.SheetChange += ExcelWorkbook_SheetChange; this.excelWorkbook.SheetFollowHyperlink += ExcelWorkbook_SheetFollowHyperlink; } btnUserDetails.Visible = false; btnModules.Enabled = false; btnImport.Enabled = false; btnExport.Enabled = false; dynamicMenuModules.Visible = false; dynamicMenuAdd.Enabled = false; } catch (Exception ex) { throw (ex); } }
public void Connect() { var initVariables = new InitializeVariables(); var providedVariables = new BaseDdsVariables(initVariables.ProvidedVariablesInfo); var requestedVariables = new BaseDdsVariables(initVariables.RequestedVariablesInfo); var schemes = new BaseDdsModel(this.ClientName); schemes.AddVariables(providedVariables, requestedVariables); var client = new DdsClient(this.ServerName, schemes); this.Schemes = client.Schemes; this.ProviderController = client.ProviderController; this.RequesterController = client.RequesterController; }