コード例 #1
0
        public Object Deletecell(WebsphereCell cell)
        {
            Object Delete;

            try
            {
                string SqlQuery = "delete from Servers where ServerName in (select ServerName from WebSphereServer where CellId=" + cell.CellID + ") and ServerTypeID=22;" +
                                  "delete from WebSphereServer where CellID=" + cell.CellID + ";" +
                                  "delete from WebSphereNode where CellID=" + cell.CellID + ";" +
                                  "delete from WebSphereCellStats where CellID=" + cell.CellID + ";" +
                                  "delete from WebSphereCell where CellID=" + cell.CellID + ";";


                //Delete = objAdaptor.ExecuteNonQuery(S);
                //string s1 = "Delete from AlertDeviceTypes where AlertKey=" + Alert.AlertKey;
                //Delete = objAdaptor.ExecuteNonQuery(s1);
                //string s2 = "Delete from AlertEvents where AlertKey=" + Alert.AlertKey;
                //Delete = objAdaptor.ExecuteNonQuery(s2);
                //string s3 = "Delete from AlertLocations where AlertKey=" + Alert.AlertKey;
                //Delete = objAdaptor.ExecuteNonQuery(s3);
                //string s4 = "Delete from AlertServers where AlertKey=" + Alert.AlertKey;
                //Delete = objAdaptor.ExecuteNonQuery(s4);
                //string SqlQuery = "Delete from AlertNames where AlertKey=" + Alert.AlertKey;
                Delete = objAdaptor.ExecuteNonQuery(SqlQuery);
            }
            catch
            {
                Delete = false;
            }
            finally
            {
            }

            return(Delete);
        }
コード例 #2
0
        protected void webspherecellgrid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            WebsphereCell webcellobj = new WebsphereCell();

            webcellobj.CellID = Convert.ToInt32(e.Keys[0]);
            try
            {
                VSWebBL.ConfiguratorBL.WebsphereCellBL.Ins.Deletecell(webcellobj);
            }
            catch (Exception ex)
            {
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
            }
            ASPxGridView gridview = (ASPxGridView)sender;

            gridview.CancelEdit();
            e.Cancel = true;
            fillGrid();
            if (Session["Treeviewvisibility"].ToString() == "true")
            {
                CollapseAllButton.Visible = false;
                ImportButton.Visible      = false;
                NodesTreeList.Visible     = false;
            }
            else
            {
                CollapseAllButton.Visible = true;
                ImportButton.Visible      = true;
                NodesTreeList.Visible     = true;
            }
        }
コード例 #3
0
        public bool InsertData1(WebsphereCell STSettingsObject, int key)
        {
            int    cellid;
            int    Insert    = 0;
            bool   retInsert = false;
            string Cellname  = STSettingsObject.CellName;

            //DataTable dt = new DataTable();
            //string sqlqury = "select * from WebsphereCell where CellName= '" + STSettingsObject.CellName + "'";
            //dt = objAdaptor.FetchData(sqlqury);
            try
            {
                //    if (dt.Rows.Count > 0)
                //    {
                //cellid = Convert.ToInt32(dt.Rows[0]["CellID"]);
                if (STSettingsObject.CellID != null && STSettingsObject.CellID != 0)
                {
                    string SqlQuery2 = "UPDATE WebsphereCell set Name='" + STSettingsObject.Name + "',HostName='" + STSettingsObject.HostName + "',ConnectionType='" + STSettingsObject.ConnectionType +
                                       "',PortNo='" + STSettingsObject.PortNo + "',GlobalSecurity='" + STSettingsObject.GlobalSecurity + "',CredentialsID=" + STSettingsObject.CredentialsID + ",Realm='" + STSettingsObject.Realm.ToString() + "' where CellID=" + Convert.ToInt32(STSettingsObject.CellID.ToString()) + "";

                    //"' where CellID=" + dt.Rows[0]["cellid"] + "";
                    Insert = objAdaptor.ExecuteNonQueryRetRows(SqlQuery2);
                }
                //    }
            }
            catch
            {
                Insert = 0;
            }
            if (Insert == 0)
            {
                try
                {
                    if (STSettingsObject.CellID == 0)
                    {
                        string SqlQuery;

                        SqlQuery = "INSERT INTO WebsphereCell(Name,HostName,ConnectionType,PortNo,GlobalSecurity,CredentialsID,Realm,IBMConnectionSID) VALUES('"
                                   + STSettingsObject.Name + "','" + STSettingsObject.HostName + "','" + STSettingsObject.ConnectionType + "'," + STSettingsObject.PortNo +
                                   ",'" + STSettingsObject.GlobalSecurity + "'," + STSettingsObject.CredentialsID + ",'" + STSettingsObject.Realm + "'," + key + ")";

                        Insert = objAdaptor.ExecuteNonQueryRetRows(SqlQuery);
                    }
                }
                catch
                {
                    Insert = 0;
                }
            }
            if (Insert == 1)
            {
                retInsert = true;
            }
            return(retInsert);
        }
