示例#1
0
 private void SelectDB()
 {
     if (SelectNDGridView.Selection.Count > 0)
     {
         System.Collections.Generic.List <object> RepIDL = SelectNDGridView.GetSelectedFieldValues("ReplicaID");
         if (RepIDL.Count > 0)
         {
             string ID = RepIDL[0].ToString();
         }
         System.Collections.Generic.List <object> DBFileL = SelectNDGridView.GetSelectedFieldValues("DBFile");
         if (DBFileL.Count > 0)
         {
             DBFile = DBFileL[0].ToString();
         }
         System.Collections.Generic.List <object> DBTitleL = SelectNDGridView.GetSelectedFieldValues("DBTitle");
         if (DBTitleL.Count > 0)
         {
             DBTitle = DBTitleL[0].ToString();
         }
         //}
         DominoServerComboBox.Text = NDNameComboBox.Text;
         NameTextBox.Text          = DBTitle;
         DBFileNameTextBox.Text    = DBFile;
         try
         {
             Domino.NotesDatabase db;
             NotesSessionObject.Initialize("");
             db = NotesSessionObject.GetDatabase(NDNameComboBox.Text, DBFile);
             if (db.IsOpen)
             {
                 long myMB, myGB;
                 myMB = long.Parse((Math.Round(db.Size / 1024 / 1024, 0)).ToString());
                 myGB = myMB / 1024 / 1024;
                 string mydbInfo;
                 mydbInfo  = db.AllDocuments.Count + " documents / ";
                 mydbInfo += (long.Parse((db.Size).ToString()) / 1024 / 1024).ToString("###,##0") + " MB ";
                 if (myGB > 1)
                 {
                     mydbInfo += (long.Parse((db.Size).ToString()) / 1024 / 1024).ToString("###,##0") + " GB ";
                 }
                 NDsizeLabel.Text = mydbInfo;
             }
             db = null;
         }
         catch (Exception ex)
         {
             //6/27/2014 NS added for VSPLUS-634
             Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
             //6/14/2016 NS added for VSPLUS-3072
             errorDivMain.Style.Value = "display: block";
             errorDivMain.InnerHtml   = "The following error has occurred: " + ex.Message + ". <br />" +
                                        "Note: while you are going to be able to save the current record, the Domino service will be unable to access the database in question until you add the ID to the database's ACL." +
                                        "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
             //throw ex;
         }
     }
     System.Runtime.InteropServices.Marshal.ReleaseComObject(NotesSessionObject);
 }
示例#2
0
        // populate Select NotesDatabase form
        private void PopulateSelectBox(string ServerName)
        {
            GridViewDataColumn column;
            //bind to grid
            DataTable dt = new DataTable();

            dt = GetNotesDatabases(ServerName);
            //4/3/2014 NS modified for VSPLUS-138
            //Session["NotesDB"] = dt;
            ViewState["NotesDB"] = dt;
            if (!IsPostBack)
            {
                if (dt.Rows.Count > 0)
                {
                    SelectNDGridView.Columns.Clear();
                    SelectNDGridView.DataSource   = dt;
                    SelectNDGridView.KeyFieldName = "ReplicaID";
                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        column = new GridViewDataColumn(dt.Columns[i].ColumnName);
                        if (dt.Columns[i].ColumnName == "ReplicaID")
                        {
                            column.Visible = false;
                        }
                        SelectNDGridView.Columns.Add(column);
                    }
                    SelectNDGridView.DataBind();
                }
            }
            else
            {
                //4/3/2014 NS modified for VSPLUS-138
                //DataTable ND = (DataTable)Session["NotesDB"];
                DataTable ND = (DataTable)ViewState["NotesDB"];
                if (ND.Rows.Count > 0)
                {
                    SelectNDGridView.Columns.Clear();
                    SelectNDGridView.DataSource   = ND;
                    SelectNDGridView.KeyFieldName = "ReplicaID";
                    for (int i = 0; i < ND.Columns.Count; i++)
                    {
                        column = new GridViewDataColumn(ND.Columns[i].ColumnName);
                        if (dt.Columns[i].ColumnName == "ReplicaID")
                        {
                            column.Visible = false;
                        }
                        SelectNDGridView.Columns.Add(column);
                    }
                    SelectNDGridView.DataBind();
                }
            }
        }
