public bool insertdetails(IBMConnectionsServers IBMConnectionsServer) { bool insert = false; try { string query = "Insert into IBMConnectionsServer(ServerID,Category," + "Enabled,ScanInterval,OffHoursScanInterval,RetryInterval,ResponseThreshold," + "SSL,FailureThreshold,CredentialID," + "ChatUser1CredentialsId,ChatUser2CredentialsId,TestChatSimulation)" + " Values(" + IBMConnectionsServer.SID + ",'" + IBMConnectionsServer.Category + "','" + IBMConnectionsServer.Enabled + "'," + "'" + IBMConnectionsServer.ScanInterval + "','" + IBMConnectionsServer.OffHoursScanInterval + "','" + IBMConnectionsServer.RetryInterval + "'," + "'" + IBMConnectionsServer.ResponseThreshold + "','" + IBMConnectionsServer.SSL + "','" + IBMConnectionsServer.CredentialID + "'," + "" + IBMConnectionsServer.ChatUser1Credentials.ToString() + ",ChatUser2CredentialsId=" + IBMConnectionsServer.ChatUser2Credentials.ToString() + ",'" + IBMConnectionsServer.TestChatSimulation + "')"; insert = objAdaptor.ExecuteNonQuery(query); } catch (Exception e) { insert = false; throw e; } finally { } return(insert); }
public Object ValidateSametimeServerUpdate(IBMConnectionsServers UpdateObject) { Object ReturnValue = ""; try { // if (UpdateObject.Name == null || UpdateObject.Name == "") //{ // return "ER#Please enter the SametimeServers Name"; //} if (UpdateObject.Category == null || UpdateObject.Category == "") { return("ER#Please enter the category of the device"); } // if (UpdateObject.Location == null || UpdateObject.Location == "") // { // return "ER#Please enter the location of the device"; // } // if (UpdateObject.Description == null || UpdateObject.Description == "") // { // return "ER#Please enter a description of the device"; //} if (UpdateObject.ResponseThreshold == null) { return("ER#Please enter a Response Threshold, in milliseconds, over which the device will be considered 'slow'. Validation Failure"); } if (UpdateObject.ScanInterval == null) { return("ER#Please enter a Scan Interval"); } if (UpdateObject.RetryInterval == null) { return("ER#Please enter a Retry Interval"); } // if (UpdateObject.IPAddress == null) // { // return "ER#Please enter the IP Address device, such as '127.0.0.1'"; //} if (UpdateObject.OffHoursScanInterval == null) { return("ER#Please enter an off-hours Scan Interval that is a number, in minutes."); } //if ((UpdateObject.RetryInterval) > (UpdateObject.ScanInterval)) //{ // return "ER#Please enter a Retry Interval that is less than the Scan Interval"; //} } catch (Exception t) { throw t; } return(""); }
public IBMConnectionsServers GetdatawithId(IBMConnectionsServers IBMConnectionsObject) { try { return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.GetdatawithId(IBMConnectionsObject)); } catch (Exception ex) { throw ex; } }
public Object DeleteIBMConnectionsServers(IBMConnectionsServers IBMConnectionsObject) { try { return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.DeleteIBMConnectionsServers(IBMConnectionsObject)); } catch (Exception ex) { throw ex; } }
public DataTable GetwebspherecellforIBMCS(IBMConnectionsServers Stobj, int key) { try { return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.GetwebspherecellforIBMCS(Stobj, key)); } catch (Exception ex) { throw ex; } }
public DataTable GetIPAddress(IBMConnectionsServers StObj) { try { return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.GetIPAddress(StObj)); } catch (Exception ex) { throw ex; } }
protected void IBMConnectionsGridview_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //SametimeServers SametimeObject = new SametimeServers(); IBMConnectionsServers IBMConnectionsObject = new IBMConnectionsServers(); IBMConnectionsObject.ID = Convert.ToInt32(e.Keys[0]); //delete a Row Object Stsobject = VSWebBL.ConfiguratorBL.IBMConnectionsServersBL.Ins.DeleteIBMConnectionsServers(IBMConnectionsObject); ASPxGridView griedview = (ASPxGridView)sender; griedview.CancelEdit(); e.Cancel = true; FillIBMConnectionsGrid(); }
public DataTable GetIPAddress(IBMConnectionsServers Stobj) { //SametimeServers SametimeObj = new SametimeServers(); DataTable sametimeTable = new DataTable(); try { string sqlQuery = "Select * from IBMConnectionsServers where IPAddress='" + Stobj.IPAddress + "'"; sametimeTable = objAdaptor.FetchData(sqlQuery); } catch (Exception ex) { throw ex; } return(sametimeTable); }
public DataTable GetwebspherecellforIBMCS(IBMConnectionsServers Stobj, int key) { //SametimeServers SametimeObj = new SametimeServers(); DataTable sametimeTable = new DataTable(); try { //string sqlQuery = "Select * from WebsphereCell where SametimeId=" + Stobj.SametimeId + ""; string sqlQuery = "Select * from WebsphereCell where IBMConnectionSID = " + key + ""; sametimeTable = objAdaptor.FetchData(sqlQuery); } catch (Exception ex) { throw ex; } return(sametimeTable); }
public DataTable GetwebspherecellforIBMC(IBMConnectionsServers Stobj) { //SametimeServers SametimeObj = new SametimeServers(); DataTable sametimeTable = new DataTable(); try { //string sqlQuery = "Select * from WebsphereCell where SametimeId=" + Stobj.SametimeId + ""; string sqlQuery = "Select * from WebsphereCell wc inner join IBMConnectionsServers ic on wc.cellid = ic.WSCellID where ServerId = " + Stobj.SID + ""; sametimeTable = objAdaptor.FetchData(sqlQuery); } catch (Exception ex) { throw ex; } return(sametimeTable); }
public Object DeleteIBMConnectionsServers(IBMConnectionsServers IBMConnectionsObject) { Object deletesametime; try { string query = "delete IBMConnectionsServers Where ID=" + IBMConnectionsObject.ID; string delserver = "delete from servers where ID=" + IBMConnectionsObject.SID; deletesametime = objAdaptor.ExecuteNonQuery(delserver); deletesametime = objAdaptor.ExecuteNonQuery(query); } catch { deletesametime = false; } finally { } return(deletesametime); }
public Object UpdateIBMConnectionsServers(IBMConnectionsServers StSObject) { Object returnval = ValidateSametimeServerUpdate(StSObject); try { if (returnval.ToString() == "") { return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.UpdateIBMConnectionsServers(StSObject)); } else { return(returnval); } } catch (Exception ex) { throw ex; } }
public Object insertdetail(IBMConnectionsServers insertObject) { //bool insert=false; Object returnVal = ValidateSametimeServerUpdate(insertObject); try { if (returnVal.ToString() == "") { return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.insertdetails(insertObject)); } else { return(returnVal); } } catch (Exception ex) { throw ex; } }
public IBMConnectionsServers GetdatawithId(IBMConnectionsServers IBMConnectionswithid) { DataTable getdatasametimedatatable = new DataTable(); IBMConnectionsServers returndata = new IBMConnectionsServers(); try { System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["VitalSignsConnectionString"].ToString()); System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand("select serverID from IBMConnectionsServers where serverID=" + IBMConnectionswithid.ID.ToString(), con); string maxid = string.Empty; try { con.Open(); object Maxserverid = com.ExecuteScalar(); if (Maxserverid != null) { maxid = Maxserverid.ToString(); } } catch { } finally { con.Close(); } if (!string.IsNullOrEmpty(maxid)) { //3/14/2016 NS modified for VSPLUS-2650 string query = "select st.ServerID stserverid,ISNULL(st.Category,'') Category,ISNULL(st.ProxyServerType,'') ProxyServerType,ISNULL(st.DBPort,'') DBPort,ISNULL(st.ProxyServerProtocall,'') ProxyServerProtocall," + "ISNULL(st.DBHostName ,'') DBHostName ,ISNULL(st.DBName,'') DBName,ISNULL(EnableDB2port,'false') EnableDB2port, " + "ISNULL(st.Enabled,0) Enabled, st.CredentialID, st.DBCredentialsID,ISNULL(st.ScanInterval,0) ScanInterval,ISNULL(OffHoursScanInterval,0) OffHoursScanInterval,st.ServerID ID," + "ISNULL(st.RetryInterval,0) RetryInterval,ISNULL(ResponseThreshold,0) ResponseThreshold," + "ISNULL(SSL,'false') SSL, s.ID SID,l.location Location,LocationID,IPAddress,ServerName Name,Description," + "ISNULL(st.FailureThreshold,0) FailureThreshold, st.ChatUser1CredentialsId,st.ChatUser2CredentialsId,ISNULL(st.TestChatSimulation,0) TestChatSimulation,ISNULL(st.PortNumber,0) PortNumber,ISNULL(st.URL,'') URL from " + "dbo.IBMConnectionsServers st right join Servers s on s.ID=st.serverID inner join Locations l on l.ID=s.LocationID " + " left outer join Credentials C1 on C1.ID=st.ChatUser1CredentialsId left outer join " + "Credentials C2 on C2.ID = st.ChatUser2CredentialsId " + "where ServerID=" + IBMConnectionswithid.ID.ToString(); string serverid = IBMConnectionswithid.ID.ToString(); getdatasametimedatatable = objAdaptor.FetchData(query); if (getdatasametimedatatable.Rows.Count > 0) { returndata.Name = getdatasametimedatatable.Rows[0]["Name"].ToString(); returndata.Description = getdatasametimedatatable.Rows[0]["Description"].ToString(); returndata.Category = getdatasametimedatatable.Rows[0]["Category"].ToString(); returndata.Enabled = Convert.ToBoolean(getdatasametimedatatable.Rows[0]["Enabled"]); returndata.ScanInterval = Convert.ToInt32(getdatasametimedatatable.Rows[0]["ScanInterval"]); returndata.OffHoursScanInterval = Convert.ToInt32(getdatasametimedatatable.Rows[0]["OffHoursScanInterval"]); returndata.Location = getdatasametimedatatable.Rows[0]["Location"].ToString(); returndata.RetryInterval = Convert.ToInt32(getdatasametimedatatable.Rows[0]["RetryInterval"]); returndata.ResponseThreshold = Convert.ToInt32(getdatasametimedatatable.Rows[0]["ResponseThreshold"]); returndata.IPAddress = getdatasametimedatatable.Rows[0]["IPAddress"].ToString(); returndata.SSL = Convert.ToBoolean(getdatasametimedatatable.Rows[0]["SSL"]); returndata.SID = Convert.ToInt32(getdatasametimedatatable.Rows[0]["stserverid"]); returndata.ProxyServerType = getdatasametimedatatable.Rows[0]["ProxyServerType"].ToString(); returndata.ProxyServerProtocall = getdatasametimedatatable.Rows[0]["ProxyServerProtocall"].ToString(); returndata.DBHostName = getdatasametimedatatable.Rows[0]["DBHostName"].ToString(); returndata.DBName = getdatasametimedatatable.Rows[0]["DBName"].ToString(); returndata.DBPort = getdatasametimedatatable.Rows[0]["DBPort"].ToString(); returndata.EnableDB2port = Convert.ToBoolean(getdatasametimedatatable.Rows[0]["EnableDB2port"]); returndata.PortNumber = Convert.ToInt32(getdatasametimedatatable.Rows[0]["PortNumber"]); returndata.URL = getdatasametimedatatable.Rows[0]["URL"].ToString(); if (getdatasametimedatatable.Rows[0]["CredentialID"].ToString() != "") { returndata.CredentialID = Convert.ToInt32(getdatasametimedatatable.Rows[0]["CredentialID"].ToString()); } if (getdatasametimedatatable.Rows[0]["DBCredentialsID"].ToString() != "") { returndata.DBCredentialsID = Convert.ToInt32(getdatasametimedatatable.Rows[0]["DBCredentialsID"].ToString()); } if (getdatasametimedatatable.Rows[0]["FailureThreshold"].ToString() != null) { returndata.FailureThreshold = Convert.ToInt32(getdatasametimedatatable.Rows[0]["FailureThreshold"]); } if (getdatasametimedatatable.Rows[0]["ChatUser1CredentialsId"].ToString() != "") { returndata.ChatUser1Credentials = Convert.ToInt32(getdatasametimedatatable.Rows[0]["ChatUser1CredentialsId"].ToString()); } if (getdatasametimedatatable.Rows[0]["ChatUser2CredentialsId"].ToString() != "") { returndata.ChatUser2Credentials = Convert.ToInt32(getdatasametimedatatable.Rows[0]["ChatUser2CredentialsId"].ToString()); } if (getdatasametimedatatable.Rows[0]["TestChatSimulation"].ToString() != "") { returndata.TestChatSimulation = Convert.ToBoolean(getdatasametimedatatable.Rows[0]["TestChatSimulation"].ToString()); } else { returndata.TestChatSimulation = false; } } } else { string q = "select servername as Name,Description,Location,IPAddress,s.ID ID from Servers s " + "inner join Locations l on l.ID=s.LocationID where s.ID=" + IBMConnectionswithid.ID; getdatasametimedatatable = objAdaptor.FetchData(q); returndata.Name = getdatasametimedatatable.Rows[0]["Name"].ToString(); returndata.Description = getdatasametimedatatable.Rows[0]["Description"].ToString(); returndata.Location = getdatasametimedatatable.Rows[0]["Location"].ToString(); returndata.IPAddress = getdatasametimedatatable.Rows[0]["IPAddress"].ToString(); returndata.SID = Convert.ToInt32(getdatasametimedatatable.Rows[0]["ID"]); returndata.Category = ""; } } catch (Exception ex) { throw ex; } finally { } return(returndata); }
public Object UpdateIBMConnectionsServers(IBMConnectionsServers IBMConnectionsServer) { #region comment #endregion Object updateIBMConnection; try { System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["VitalSignsConnectionString"].ToString()); System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand("select serverID from IBMConnectionsServers where serverID=" + IBMConnectionsServer.SID.ToString(), con); string maxid = string.Empty; try { con.Open(); object Maxserverid = com.ExecuteScalar(); if (Maxserverid != null) { maxid = Maxserverid.ToString(); } } catch { } finally { con.Close(); } if (!string.IsNullOrEmpty(maxid)) //if (maxid != "") { string query = "UPDATE IBMConnectionsServers set Category='" + IBMConnectionsServer.Category + "'," + "ProxyServerType='" + IBMConnectionsServer.ProxyServerType + "', ProxyServerProtocall = '" + IBMConnectionsServer.ProxyServerProtocall + "', DBHostName = '" + IBMConnectionsServer.DBHostName + "', " + "DBName = '" + IBMConnectionsServer.DBName + "',DBPort = '" + IBMConnectionsServer.DBPort + "',EnableDB2port='" + IBMConnectionsServer.EnableDB2port + "'," + "Enabled = '" + IBMConnectionsServer.Enabled + "', ScanInterval='" + IBMConnectionsServer.ScanInterval + "',OffHoursScanInterval='" + IBMConnectionsServer.OffHoursScanInterval + "', " + "RetryInterval='" + IBMConnectionsServer.RetryInterval + "', FailureThreshold ='" + IBMConnectionsServer.FailureThreshold + "', " + "ResponseThreshold='" + IBMConnectionsServer.ResponseThreshold + "', " + "SSL='" + IBMConnectionsServer.SSL + "', " + "CredentialID='" + IBMConnectionsServer.CredentialID + "'," + "TestChatSimulation='" + IBMConnectionsServer.TestChatSimulation + "',ChatUser1CredentialsId=" + IBMConnectionsServer.ChatUser1Credentials.ToString() + ",ChatUser2CredentialsId=" + IBMConnectionsServer.ChatUser2Credentials.ToString() + ", " + "URL = '" + IBMConnectionsServer.URL + "',DBCredentialsID = " + IBMConnectionsServer.DBCredentialsID + " ,PortNumber = " + IBMConnectionsServer.PortNumber + "" + " where ServerID ='" + IBMConnectionsServer.SID + "'"; updateIBMConnection = objAdaptor.ExecuteNonQuery(query); } else { string query = "Insert into IBMConnectionsServers(ServerID,Category," + "Enabled,ScanInterval,OffHoursScanInterval,RetryInterval,ResponseThreshold," + "SSL,FailureThreshold,CredentialID,ProxyServerType,ProxyServerProtocall,DBHostName" + "ChatUser1CredentialsId,ChatUser2CredentialsId,TestChatSimulation,DBCredentialsID,DBName,DBPort)" + " Values(" + IBMConnectionsServer.SID + ",'" + IBMConnectionsServer.Category + "','" + IBMConnectionsServer.Enabled + "'," + "'" + IBMConnectionsServer.ScanInterval + "','" + IBMConnectionsServer.OffHoursScanInterval + "','" + IBMConnectionsServer.RetryInterval + "'," + "'" + IBMConnectionsServer.ResponseThreshold + "','" + IBMConnectionsServer.SSL + "','" + IBMConnectionsServer.FailureThreshold + "', '" + IBMConnectionsServer.CredentialID + "'," + "'" + IBMConnectionsServer.ProxyServerType + "','" + IBMConnectionsServer.ProxyServerProtocall + "','" + IBMConnectionsServer.DBHostName + "', " + "'" + IBMConnectionsServer.DBName + "','" + IBMConnectionsServer.DBPort + "','" + IBMConnectionsServer.EnableDB2port + "', " + "'" + IBMConnectionsServer.URL + "', " + IBMConnectionsServer.PortNumber + ", " + "" + IBMConnectionsServer.ChatUser1Credentials.ToString() + "," + IBMConnectionsServer.ChatUser2Credentials.ToString() + ",'" + IBMConnectionsServer.TestChatSimulation + "'," + IBMConnectionsServer.DBCredentialsID + ")"; updateIBMConnection = objAdaptor.ExecuteNonQuery(query); } } catch { updateIBMConnection = false; } return(updateIBMConnection); }