protected void AssignButton_Click(object sender, EventArgs e) { Object ReturnValue; Servers ServersObject; DataTable dtsrv = new DataTable(); DataTable dtdisk = new DataTable(); dtdisk.Columns.Add("ServerName"); dtdisk.Columns.Add("DiskName"); dtdisk.Columns.Add("Threshold"); dtdisk.Columns.Add("ThresholdType"); //3/4/2014 NS added for VSPLUS-431 Object ReturnValueDisk; ExchangeServers ExchangeServersObjectRet = new ExchangeServers(); ExchangeServers ExchangeServersObject = new ExchangeServers(); if (AdvDiskSpaceThTrackBar.Value.ToString() != null) { ExchangeServersObject.DiskSpaceThreshold = float.Parse(AdvDiskSpaceThTrackBar.Value.ToString()); } if (AdvMemoryThTrackBar.Value.ToString() != null) { ExchangeServersObject.Memory_Threshold = float.Parse(AdvMemoryThTrackBar.Value.ToString()); } if (AdvCPUThTrackBar.Value.ToString() != null) { ExchangeServersObject.CPU_Threshold = float.Parse(AdvCPUThTrackBar.Value.ToString()); } if (SrvAtrScanIntvlTextBox.Text != null && SrvAtrScanIntvlTextBox.Text != "") { ExchangeServersObject.ScanInterval = int.Parse(SrvAtrScanIntvlTextBox.Text); } if (SrvAtrOffScanIntvlTextBox.Text != null && SrvAtrOffScanIntvlTextBox.Text != "") { ExchangeServersObject.OffHoursScanInterval = int.Parse(SrvAtrOffScanIntvlTextBox.Text); } if (SrvAtrRetryIntvlTextBox.Text != null && SrvAtrRetryIntvlTextBox.Text != "") { ExchangeServersObject.RetryInterval = int.Parse(SrvAtrRetryIntvlTextBox.Text); } if (SrvAtrResponseThTextBox.Text != null && SrvAtrResponseThTextBox.Text != "") { ExchangeServersObject.ResponseThreshold = int.Parse(SrvAtrResponseThTextBox.Text); } if (SrvAtrFailBefAlertTextBox.Text != null && SrvAtrFailBefAlertTextBox.Text != "") { ExchangeServersObject.FailureThreshold = int.Parse(SrvAtrFailBefAlertTextBox.Text); } ExchangeServersObject.CredentialsID = (CredentialsComboBox.Text == "" ? 0 : Convert.ToInt32(CredentialsComboBox.Value)); if (ServerType == "DAG") { ExchangeServersObject.DAGPrimaryServerId = (PrimaryExchangeServerComboBox.Text == "" ? 0 : Convert.ToInt32(PrimaryExchangeServerComboBox.Value)); ExchangeServersObject.DAGBackUpServerID = (SecondaryExchangeServerComboBox.Text == "" ? 0 : Convert.ToInt32(SecondaryExchangeServerComboBox.Value)); ExchangeServersObject.DAGCopyQTh = int.Parse(CopyQThresholdTetBox.Text); ExchangeServersObject.DAGResponseQTh = int.Parse(ReplyQthresholdTextbox.Text); } SrvCheckBoxList.SelectAll(); if (SrvCheckBoxList.SelectedItems.Count > 0) { dtsrv.Columns.Add("ID"); dtsrv.Columns.Add("ServerName"); dtsrv.Columns.Add("IPAddress"); dtsrv.Columns.Add("Description"); dtsrv.Columns.Add("ServerType"); dtsrv.Columns.Add("Location"); dtsrv.Columns.Add("LocationID"); dtsrv.Columns.Add("PrimaryServerId"); dtsrv.Columns.Add("BackupServerId"); for (int i = 0; i < SrvCheckBoxList.SelectedItems.Count; i++) { DataRow dr = dtsrv.NewRow(); dr["ID"] = ""; dr["ServerName"] = SrvCheckBoxList.SelectedItems[i].ToString(); dr["IPAddress"] = ""; dr["Description"] = "Production"; if (ServerType == "DAG") { dr["ServerType"] = "Database Availability Group"; dr["PrimaryServerId"] = "Exchange"; dr["BackupServerId"] = "Exchange"; } else { dr["ServerType"] = "Exchange"; } dr["Location"] = ""; dr["LocationID"] = 0; ServersObject = CollectDataForServers("Insert", dr); DataTable dt = VSWebBL.SecurityBL.ServersBL.Ins.GetDataByName(ServersObject); if (dt.Rows.Count > 0) { ExchangeServersObject.Key = int.Parse(dt.Rows[0]["ID"].ToString()); } ExchangeServersObject.Category = dr["Description"].ToString(); ExchangeServersObject.Enabled = true; ExchangeServersObjectRet = VSWebBL.ConfiguratorBL.ExchangePropertiesBL.Ins.GetData(ExchangeServersObject); if (ServerType == "DAG") { ReturnValue = VSWebBL.ConfiguratorBL.ExchangePropertiesBL.Ins.UpdateDAGData(ExchangeServersObject); } else { ReturnValue = VSWebBL.ConfiguratorBL.ExchangePropertiesBL.Ins.UpdateData(ExchangeServersObject); } //3/4/2014 NS added for VSPLUS-431 if (ServerType != "DAG") { DataRow row = dtdisk.Rows.Add(); row["ServerName"] = SrvCheckBoxList.SelectedItems[i].ToString(); row["DiskName"] = "AllDisks"; row["Threshold"] = "10"; row["ThresholdType"] = "Percent"; } } if (ServerType != "DAG") { ReturnValueDisk = VSWebBL.ConfiguratorBL.ExchangePropertiesBL.Ins.InsertDiskSettingsData(dtdisk); } Response.Redirect("~/Security/ImportExchangeServers4.aspx", false);//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback Context.ApplicationInstance.CompleteRequest(); } }
protected void SelectAllButton_Click(object sender, EventArgs e) { SrvCheckBoxList.SelectAll(); }
protected void AssignButton_Click(object sender, EventArgs e) { Object ReturnValue; Servers ServersObject; DataTable dtsrv = new DataTable(); DataTable dtdisk = new DataTable(); dtdisk.Columns.Add("ServerName"); dtdisk.Columns.Add("DiskName"); dtdisk.Columns.Add("Threshold"); //dtdisk.Columns.Add("ThresholdType"); //dtdisk.Columns.Add("DiskInfo"); //3/4/2014 NS added for VSPLUS-431 Object ReturnValueDisk; DominoServers DominoServersObjectRet = new DominoServers(); DominoServers DominoServersObject = new DominoServers(); if (AdvDiskSpaceThTrackBar.Value.ToString() != null) { DominoServersObject.DiskSpaceThreshold = float.Parse(AdvDiskSpaceThTrackBar.Value.ToString()) / 100; } if (AdvMemoryThTrackBar.Value.ToString() != null) { DominoServersObject.Memory_Threshold = float.Parse(AdvMemoryThTrackBar.Value.ToString()) / 100; } if (AdvCPUThTrackBar.Value.ToString() != null) { DominoServersObject.CPU_Threshold = float.Parse(AdvCPUThTrackBar.Value.ToString()) / 100; } DominoServersObject.ScanDBHealth = SrvAtrDBHealthCheckBox.Checked; DominoServersObject.BES_Server = AdvMonitorBESNtwrkQCheckBox.Checked; if (SrvAtrPendingMailThTextBox.Text != null && SrvAtrPendingMailThTextBox.Text != "") { DominoServersObject.PendingThreshold = int.Parse(SrvAtrPendingMailThTextBox.Text); } if (SrvAtrDeadMailThTextBox.Text != null && SrvAtrDeadMailThTextBox.Text != "") { //5/15/2013 NS modified DominoServersObject.DeadMailDeleteThreshold = 0; DominoServersObject.DeadThreshold = int.Parse(SrvAtrDeadMailThTextBox.Text); } if (SrvAtrHeldMailThTextBox.Text != null && SrvAtrHeldMailThTextBox.Text != "") { DominoServersObject.HeldThreshold = int.Parse(SrvAtrHeldMailThTextBox.Text); } if (SrvAtrScanIntvlTextBox.Text != null && SrvAtrScanIntvlTextBox.Text != "") { DominoServersObject.ScanInterval = int.Parse(SrvAtrScanIntvlTextBox.Text); } if (SrvAtrOffScanIntvlTextBox.Text != null && SrvAtrOffScanIntvlTextBox.Text != "") { DominoServersObject.OffHoursScanInterval = int.Parse(SrvAtrOffScanIntvlTextBox.Text); } if (SrvAtrRetryIntvlTextBox.Text != null && SrvAtrRetryIntvlTextBox.Text != "") { DominoServersObject.RetryInterval = int.Parse(SrvAtrRetryIntvlTextBox.Text); } if (SrvAtrResponseThTextBox.Text != null && SrvAtrResponseThTextBox.Text != "") { DominoServersObject.ResponseThreshold = int.Parse(SrvAtrResponseThTextBox.Text); } if (SrvAtrFailBefAlertTextBox.Text != null && SrvAtrFailBefAlertTextBox.Text != "") { DominoServersObject.FailureThreshold = int.Parse(SrvAtrFailBefAlertTextBox.Text); } if (AdvClusterRepTextBox.Text != null && AdvClusterRepTextBox.Text != "") { DominoServersObject.Cluster_Rep_Delays_Threshold = float.Parse(AdvClusterRepTextBox.Text.ToString()); } SrvCheckBoxList.SelectAll(); if (SrvCheckBoxList.SelectedItems.Count > 0) { dtsrv.Columns.Add("ID"); dtsrv.Columns.Add("ServerName"); dtsrv.Columns.Add("IPAddress"); dtsrv.Columns.Add("Description"); dtsrv.Columns.Add("ServerType"); dtsrv.Columns.Add("Location"); dtsrv.Columns.Add("LocationID"); for (int i = 0; i < SrvCheckBoxList.SelectedItems.Count; i++) { DataRow dr = dtsrv.NewRow(); dr["ID"] = ""; dr["ServerName"] = SrvCheckBoxList.SelectedItems[i].ToString(); dr["IPAddress"] = ""; dr["Description"] = "Production"; dr["ServerType"] = "Domino"; dr["Location"] = ""; dr["LocationID"] = 0; ServersObject = CollectDataForServers("Insert", dr); DataTable dt = VSWebBL.SecurityBL.ServersBL.Ins.GetDataByName(ServersObject); if (dt.Rows.Count > 0) { DominoServersObject.Key = int.Parse(dt.Rows[0]["ID"].ToString()); } DominoServersObject.Category = dr["Description"].ToString(); DominoServersObject.Enabled = true; DominoServersObjectRet = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetData(DominoServersObject); //7/24/2015 NS added for VSPLUS-2013 DominoServersObject.ScanTravelerServer = true; DominoServersObject.ScanServlet = true; ReturnValue = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.UpdateData(DominoServersObject); //Clearing the previous added rows //(22/4/16 sowmya added for VSPLUS-2821) dtdisk.Rows.Clear(); //3/4/2014 NS added for VSPLUS-431 DataRow row = dtdisk.Rows.Add(); row["ServerName"] = SrvCheckBoxList.SelectedItems[i].ToString(); //2/11/2016 Durga Added for VSPLUS 2432 row["DiskName"] = "NoAlerts"; row["Threshold"] = "0"; ReturnValueDisk = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.InsertDiskSettingsData(dtdisk); } Response.Redirect("~/Security/ImportServers3.aspx", false);//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback Context.ApplicationInstance.CompleteRequest(); } }
protected void AssignButton_Click(object sender, EventArgs e) { //try //{ Object ReturnValue; Servers ServersObject; DominoServerTasks DSTaskObject; ServerTaskSettings STSettings; DataTable dt; DataTable dt2; DataTable dtsrv = new DataTable(); DataTable dtsrvtask = new DataTable(); string serverid = ""; string taskid = ""; if (SrvTaskCheckBoxList.SelectedItems.Count > 0) { dtsrvtask.Columns.Add("TaskID"); dtsrvtask.Columns.Add("TaskName"); dtsrvtask.Columns.Add("ServerID"); dtsrvtask.Columns.Add("Enabled"); dtsrvtask.Columns.Add("SendLoadCommand"); dtsrvtask.Columns.Add("SendRestartCommand"); dtsrvtask.Columns.Add("SendExitCommand"); dtsrvtask.Columns.Add("RestartOffHours"); dtsrv.Columns.Add("ID"); dtsrv.Columns.Add("ServerName"); dtsrv.Columns.Add("IPAddress"); dtsrv.Columns.Add("Description"); dtsrv.Columns.Add("ServerType"); dtsrv.Columns.Add("Location"); dtsrv.Columns.Add("LocationID"); for (int j = 0; j < SrvTaskCheckBoxList.Items.Count; j++) { if (SrvTaskCheckBoxList.Items[j].Selected) { SrvCheckBoxList.SelectAll(); if (SrvCheckBoxList.SelectedItems.Count > 0) { for (int i = 0; i < SrvCheckBoxList.SelectedItems.Count; i++) { DataRow drtask = dtsrvtask.NewRow(); drtask["TaskID"] = SrvTaskIDCheckBoxList.Items[j].Text; drtask["TaskName"] = SrvTaskCheckBoxList.Items[j].Text; drtask["ServerID"] = ""; drtask["Enabled"] = "true"; drtask["SendLoadCommand"] = "false"; drtask["SendRestartCommand"] = "false"; drtask["SendExitCommand"] = "false"; drtask["RestartOffHours"] = "false"; DataRow dr = dtsrv.NewRow(); dr["ID"] = ""; dr["ServerName"] = SrvCheckBoxList.SelectedItems[i].ToString(); dr["IPAddress"] = ""; dr["Description"] = "Production"; dr["ServerType"] = "Domino"; dr["Location"] = ""; dr["LocationID"] = 0; DSTaskObject = new DominoServerTasks(); DSTaskObject.TaskName = SrvTaskCheckBoxList.Items[j].Text; try { DSTaskObjectRet = VSWebBL.ConfiguratorBL.DominoServerTasksBL.Ins.GetDataForTaskName(DSTaskObject); } catch (Exception ex) { throw ex; } ServersObject = CollectDataForServers("Insert", dr); try { dt = VSWebBL.SecurityBL.ServersBL.Ins.GetDataByName(ServersObject); } catch (Exception ex) { throw ex; } if (dt.Rows.Count > 0) { drtask["ServerID"] = dt.Rows[0]["ID"].ToString(); serverid = dt.Rows[0]["ID"].ToString(); taskid = SrvTaskIDCheckBoxList.Items[j].Text; try { dt2 = VSWebBL.ConfiguratorBL.ServerTaskSettingsBL.Ins.SelectData(serverid, taskid); } catch (Exception ex) { throw ex; } if (dt2.Rows.Count == 0) { STSettings = CollectDataForServerTaskSettings("Insert", drtask); try { ReturnValue = VSWebBL.ConfiguratorBL.ServerTaskSettingsBL.Ins.InsertData(STSettings); } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } } } } } } } } //10/3/2013 NS moved the code below outside of the task selection check to allow to proceed to the next page without any selection SrvTaskCheckBoxList.UnselectAll(); SrvCheckBoxList.UnselectAll(); Response.Redirect("~/Security/ImportServers4.aspx", false); //Mukund, 05Aug14, VSPLUS-844:Page redirect on callback Context.ApplicationInstance.CompleteRequest(); //} //catch (Exception ex) //{ // throw ex; //} }
protected void AssignButton_Click(object sender, EventArgs e) { Object ReturnValue; Servers ServersObject; DataTable dtsrv = new DataTable(); DataTable dtdisk = new DataTable(); dtdisk.Columns.Add("ServerName"); dtdisk.Columns.Add("DiskName"); dtdisk.Columns.Add("Threshold"); //3/4/2014 NS added for VSPLUS-431 Object ReturnValueDisk; WebSpherePropertie websphere = new WebSpherePropertie(); WebSpherePropertie DominoServersObjectRet = new WebSpherePropertie(); // DominoServers DominoServersObjectRet = new DominoServers(); // DominoServers DominoServersObject = new DominoServers(); //if (AdvDiskSpaceThTrackBar.Value.ToString() != null) //{ // DominoServersObject.DiskSpaceThreshold = float.Parse(AdvDiskSpaceThTrackBar.Value.ToString()) / 100; //} if (AdvMemoryThTrackBar.Value.ToString() != null) { websphere.Memory_Threshold = int.Parse(AdvMemoryThTrackBar.Value.ToString()); } if (AdvCPUThTrackBar.Value.ToString() != null) { websphere.CPU_Threshold = int.Parse(AdvCPUThTrackBar.Value.ToString()); } //DominoServersObject.ScanDBHealth = SrvAtrDBHealthCheckBox.Checked; //DominoServersObject.BES_Server = AdvMonitorBESNtwrkQCheckBox.Checked; //if (SrvAtrPendingMailThTextBox.Text != null && SrvAtrPendingMailThTextBox.Text != "") //{ // DominoServersObject.PendingThreshold = int.Parse(SrvAtrPendingMailThTextBox.Text); //} //if (SrvAtrDeadMailThTextBox.Text != null && SrvAtrDeadMailThTextBox.Text != "") //{ // //5/15/2013 NS modified // DominoServersObject.DeadMailDeleteThreshold = 0; // DominoServersObject.DeadThreshold = int.Parse(SrvAtrDeadMailThTextBox.Text); //} //if (SrvAtrHeldMailThTextBox.Text != null && SrvAtrHeldMailThTextBox.Text != "") //{ // DominoServersObject.HeldThreshold = int.Parse(SrvAtrHeldMailThTextBox.Text); //} if (SrvAtrScanIntvlTextBox.Text != null && SrvAtrScanIntvlTextBox.Text != "") { websphere.ScanInterval = int.Parse(SrvAtrScanIntvlTextBox.Text); } if (SrvAtrOffScanIntvlTextBox.Text != null && SrvAtrOffScanIntvlTextBox.Text != "") { websphere.OffHoursScanInterval = int.Parse(SrvAtrOffScanIntvlTextBox.Text); } if (SrvAtrRetryIntvlTextBox.Text != null && SrvAtrRetryIntvlTextBox.Text != "") { websphere.RetryInterval = int.Parse(SrvAtrRetryIntvlTextBox.Text); } if (SrvAtrResponseThTextBox.Text != null && SrvAtrResponseThTextBox.Text != "") { websphere.ResponseThreshold = int.Parse(SrvAtrResponseThTextBox.Text); } if (SrvAtrFailBefAlertTextBox.Text != null && SrvAtrFailBefAlertTextBox.Text != "") { websphere.FailureThreshold = int.Parse(SrvAtrFailBefAlertTextBox.Text); } if (ThreadPollTextbox.Text != null && ThreadPollTextbox.Text != "") { websphere.AvgThreadPool = int.Parse(ThreadPollTextbox.Text); } if (HeapCurrentTextBox.Text != null && HeapCurrentTextBox.Text != "") { websphere.CurrentHeap = HeapCurrentTextBox.Text; } if (UpTimeTextBox.Text != null && UpTimeTextBox.Text != "") { websphere.Uptime = int.Parse(UpTimeTextBox.Text); } if (DumpGeneratorTextBox.Text != null && DumpGeneratorTextBox.Text != "") { websphere.DumpGenerated = DumpGeneratorTextBox.Text; } if (ThreadCountTextBox.Text != null && ThreadCountTextBox.Text != "") { websphere.ActiveThreadCount = int.Parse(ThreadCountTextBox.Text); } if (MaximunHeapTextBox.Text != null && MaximunHeapTextBox.Text != "") { websphere.MaxHeap = MaximunHeapTextBox.Text; } if (HungThradTextBox.Text != null && HungThradTextBox.Text != "") { websphere.HungThreadCount = int.Parse(HungThradTextBox.Text); } //if (AdvClusterRepTextBox.Text != null && AdvClusterRepTextBox.Text != "") //{ // DominoServersObject.Cluster_Rep_Delays_Threshold = float.Parse(AdvClusterRepTextBox.Text.ToString()); //} SrvCheckBoxList.SelectAll(); if (SrvCheckBoxList.SelectedItems.Count > 0) { dtsrv.Columns.Add("ID"); dtsrv.Columns.Add("ServerName"); dtsrv.Columns.Add("IPAddress"); dtsrv.Columns.Add("Description"); dtsrv.Columns.Add("ServerType"); dtsrv.Columns.Add("Location"); dtsrv.Columns.Add("LocationID"); for (int i = 0; i < SrvCheckBoxList.SelectedItems.Count; i++) { DataRow dr = dtsrv.NewRow(); dr["ID"] = ""; dr["ServerName"] = SrvCheckBoxList.SelectedItems[i].ToString(); dr["IPAddress"] = ""; dr["Description"] = "Production"; dr["ServerType"] = "WebSphere"; dr["Location"] = ""; dr["LocationID"] = 0; ServersObject = CollectDataForServers("Insert", dr); DataTable dt = VSWebBL.SecurityBL.ServersBL.Ins.GetDataByName(ServersObject); if (dt.Rows.Count > 0) { websphere.ServerID = int.Parse(dt.Rows[0]["ID"].ToString()); } websphere.Category = dr["Description"].ToString(); websphere.Enabled = true; DominoServersObjectRet = VSWebBL.ConfiguratorBL.WebSpherepropertiesBL.Ins.GetData(websphere); ReturnValue = VSWebBL.ConfiguratorBL.WebSpherepropertiesBL.Ins.UpdatesData(websphere); //DataTable dt1 = VSWebBL.SecurityBL.ServersBL.Ins.GetAllDataByName(ServersObject); // if (dt1.Rows.Count > 0) // { // //DescTextBox.Text = dt.Rows[0]["Description"].ToString(); // SrvAtrRetryIntvlTextBox.Text = dt1.Rows[0]["RetryInterval"].ToString(); // SrvAtrResponseThTextBox.Text = dt1.Rows[0]["ResponseTime"].ToString(); // SrvAtrOffScanIntvlTextBox.Text = dt1.Rows[0]["OffHourInterval"].ToString(); // AdvCPUThTrackBar.Value = dt1.Rows[0]["CPU_Threshold"].ToString(); // AdvMemoryThTrackBar.Value = dt1.Rows[0]["MemThreshold"].ToString(); // SrvAtrScanIntvlTextBox.Text = dt1.Rows[0]["ScanInterval"].ToString(); // SrvAtrFailBefAlertTextBox.Text = dt1.Rows[0]["ConsFailuresBefAlert"].ToString(); // } // DataTable dt2 = VSWebBL.ConfiguratorBL.WebSpherepropertiesBL.Ins.GetAllDataByNames(websphere); // if (dt2.Rows.Count > 0) // { // ThreadPollTextbox.Text = dt2.Rows[0]["AvgThreadPool"].ToString(); // ThreadCountTextBox.Text = dt2.Rows[0]["ActiveThreadCount"].ToString(); // HeapCurrentTextBox.Text = dt2.Rows[0]["CurrentHeap"].ToString(); // MaximunHeapTextBox.Text = dt2.Rows[0]["MaxHeap"].ToString(); // UpTimeTextBox.Text = dt2.Rows[0]["Uptime"].ToString(); // HungThradTextBox.Text = dt2.Rows[0]["HungThreadCount"].ToString(); // DumpGeneratorTextBox.Text = dt2.Rows[0]["DumpGenerated"].ToString(); // } // Object result = VSWebBL.SecurityBL.ServersBL.Ins.UpdateAttributesData(CollectDataforMSServers()); // Object result1 = VSWebBL.ConfiguratorBL.WebSpherepropertiesBL.Ins.UpdateData(CollectDataforWebSphereServices()); //3/4/2014 NS added for VSPLUS-431 //DataRow row = dtdisk.Rows.Add(); //row["ServerName"] = SrvCheckBoxList.SelectedItems[i].ToString(); //row["DiskName"] = "0"; //row["Threshold"] = "0"; //ReturnValueDisk = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.InsertDiskSettingsData(dtdisk); } Response.Redirect("~/Security/WebsphereCellGrid.aspx", false);//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback Context.ApplicationInstance.CompleteRequest(); } }