示例#3
0
        protected void NDNameComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            //12/31/2013 NS modified
            errorDiv.Style.Value = "display: none";
            try
            {
                SelectNDGridView.DataSource = "";
                SelectNDGridView.DataBind();
            }
            catch (Exception ex)
            {
                //12/31/2013 NS modified
                //10/3/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";
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                //throw;
            }
            try
            {
                PopulateSelectBox(NDNameComboBox.Text);
            }
            catch (Exception ex)
            {
                //12/31/2013 NS modified

                /*
                 * ErrorMessageLabel.Text = "The Domino password stored in registry is incorrect. Please reset the password using the IBM Domino Settings menu option under Stored Passwords & Options and try again." + ex.ToString();
                 * ErrorMessagePopupControl.HeaderText = "Incorrect Domino Password";
                 * ErrorMessagePopupControl.ShowCloseButton = false;
                 * ValidationUpdatedButton.Visible = true;
                 * ValidationOkButton.Visible = false;
                 * ErrorMessagePopupControl.ShowOnPageLoad = true;
                 * //throw;
                 */
                //10/3/2014 NS modified for VSPLUS-990
                errorDiv.InnerHtml = "The Domino password stored in the Settings table is incorrect. Please reset the password using the IBM Domino Settings menu option under Stored Passwords & Options and try again. " + ex.ToString() +
                                     "<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);
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //code added on 2nd june2012
            ServerListBox.Enabled       = false;
            InitiateRepCheckBox.Visible = false;
            ServerListBox.Visible       = false;
            GBLabel.Visible             = false;
            ServerLabel.Visible         = false;


            if (!IsPostBack)
            {
                FillTaskNameComboBox();
                FillListBox();

                if (Session["UserPreferences"] != null)
                {
                    DataTable UserPreferences = (DataTable)Session["UserPreferences"];
                    foreach (DataRow dr in UserPreferences.Rows)
                    {
                        if (dr[1].ToString() == "EditNotes|SelectNDGridView")
                        {
                            SelectNDGridView.SettingsPager.PageSize = Convert.ToInt32(dr[2]);
                        }
                    }
                }
            }
            else
            {
                //Grid needs to be bound each time
                if (SelectNotesPopupControl.ShowOnPageLoad && ViewState["NotesDB"] != null && ViewState["NotesDB"] != "")
                {
                    GridViewDataColumn column = new GridViewDataColumn();
                    DataTable          ND     = (DataTable)ViewState["NotesDB"];
                    if (ND.Rows.Count > 0)
                    {
                        SelectNDGridView.Columns.Clear();
                        SelectNDGridView.DataSource   = ND;
                        SelectNDGridView.KeyFieldName = "ReplicaID";
                        for (int i = 0; i < ND.Columns.Count; i++)
                        {
                            column = new GridViewDataColumn(ND.Columns[i].ColumnName);
                            if (ND.Columns[i].ColumnName == "ReplicaID")
                            {
                                column.Visible = false;
                            }
                            else
                            {
                                column.Settings.AutoFilterCondition = AutoFilterCondition.Contains;
                            }
                            SelectNDGridView.Columns.Add(column);
                        }
                        SelectNDGridView.DataBind();
                    }
                }
            }

            if (Request.QueryString["ID"] != null)
            {
                Mode = "Update";
                ID   = int.Parse(Request.QueryString["ID"]);
                if (!IsPostBack)
                {
                    FillData(ID);
                    //11/19/2014 NS modified
                    //NotesDatabasesRoundPanel.HeaderText = "Notes Databases -" + " " + NameTextBox.Text;
                    servernamelbldisp.InnerHtml = "Notes Database -" + " " + NameTextBox.Text;
                }
            }
            else
            {
                Mode = "Insert";
                if (!IsPostBack)
                {
                    FillData(0);
                }
            }
        }