コード例 #4
0
 public bool InsertData(WebsphereCell STSettingsObject, int key)
 {
     try
     {
         return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.InsertData1(STSettingsObject, key));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
ファイル: SametimeServerBL.cs プロジェクト: ImranVS/SVNGIT
 public DataTable Getwebspherecell(WebsphereCell Stobj)
 {
     try
     {
         return(VSWebDAL.ConfiguratorDAL.SametimeServersDAL.Ins.Getwebspherecell(Stobj));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
 public Object Deletecell(WebsphereCell cell)
 {
     try
     {
         return(VSWebDAL.ConfiguratorDAL.WebspehereCellDAL.Ins.Deletecell(cell));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #7
0
 public DataTable GetcellID(WebsphereCell Stobj)
 {
     try
     {
         return(VSWebDAL.ConfiguratorDAL.IBMConnectionsServersDAL.Ins.GetcellID(Stobj));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #8
0
ファイル: webspehereImportBL.cs プロジェクト: ImranVS/SVNGIT
 public bool InsertData(WebsphereCell STSettingsObject)
 {
     try
     {
         return(VSWebDAL.SecurityDAL.webspehereimportDAL.Ins.InsertData1(STSettingsObject));
     }
     catch (Exception ex)
     {
         throw ex;
     }
     //return VSWebDAL.SecurityDAL.ServersDAL.Ins.UpdateData(ServerObject);
 }
コード例 #9
0
        protected void btn_Click(object sender, EventArgs e)
        {
            ImageButton btn = (ImageButton)sender;

            WebsphereCell webcellobj = new WebsphereCell();

            WebsphereCellID = Convert.ToInt32(btn.CommandArgument);
            string name = btn.AlternateText;

            pnlAreaDtls.Style.Add("visibility", "visible");
            divmsg.InnerHtml = "Are you sure you want to delete the WebSphere Cell  " + name + "?";
        }
コード例 #10
0
        protected void btn_OkClick(object sender, EventArgs e)
        {
            WebsphereCell webcellobj = new WebsphereCell();

            webcellobj.CellID = WebsphereCellID;
            VSWebBL.ConfiguratorBL.WebsphereCellBL.Ins.Deletecell(webcellobj);

            fillGrid();


            Site1 currMaster = (Site1)this.Master;

            currMaster.refreshStatusBoxes();
        }
コード例 #11
0
ファイル: webspehereimportDAL.cs プロジェクト: ImranVS/SVNGIT
        public bool InsertData1(WebsphereCell STSettingsObject)
        {
            int    cellid;
            int    Insert    = 0;
            bool   retInsert = false;
            string Cellname  = STSettingsObject.CellName;

            try
            {
                if (STSettingsObject.CellID != null)
                {
                    string SqlUpdate = "";
                    string SqlInsert = "";

                    if (STSettingsObject.CredentialsID != 0)
                    {
                        SqlUpdate = "UPDATE WebsphereCell set Name='" + STSettingsObject.Name + "',HostName='" + STSettingsObject.HostName + "',ConnectionType='" + STSettingsObject.ConnectionType +
                                    "',PortNo='" + STSettingsObject.PortNo + "',Credentialsid='" + STSettingsObject.CredentialsID + "',GlobalSecurity='" + STSettingsObject.GlobalSecurity + "',Realm='" + STSettingsObject.Realm + "'  where CellID=" + STSettingsObject.CellID.ToString() + "";

                        SqlInsert = "INSERT INTO WebsphereCell(Name,HostName,ConnectionType,PortNo,GlobalSecurity,Credentialsid,Realm) VALUES('"
                                    + STSettingsObject.Name + "','" + STSettingsObject.HostName + "','" + STSettingsObject.ConnectionType + "'," + STSettingsObject.PortNo +
                                    ",'" + STSettingsObject.GlobalSecurity + "','" + STSettingsObject.CredentialsID + "','" + STSettingsObject.Realm + "')";
                    }
                    else
                    {
                        SqlUpdate = "UPDATE WebsphereCell set Name='" + STSettingsObject.Name + "',HostName='" + STSettingsObject.HostName + "',ConnectionType='" + STSettingsObject.ConnectionType +
                                    "',PortNo='" + STSettingsObject.PortNo + "',GlobalSecurity='" + STSettingsObject.GlobalSecurity + "',Realm='" + STSettingsObject.Realm + "'  where CellID=" + STSettingsObject.CellID.ToString() + "";

                        SqlInsert = "INSERT INTO WebsphereCell(Name,HostName,ConnectionType,PortNo,GlobalSecurity,Realm) VALUES('"
                                    + STSettingsObject.Name + "','" + STSettingsObject.HostName + "','" + STSettingsObject.ConnectionType + "'," + STSettingsObject.PortNo +
                                    ",'" + STSettingsObject.GlobalSecurity + "','" + STSettingsObject.Realm + "')";
                    }

                    string sql = "IF EXISTS(SELECT * FROM WebsphereCell WHERE CellID=" + STSettingsObject.CellID.ToString() + ") BEGIN " +
                                 SqlUpdate + "; END ELSE BEGIN " + SqlInsert + "; END";

                    if (objAdaptor.ExecuteNonQueryRetRows(sql) > 0)
                    {
                        retInsert = true;
                    }
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
            return(retInsert);
        }
コード例 #12
0
        public DataTable GetcellID(WebsphereCell Stobj)
        {
            //SametimeServers SametimeObj = new SametimeServers();
            DataTable sametimeTable = new DataTable();

            try
            {
                string sqlQuery = "Select * from WebsphereCell where IBMConnectionSID='" + Stobj.IBMConnectionSID + "'";
                sametimeTable = objAdaptor.FetchData(sqlQuery);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(sametimeTable);
        }
コード例 #13
0
ファイル: webspehereimportDAL.cs プロジェクト: ImranVS/SVNGIT
        public DataTable GetcellinfobyIDandport(string IP, int portno)
        {
            DataTable     WebsphereCellDataTable = new DataTable();
            WebsphereCell ReturnLOCbject         = new WebsphereCell();

            try
            {
                string SqlQuery = "SELECT * FROM WebsphereCell where HostName='" + IP + "' and PortNo=" + portno;

                WebsphereCellDataTable = objAdaptor.FetchData(SqlQuery);
            }
            catch
            {
            }
            finally
            {
            }
            return(WebsphereCellDataTable);
        }
コード例 #14
0
ファイル: webspehereimportDAL.cs プロジェクト: ImranVS/SVNGIT
        public DataTable GetSpecificCellData(int id)
        {
            DataTable     WebsphereCellDataTable = new DataTable();
            WebsphereCell ReturnLOCbject         = new WebsphereCell();

            try
            {
                //Mukund removed Sharepoint from 'not in'
                string SqlQuery = "SELECT * FROM WebsphereCell where CellID='" + id + "'";

                WebsphereCellDataTable = objAdaptor.FetchData(SqlQuery);
            }
            catch
            {
            }
            finally
            {
            }
            return(WebsphereCellDataTable);
        }
コード例 #15
0
ファイル: webspehereimportDAL.cs プロジェクト: ImranVS/SVNGIT
        public DataTable GetNodeName(int CellID)
        {
            DataTable     WebsphereNodeDataTable = new DataTable();
            WebsphereCell ReturnLOCbject         = new WebsphereCell();

            try
            {
                //Mukund removed Sharepoint from 'not in'
                //string SqlQuery = "SELECT NodeName,NodeID from WebsphereNode Where CellID = " + CellID + " ";
                string SqlQuery = "SELECT * from WebsphereNode Where CellID = " + CellID + " ";
                WebsphereNodeDataTable = objAdaptor.FetchData(SqlQuery);
            }
            catch
            {
            }
            finally
            {
            }
            return(WebsphereNodeDataTable);
        }
コード例 #16
0
ファイル: webspehereimportDAL.cs プロジェクト: ImranVS/SVNGIT
        public DataTable GetCellIdBynmae(string Name)
        {
            DataTable     WebsphereCellDataTable = new DataTable();
            WebsphereCell ReturnLOCbject         = new WebsphereCell();

            try
            {
                //Mukund removed Sharepoint from 'not in'
                string SqlQuery = "SELECT * FROM WebsphereCell where CellName='" + Name + "'";

                WebsphereCellDataTable = objAdaptor.FetchData(SqlQuery);
            }
            catch
            {
            }
            finally
            {
            }
            return(WebsphereCellDataTable);
        }
コード例 #17
0
        //protected void fileupld_FileUploadComplete(object sender, FileUploadCompleteEventArgs e)
        //{

        //    try
        //    {
        //        //string fileExtension = Path.GetExtension(uploadedFile.FileName);
        //        e.CallbackData = SavePostedFile(e.UploadedFile);



        //    }
        //    catch (Exception ex)
        //    {
        //        e.IsValid = false;
        //        e.ErrorText = ex.Message;
        //    }
        //    e.CallbackData = SavePostedFile(e.UploadedFile);


        //}



        //string SavePostedFile(UploadedFile uploadedFile)
        //{
        //    string logPath = "";

        //    //fileupld.SaveAs(Server.MapPath("~/LogFiles/" + uploadedFile.FileName));
        //    // fileupld.SaveAs(logPath + uploadedFile.FileName);
        //    //string fileName1 = Path.Combine(MapPath("~/log_files/") + uploadedFile.FileName);
        //    fileName1 = "../LogFiles/" + uploadedFile.FileName;// Path.Combine(logPath + uploadedFile.FileName);

        //    string fileExtension = Path.GetExtension(uploadedFile.FileName);
        //    string path = Path.GetFullPath(uploadedFile.FileName);
        //    Session["path"] = path;

        //    return fileName1;
        //}
        public void Insertdata()
        {
            bool          ReturnValue;
            WebsphereCell webspehereObject = new WebsphereCell();

            if (Session["cellid"] != null)
            {
                //webspehereObject.CellID = int.Parse(Request.QueryString["CellID"].ToString());
                webspehereObject.CellID = int.Parse(Session["cellid"].ToString());
                Session["CellID"]       = Session["cellid"];
                //webspehereObject.CellID = Convert.ToInt32(Session["CellID"].ToString());
            }

            webspehereObject.Name           = CellnameTextBox.Text;
            webspehereObject.ConnectionType = ConnectionComboBox.Text;

            webspehereObject.GlobalSecurity = chbx.Checked;
            webspehereObject.HostName       = HostName.Text;
            webspehereObject.PortNo         = Convert.ToInt32(porttextbox.Text);
            //webspehereObject.Certification = fileName1;
            if (chbx.Checked == true)
            {
                DataTable dt = VSWebBL.SecurityBL.webspehereImportBL.Ins.GetCredentialValue(CredentialsComboBox.Text);
                webspehereObject.CredentialsID = Convert.ToInt32(dt.Rows[0]["ID"].ToString());
                //if (fileName1 == null)
                //{
                //    webspehereObject.Certification = "";
                //}


                webspehereObject.Realm = realmtxtbx.Text;
            }

            ReturnValue = VSWebBL.SecurityBL.webspehereImportBL.Ins.InsertData(webspehereObject);
            if (ReturnValue == true)
            {
                //successDiv.Style.Value = "display: block";
                Response.Redirect("WebsphereCellGrid.aspx", false);
                Context.ApplicationInstance.CompleteRequest();
            }
        }
コード例 #18
0
        protected void btn_Clickeditserver(object sender, EventArgs e)
        {
            int ID;

            ImageButton btn = (ImageButton)sender;

            ID = Convert.ToInt32(btn.CommandArgument);
            int           id = ID;
            WebsphereCell ProfileNamesObject = new WebsphereCell();

            if (id != null)
            {
                ProfileNamesObject.CellID = id;
            }

            bool s = true;

            if (s == true)
            {
                DataTable celldt = VSWebBL.SecurityBL.webspehereImportBL.Ins.GetSpecificCellData(id);
                Session["webcellid"] = id;
                VitalSignsWebSphereDLL.VitalSignsWebSphereDLL WSDll = new VitalSignsWebSphereDLL.VitalSignsWebSphereDLL();
                VitalSignsWebSphereDLL.VitalSignsWebSphereDLL.CellProperties cellFromInfo = new VitalSignsWebSphereDLL.VitalSignsWebSphereDLL.CellProperties();

                //Set properties for Cell to pass to DLL
                cellFromInfo.HostName       = celldt.Rows[0]["HostName"].ToString();
                cellFromInfo.Port           = Convert.ToInt32(celldt.Rows[0]["PortNo"].ToString());
                cellFromInfo.ConnectionType = celldt.Rows[0]["ConnectionType"].ToString();
                cellFromInfo.Realm          = celldt.Rows[0]["Realm"].ToString();
                //int credid = Convert.ToInt32(celldt.Rows[0][""].ToString());
                Credentials creds = new Credentials();
                //creds.AliasName = CredentialsComboBox.Text.ToString();
                creds.ID = Convert.ToInt32(celldt.Rows[0]["CredentialsID"].ToString());

                DataTable dt = VSWebBL.ConfiguratorBL.CredentialsBL.Ins.getCredentialsById(creds);
                if (dt.Rows.Count > 0)
                {
                    string   password;
                    string   MyObjPwd;
                    string[] MyObjPwdArr;
                    byte[]   MyPass;
                    MyObjPwd = dt.Rows[0]["Password"].ToString();

                    MyObjPwdArr = MyObjPwd.Split(',');
                    MyPass      = new byte[MyObjPwdArr.Length];
                    for (int i = 0; i < MyObjPwdArr.Length; i++)
                    {
                        MyPass[i] = Byte.Parse(MyObjPwdArr[i]);
                    }

                    VSFramework.TripleDES tripleDes = new VSFramework.TripleDES();
                    password = tripleDes.Decrypt(MyPass);

                    cellFromInfo.UserName = dt.Rows[0]["UserID"].ToString();
                    cellFromInfo.Password = password;
                }
                else
                {
                    throw new Exception("Username and Password could not be retreived");
                }

                cellFromInfo.ID = id;

                //Call
                VitalSignsWebSphereDLL.VitalSignsWebSphereDLL.Cells cells = null;
                try
                {
                    cells = WSDll.getServerList(cellFromInfo);
                    foreach (VitalSignsWebSphereDLL.VitalSignsWebSphereDLL.Cell cell in cells.Cell)
                    {
                        bool ReturnValue;
                        ReturnValue = VSWebBL.SecurityBL.webspehereImportBL.Ins.Insertwebspherenodesandservers(cell, id);
                        if (ReturnValue == true)
                        {
                            NodesTreeList.Visible     = true;
                            CollapseAllButton.Visible = true;
                            ImportButton.Visible      = true;
                            //expandButton();
                        }
                        else
                        {
                            NodesTreeList.Visible     = false;
                            CollapseAllButton.Visible = false;
                            ImportButton.Visible      = false;
                        }
                    }
                }
                catch (Exception ex)
                {
                    errorDivForImportingWS.Style.Value = "display: block";
                    errorDivForImportingWS.InnerHtml   = "An error occurred. " + ex.Message +
                                                         "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    return;
                }


                //checks to see if a connection was successfully made
                //cells should never be null, it should hti the return before it is null and hits this spot
                if (cells != null && cells.Connection_Status != "CONNECTED")
                {
                    errorDivForImportingWS.Style.Value = "display: block";
                    errorDivForImportingWS.InnerHtml   = "A connection was not able to be made." +
                                                         "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    return;
                }
                else
                {
                    errorDivForImportingWS.Style.Value = "display: none";

                    ///////////////////////////////////////////////////////////////////////
                    //This is where the population of the tree graph should be
                    ///////////////////////////////////////////////////////////////////////



                    // 6/22/15 WS commented out for it not being needed anymore.  All insertion of data should be done on the OK press now (Which will be taken care of by Mukund and his team)
                    //Insertdata();
                }
                fillNodesTreeListbycellID(id);
                //FillWebsphereNodeStatusGrid(id);
                //    {
                //        int index = NodesTreeList.FocusedRowIndex;
                //        if (index > -1)
                //        {
                //            nodevalue = Convert.ToInt32(NodesTreeList.GetRowValues(index, "NodeID").ToString());
                //        }
                //    }
                //    //Response.Redirect("~/Configurator/EditProfiles.aspx?id=" + id.ToString(), false);
                //    //Context.ApplicationInstance.CompleteRequest();
            }
            //DecodeCellsXML("C:\\Program Files (x86)\\IBM\\WebSphere\\AppClient\\VitalSigns\\xml\\AppServerList.xml");
        }