protected void btnExportMSI_Click(object sender, EventArgs e) { LinkButton sourceBtn = sender as LinkButton; string applicationName = sourceBtn.CommandArgument; ToggleLinks(false); BCCOperator bccOperator = new BCCOperator(); string bindingFilePath = @"C:\Windows\Temp"; string bindingFileName = applicationName + "_" + System.Environment.MachineName + ".MSI"; int returnCode = bccOperator.ExportMSIFile(applicationName, BCCOperator.BizTalkSQLServer(), BCCOperator.BizTalkMgmtDb(), bindingFilePath, bindingFileName); if (returnCode != 0) { DisplayError("Unable to generate a MSI file for the application '" + applicationName + "'."); } else { bindingFileLink.Text = "Download MSI"; bindingFileLink.Visible = true; bindingFileLink.Enabled = true; bindingFileLink.NavigateUrl = FullFileName(bindingFilePath + "\\" + bindingFileName); } new ActivityHelper().RaiseAuditEvent(this, lblCaption.Text, "exported " + bindingFileName, 501); }
private void BCCAgentIndicator() { try { StringCollection serviceList = new StringCollection(); serviceList.Add(ConfigurationManager.AppSettings["BCCAgentName"].ToString()); if (serviceList != null && serviceList.Count > 0) { BCCOperator bccOperator = new BCCOperator(); DataTable dtService = bccOperator.GetServiceStatus(serviceList); if (dtService != null && dtService.Rows != null && dtService.Rows.Count > 0) { string agent = "BCC Agent"; agentName.Text = agent; agentStatus.Status = dtService.Rows[0][1].ToString(); agentStatus.ToolTip = dtService.Rows[0][1].ToString(); agentName.ToolTip = agent + " - " + dtService.Rows[0][1].ToString(); } } } catch (Exception ex) { System.Diagnostics.Debug.Write(ex.Message + ex.StackTrace, "Controls_AgentIndicator"); } }
protected void btnImportBindings_Click(object sender, EventArgs e) { if (tBindings.Text != string.Empty) { BCCOperator bccOperator = new BCCOperator(); LinkButton sourceBtn = sender as LinkButton; string applicationName = sourceBtn.CommandArgument; string bindingFilePath = @"C:\Windows\Temp"; string bindingFileName = string.Format("{0}_{1}_{2}_Bindings.xml", applicationName, System.Guid.NewGuid(), System.Environment.MachineName); // Read from textArea ----- tBindings.Text bccOperator.GenerateBindingFile(tBindings.Text, bindingFilePath + "\\" + bindingFileName); int returnCode = bccOperator.ImportBindingFile(applicationName, BCCOperator.BizTalkSQLServer(), BCCOperator.BizTalkMgmtDb(), bindingFilePath, bindingFileName); if (returnCode != 0) { DisplayError("Unable to import binding file for the application '" + applicationName + "'."); } else { new ActivityHelper().RaiseAuditEvent(this, lblCaption.Text, "imported " + bindingFileName, 501); DisplayOK("Bindings were successfully imported into " + applicationName); } } else { DisplayError("Ensure that the binding file is not empty!"); } }
private void CheckAgentServices() { try { StringCollection serviceList = new StringCollection(); serviceList.Add(ConfigurationManager.AppSettings["BCCAgentName"].ToString()); if (serviceList != null && serviceList.Count > 0) { BCCOperator bccOperator = new BCCOperator(); DataTable dtService = bccOperator.GetServiceStatus(serviceList); foreach (DataRow serviceRecord in dtService.Rows) { if (serviceRecord[1].ToString().Equals("Not Installed")) { AnnounceError("Alert: " + serviceRecord[0] + " is not installed, monitoring will not work."); break; } else if (serviceRecord[1].ToString().Equals("Stopped")) { AnnounceError("Alert: " + serviceRecord[0] + " is currently stopped, monitoring will not work."); break; } } } } catch (Exception ex) { DisplayError(ex.Message); } }
private void PopulateViewServiceDetails() { try { StringCollection serviceList = new StringCollection(); serviceList.Add(ConfigurationManager.AppSettings["BCCAgentName"].ToString()); if (serviceList != null && serviceList.Count > 0) { BCCOperator bccOperator = new BCCOperator(); DataTable dtService = bccOperator.GetServiceStatus(serviceList); gridBCCAgent.DataSource = dtService; gridBCCAgent.DataBind(); gridBCCAgent.Visible = true; } } catch (Exception ex) { DisplayError("Specify the correct service name in the filters. See 'Administration > System Settings'." + ex.Message); } }