Example #1
0
        //    Credentials c = new Credentials();
        //    c.AliasName = CredentialsComboBox.Text;
        //    DataTable Dt = VSWebBL.ConfiguratorBL.CredentialsBL.Ins.getCredentialsByName(c);
        //    UserIdtextBox.Text = Dt.Rows[0]["UserID"].ToString();
        //    VSFramework.TripleDES tripleDes = new VSFramework.TripleDES();
        //    string MyObjPwd;
        //    string[] MyObjPwdArr;
        //    byte[] MyPass;
        //    MyObjPwd = Dt.Rows[0]["Password"].ToString();
        //    if (MyObjPwd != "")
        //    {
        //        MyObjPwdArr = MyObjPwd.Split(',');
        //        MyPass = new byte[MyObjPwdArr.Length];
        //        for (int i = 0; i < MyObjPwdArr.Length; i++)
        //        {
        //            MyPass[i] = Byte.Parse(MyObjPwdArr[i]);
        //        }
        //        PasswordTextbox.Text = tripleDes.Decrypt(MyPass);
        //        //ViewState.Add("Pwd", PasswordTextbox.Text);
        //        addPwd = tripleDes.Decrypt(MyPass);
        //    }
        //    //getCredentials();
        //}

        private ArrayList getCredentials()
        {
            ArrayList   Cred = new ArrayList();
            Credentials c    = new Credentials();

            c.AliasName = CredentialsComboBox.Text;
            DataTable Dt = VSWebBL.ConfiguratorBL.CredentialsBL.Ins.getCredentialsById(c);

            Cred.Add(Dt.Rows[0]["UserID"].ToString());
            //UserIdtextBox.Text = Dt.Rows[0]["UserID"].ToString();
            VSFramework.TripleDES tripleDes = new VSFramework.TripleDES();
            string MyObjPwd;

            string[] MyObjPwdArr;
            byte[]   MyPass;
            MyObjPwd = Dt.Rows[0]["Password"].ToString();
            if (MyObjPwd != "")
            {
                MyObjPwdArr = MyObjPwd.Split(',');
                MyPass      = new byte[MyObjPwdArr.Length];
                for (int i = 0; i < MyObjPwdArr.Length; i++)
                {
                    MyPass[i] = Byte.Parse(MyObjPwdArr[i]);
                }
                //PasswordTextbox.Text = tripleDes.Decrypt(MyPass);
                Cred.Add(tripleDes.Decrypt(MyPass));
                //PasswordTextbox.Text = tripleDes.Decrypt(MyPass);
                //ViewState.Add("Pwd", PasswordTextbox.Text);
            }
            return(Cred);
        }
