Ejemplo n.º 1
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();
                }
            }
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
                }
            }
        }