Example #2
0
        protected void CurrValButton_Click(object sender, EventArgs e)
        {
            //CurrentValue();
            //11//2014 NS added for VSPLUS-1133
            byte[] MyPass;
            string MyDominoPassword; //should be string
            string MyObjPwd;

            string[] MyObjPwdArr;
            VSFramework.TripleDES mySecrets = new VSFramework.TripleDES();
            try
            {
                MyObjPwd = VSWebBL.SettingBL.SettingsBL.Ins.Getvalue("Password");
                if (MyObjPwd != "")
                {
                    MyObjPwdArr = MyObjPwd.Split(',');
                    MyPass      = new byte[MyObjPwdArr.Length];
                    for (int i = 0; i < MyObjPwdArr.Length; i++)
                    {
                        MyPass[i] = Byte.Parse(MyObjPwdArr[i]);
                    }
                }
                else
                {
                    //10/6/2014 NS modified for VSPLUS-990
                    errorDiv.InnerHtml = "The following error has occurred: Notes password may not be empty. Please update the password under Stored Passwords & Options\\IBM Domino Settings." +
                                         "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    errorDiv.Style.Value = "display: block";
                    MyPass = null;
                }
            }
            catch (Exception ex)
            {
                errorDiv.InnerHtml = "The following error has occurred: " + ex.Message +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                errorDiv.Style.Value = "display: block";
                MyPass = null;
                //5/15/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            try
            {
                if (MyPass != null)
                {
                    MyDominoPassword = mySecrets.Decrypt(MyPass);
                }
                else
                {
                    MyDominoPassword = null;
                }
            }
            catch (Exception ex)
            {
                errorDiv.InnerHtml = "The following error has occurred: " + ex.Message +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                errorDiv.Style.Value = "display: block";
                MyDominoPassword     = "";
                //5/15/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            //3/25/2014 NS modified for VSPLUS-494
            if (MyDominoPassword != null)
            {
                Domino.NotesSession NotesSessionObject = new Domino.NotesSession();
                try
                {
                    NotesSessionObject.Initialize(MyDominoPassword);
                    CurrentValTextBox.Text = NotesSessionObject.SendConsoleCommand(DServerComboBox.Text, "sh stat " + DStatComboBox.Text);
                }
                catch (Exception ex)
                {
                    //7/8/2013 NS modified - the code now handles an exception gracefully
                    //throw ex;
                    //11/3/2014 NS modified

                    /*
                     * ErrorMessageLabel.Text = "Notes session could not be initialized.";
                     * ErrorMessagePopupControl.HeaderText = "Initialization Failure";
                     * ValidationUpdatedButton.Visible = true;
                     * ValidationOkButton.Visible = false;
                     * ErrorMessagePopupControl.ShowOnPageLoad = true;
                     */
                    //11/3/2014 NS added for VSPLUS-990
                    errorDiv.InnerHtml = "The following error has occurred: " + ex.Message +
                                         "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    errorDiv.Style.Value = "display: block";
                    //6/27/2014 NS added for VSPLUS-634
                    Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                }
                finally { }
                System.Runtime.InteropServices.Marshal.ReleaseComObject(NotesSessionObject);
            }
        }
Example #3
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");
        }
Example #4
0
        private void FillData(int ID)
        {
            try
            {
                string         MyObjPwd;
                string[]       MyObjPwdArr;
                byte[]         MyPass;
                NetworkDevices NetworkDevicesObject = new NetworkDevices();
                NetworkDevices ReturnObject         = new NetworkDevices();
                NetworkDevicesObject.ID = ID;

                ReturnObject                       = VSWebBL.ConfiguratorBL.NetworkDevicesBL.Ins.GetData(NetworkDevicesObject);
                NameTextBox.Text                   = ReturnObject.Name;
                IPTextBox.Text                     = ReturnObject.Address;
                DescriptionTextBox.Text            = ReturnObject.Description;
                CategoryTextBox.Text               = ReturnObject.Category;
                EnabledCheckBox.Checked            = ReturnObject.Enabled;
                IncludeOnDashBoardCheckBox.Checked = ReturnObject.IncludeOnDashBoard;
                LocComboBox.Text                   = ReturnObject.Location;
                Img1.Src = ReturnObject.ImageURL;
                //if (Img1.Src != null)
                //{
                //    checkbx.Checked = true;

                //}
                //if (checkbx.Checked)
                //{
                CredentialsComboBox.Visible = true;
                //}
                CredentialsComboBox.Text = ReturnObject.imagename;

                //// LocationTextBox.Text = ReturnObject.Location;
                ScanIntervalTextBox.Text  = ReturnObject.ScanningInterval.ToString();
                OffScanTextBox.Text       = ReturnObject.OffHoursScanInterval.ToString();
                RetryIntervalTextBox.Text = ReturnObject.RetryInterval.ToString();
                ResponseThrTextBox.Text   = ReturnObject.ResponseThreshold.ToString();
                NetworkTypeCombobox.Text  = ReturnObject.NetworkType == null ? "" : ReturnObject.NetworkType.ToString();

                UserNameTextBox.Text = ReturnObject.Username == null ? "" : ReturnObject.Username;
                PasswordTextBox.Text = ReturnObject.Password == null ? "" : ReturnObject.Password;
                if (PasswordTextBox.Text != "" && PasswordTextBox.Text != null)
                {
                    PasswordTextBox.Text = "      ";
                }
                else
                {
                    PasswordTextBox.Text = "";
                }

                MyObjPwd = ReturnObject.Password == null ? "" : ReturnObject.Password;
                //if (MyObjPwd != "")
                //{
                //    MyObjPwdArr = MyObjPwd.Split(',');
                //    MyPass = new byte[MyObjPwdArr.Length];
                //    for (int j = 0; j < MyObjPwdArr.Length; j++)
                //    {
                //        MyPass[j] = Byte.Parse(MyObjPwdArr[j]);
                //    }
                //    ViewState["PWD"] = tripleDes.Decrypt(MyPass);
                //}


                if (MyObjPwd != "")
                {
                    MyObjPwdArr = MyObjPwd.Split(',');
                    MyPass      = new byte[MyObjPwdArr.Length];

                    try
                    {
                        for (int j = 0; j < MyObjPwdArr.Length; j++)
                        {
                            MyPass[j] = Byte.Parse(MyObjPwdArr[j]);
                        }
                        ViewState["PWD"] = tripleDes.Decrypt(MyPass);
                    }
                    catch (Exception ex)
                    {
                        if (ex.Message == "Input string was not in a correct format.")
                        {
                            ViewState["PWD"] = MyObjPwd;
                        }
                    }
                }



                //TripleDES tripleDES = new TripleDES();
                //byte[] encryptedPass=  ReturnObject.Password;
                //string pwd = tripleDES.Decrypt(encryptedPass);
                //PasswordTextBox.Text = pwd;
                //PasswordTextBox.Attributes.Add("value",ReturnObject.Password.ToString());
            }
            catch (Exception ex)
            {
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }
Example #5
0
        public void LoadDominoServers()
        {
            Domino.NotesDbDirectory dir;
            Domino.NotesDatabase    db;
            Domino.NotesView        view;
            Domino.NotesDocument    doc;
            Domino.NotesName        sname;
            Domino.NotesItem        item;
            Domino.NotesItem        item2;
            byte[] MyPass;
            string MyDominoPassword; //should be string
            string MyObjPwd;

            string[] MyObjPwdArr;
            //1/8/2014 NS added
            DataTable importedDT;
            //12/24/2013 NS added - store the value of the Domino Server field in the Settings table Primary Server column
            bool updatedsrv = false;

            updatedsrv = VSWebBL.SettingBL.SettingsBL.Ins.UpdateSvalue("Primary Server", DomServerTextBox.Text, VSWeb.Constants.Constants.SysString);
            //object MyObjPwd;
            //12/20/2013 NS added
            errorDiv.Style.Value = "display: none;";
            //8/12/2014 NS added for VSPLUS-861
            errorinfoDiv.Style.Value = "display: none";
            DataTable LocationsDataTable = new DataTable();

            LocationsDataTable = VSWebBL.SecurityBL.LocationsBL.Ins.GetAllData();
            if (LocationsDataTable.Rows.Count > 0)
            {
                LocComboBox.DataSource = LocationsDataTable;
                LocComboBox.TextField  = "Location";
                LocComboBox.ValueField = "Location";
                LocComboBox.DataBind();
                LocIDComboBox.DataSource = LocationsDataTable;
                LocIDComboBox.TextField  = "ID";
                LocIDComboBox.ValueField = "ID";
                LocIDComboBox.DataBind();
                VSFramework.TripleDES mySecrets = new VSFramework.TripleDES();
                try
                {
                    MyObjPwd = VSWebBL.SettingBL.SettingsBL.Ins.Getvalue("Password");
                    //3/25/2014 NS modified for VSPLUS-494
                    if (MyObjPwd != "")
                    {
                        MyObjPwdArr = MyObjPwd.Split(',');
                        MyPass      = new byte[MyObjPwdArr.Length];
                        for (int i = 0; i < MyObjPwdArr.Length; i++)
                        {
                            MyPass[i] = Byte.Parse(MyObjPwdArr[i]);
                        }
                    }
                    else
                    {
                        //10/6/2014 NS modified for VSPLUS-990
                        errorDiv.InnerHtml = "The following error has occurred: Notes password may not be empty. Please update the password under Stored Passwords & Options\\IBM Domino Settings." +
                                             "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                        errorDiv.Style.Value = "display: block";
                        MyPass = null;
                    }
                }
                catch (Exception ex)
                {
                    //12/20/2013 NS added
                    //10/6/2014 NS modified for VSPLUS-990
                    errorDiv.InnerHtml = "The following error has occurred: " + ex.Message +
                                         "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    errorDiv.Style.Value = "display: block";
                    //8/12/2014 NS added for VSPLUS-861
                    errorinfoDiv.Style.Value = "display: block";
                    MyPass = null;
                    //5/15/2014 NS added for VSPLUS-634
                    Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                    throw ex;
                }

                try
                {
                    if (MyPass != null)
                    {
                        MyDominoPassword = mySecrets.Decrypt(MyPass);
                    }
                    else
                    {
                        MyDominoPassword = null;
                    }
                }
                catch (Exception ex)
                {
                    //12/20/2013 NS added
                    //10/6/2014 NS modified for VSPLUS-990
                    errorDiv.InnerHtml = "The following error has occurred: " + ex.Message +
                                         "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    errorDiv.Style.Value = "display: block";
                    //8/12/2014 NS added for VSPLUS-861
                    errorinfoDiv.Style.Value = "display: block";
                    MyDominoPassword         = "";
                    //5/15/2014 NS added for VSPLUS-634
                    Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                    throw ex;
                }
                //3/25/2014 NS modified for VSPLUS-494
                if (MyDominoPassword != null)
                {
                    try
                    {
                        Domino.NotesSession NotesSessionObject = new Domino.NotesSession();
                        NotesSessionObject.Initialize(MyDominoPassword);
                        dir = NotesSessionObject.GetDbDirectory(DomServerTextBox.Text);
                        //db = dir.GetFirstDatabase(Domino.DB_TYPES.NOTES_DATABASE);
                        db   = dir.OpenDatabase("names.nsf");
                        view = db.GetView("($Servers)");
                        doc  = view.GetFirstDocument();
                        DataTable dt = new DataTable();
                        DataRow   dr = dt.NewRow();
                        //1/8/2014 NS added
                        DataRow[] foundRows;
                        dt.Columns.Add("ServerName", typeof(string));
                        dt.Columns.Add("IPAddress", typeof(string));
                        //1/8/2014 NS added - get a list of all servers already imported. Display only the ones that have not yet been imported.
                        importedDT = VSWebBL.ConfiguratorBL.AlertsBL.Ins.GetServer();
                        while (doc != null)
                        {
                            item             = doc.GetFirstItem("ServerName");
                            sname            = NotesSessionObject.CreateName(item.Text);
                            dr["ServerName"] = sname.Abbreviated;
                            //1/8/2014 NS added
                            foundRows = importedDT.Select("ServerName = '" + sname.Abbreviated + "'");
                            if (foundRows.Length == 0)
                            {
                                //5/16/2013 NS modified
                                //item = doc.GetFirstItem("NetAddresses");
                                item            = doc.GetFirstItem("SMTPFullHostDomain");
                                dr["IPAddress"] = item.Text;
                                //2/5/2016 NS modified for VSPLUS-2068
                                if (item == null || item.Text == null || item.Text == "")
                                {
                                    //1/26/2016 NS modified for VSPLUS-2068
                                    item2           = doc.GetFirstItem("NetAddresses");
                                    dr["IPAddress"] = item2.Text;
                                    if (item2 == null || item2.Text == null || item2.Text == "")
                                    {
                                        dr["IPAddress"] = "dummyaddress.yourdomain.com";
                                    }
                                }
                                dt.Rows.Add(dr);
                                dr = dt.NewRow();
                            }
                            doc = view.GetNextDocument(doc);
                        }
                        //1/8/2014 NS modified
                        if (dt.Rows.Count > 0)
                        {
                            //1/8/2014 NS added
                            infoDiv.Style.Value        = "display: block";
                            SrvCheckBoxList.DataSource = dt;
                            SrvCheckBoxList.TextField  = "ServerName";
                            SrvCheckBoxList.ValueField = "ServerName";
                            SrvCheckBoxList.DataBind();
                            IPCheckBoxList.DataSource = dt;
                            IPCheckBoxList.TextField  = "IPAddress";
                            IPCheckBoxList.ValueField = "IPAddress";
                            IPCheckBoxList.DataBind();
                            //12/20/2013 NS added
                            ASPxRoundPanel1.Visible = true;
                        }
                        else
                        {
                            //10/6/2014 NS modified for VSPLUS-990
                            errorDiv.InnerHtml = "There are no new servers in the address book that have not already been imported into VitalSigns." +
                                                 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                            errorDiv.Style.Value = "display: block";
                        }
                    }
                    catch (Exception ex)
                    {
                        //12/20/2013 NS added
                        //10/6/2014 NS modified for VSPLUS-990
                        errorDiv.InnerHtml = "The following error has occurred: " + ex.Message +
                                             "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                        errorDiv.Style.Value = "display: block";
                        //8/12/2014 NS added for VSPLUS-861
                        errorinfoDiv.Style.Value = "display: block";
                        db   = null;
                        dir  = null;
                        view = null;
                        doc  = null;
                        //5/15/2014 NS added for VSPLUS-634
                        Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                    }
                }
            }
            //5/13/2014 NS added for VSPLUS-183
            else
            {
                //10/6/2014 NS modified for VSPLUS-990
                errorDiv.InnerHtml = "All imported servers must be assigned to a location. There were no locations found. Please create at least one location entry using the 'Setup & Security - Maintain Server Locations' menu option." +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                errorDiv.Style.Value = "display: block";
            }
        }
Example #6
0
        private DataTable GetNotesDatabases(string ServerName)
        {
            Domino.NotesDbDirectory dir;
            Domino.NotesDatabase    db;
            //4/26/2013 NS modified
            //VSFramework.RegistryHandler myRegistry = new VSFramework.RegistryHandler();
            byte[] MyPass;
            string MyDominoPassword; //should be string
            //object MyObjPwd;
            string MyObjPwd;

            string[]  MyObjPwdArr;
            DataTable dt = new DataTable();

            VSFramework.TripleDES mySecrets = new VSFramework.TripleDES();
            try
            {
                //MyObjPwd = myRegistry.ReadFromRegistry("Password");
                MyObjPwd    = VSWebBL.SettingBL.SettingsBL.Ins.Getvalue("Password");
                MyObjPwdArr = MyObjPwd.Split(',');
                MyPass      = new byte[MyObjPwdArr.Length];
                for (int i = 0; i < MyObjPwdArr.Length; i++)
                {
                    MyPass[i] = Byte.Parse(MyObjPwdArr[i]);
                }
            }
            catch (Exception ex)
            {
                MyPass = null;
                //12/31/2013 NS modified

                /*
                 * SelectNotesPopupControl.ShowOnPageLoad = false;
                 * ErrorMessageLabel.Text = "The password specified in the Settings table is empty or invalid.";
                 * ErrorMessagePopupControl.HeaderText = "Incorrect Domino Password";
                 * ValidationUpdatedButton.Visible = true;
                 * ValidationOkButton.Visible = false;
                 * ErrorMessagePopupControl.ShowOnPageLoad = true;
                 */
                //10/3/2014 NS modified for VSPLUS-990
                errorDiv.InnerHtml = "The password specified in the Settings table is empty or invalid. " + ex.Message +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                errorDiv.Style.Value = "display: block";
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
            }

            try
            {
                if (MyPass != null)
                {
                    MyDominoPassword = mySecrets.Decrypt(MyPass);
                }
                else
                {
                    MyDominoPassword = null;
                    //12/31/2013 NS modified

                    /*
                     * SelectNotesPopupControl.ShowOnPageLoad = false;
                     * ErrorMessageLabel.Text = "The password specified in the Settings table is empty or invalid.";
                     * ErrorMessagePopupControl.HeaderText = "Incorrect Domino Password";
                     * ValidationUpdatedButton.Visible = true;
                     * ValidationOkButton.Visible = false;
                     * ErrorMessagePopupControl.ShowOnPageLoad = true;
                     */
                    //10/3/2014 NS modified for VSPLUS-990
                    errorDiv.InnerHtml = "The password specified in the Settings table is empty or invalid." +
                                         "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                    errorDiv.Style.Value = "display: block";
                }
            }
            catch (Exception ex)
            {
                MyDominoPassword = "";
                //12/31/2013 NS modified

                /*
                 * SelectNotesPopupControl.ShowOnPageLoad = false;
                 * ErrorMessageLabel.Text = "VitalSigns was unable to decrypt the password stored in the Settings table. Please ensure the password is correct.";
                 * ErrorMessagePopupControl.HeaderText = "Domino Password Could Not Be Decrypted";
                 * ValidationUpdatedButton.Visible = true;
                 * ValidationOkButton.Visible = false;
                 * ErrorMessagePopupControl.ShowOnPageLoad = true;
                 */
                //10/3/2014 NS modified for VSPLUS-990
                errorDiv.InnerHtml = "VitalSigns was unable to decrypt the password stored in the Settings table. Please ensure the password is correct. " + ex.Message +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                errorDiv.Style.Value = "display: block";
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
            }
            try
            {
                NotesSessionObject.Initialize(MyDominoPassword);
                dir = NotesSessionObject.GetDbDirectory(ServerName);
                db  = dir.GetFirstDatabase(Domino.DB_TYPES.NOTES_DATABASE);
                DataRow dr = dt.NewRow();
                dt.Columns.Add("DBTitle", typeof(string));
                dt.Columns.Add("DBFile", typeof(string));
                dt.Columns.Add("ReplicaID", typeof(string));
                while (db != null)
                {
                    dr["DBTitle"]   = db.Title;
                    dr["DBFile"]    = db.FilePath;
                    dr["ReplicaID"] = db.ReplicaID;
                    dt.Rows.Add(dr);
                    dr = dt.NewRow();
                    db = dir.GetNextDatabase();
                }
                db = null;
                dr = null;
                System.Runtime.InteropServices.Marshal.ReleaseComObject(NotesSessionObject);
            }
            catch (Exception ex)
            {
                using (System.IO.StreamWriter _testData = new System.IO.StreamWriter(System.Web.HttpContext.Current.Server.MapPath("~/Config_EditNotes_Log.txt"), true))
                {
                    _testData.WriteLine(ex.Message); // Write the file.
                }
                db  = null;
                dir = null;
                //12/31/2013 NS modified

                /*
                 * SelectNotesPopupControl.ShowOnPageLoad = false;
                 * ErrorMessageLabel.Text = "Notes session could not be initialized due to an incorrect password value.";
                 * ErrorMessagePopupControl.HeaderText = "Incorrect Domino Password";
                 * ValidationUpdatedButton.Visible = true;
                 * ValidationOkButton.Visible = false;
                 * ErrorMessagePopupControl.ShowOnPageLoad = true;
                 */
                //10/3/2014 NS modified for VSPLUS-990
                errorDiv.InnerHtml = "Notes session could not be initialized due to an incorrect password value. " + ex.Message +
                                     "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
                errorDiv.Style.Value = "display: block";
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
            }

            return(dt);
        }