Exemple #1
0
 private void FillDiskGridfromSession()
 {
     try
     {
         DataTable ServersDataTable = new DataTable();
         if (Session["DiskDataTable"] != "" && Session["DiskDataTable"] != null)
         {
             ServersDataTable = (DataTable)Session["DiskDataTable"];
         }
         //5/2/2014 NS modified for VSPLUS-602
         if (ServersDataTable.Rows.Count > 0 && SelCriteriaRadioButtonList.SelectedItem.Value.ToString() == "1")
         {
             //5/2/2014 NS added for VSPLUS-602
             GridViewDataColumn column1 = DiskGridView.Columns["Threshold"] as GridViewDataColumn;
             GridViewDataColumn column2 = DiskGridView.Columns["ThresholdType"] as GridViewDataColumn;
             DataTable          dt      = new DataTable();
             for (int i = 0; i < DiskGridView.VisibleRowCount; i++)
             {
                 if (DiskGridView.Selection.IsRowSelected(i))
                 {
                     ASPxTextBox  txtThreshold     = (ASPxTextBox)DiskGridView.FindRowCellTemplateControl(i, column1, "txtFreeSpaceThresholdValue");
                     ASPxComboBox txtThresholdType = (ASPxComboBox)DiskGridView.FindRowCellTemplateControl(i, column2, "txtFreeSpaceThresholdType");
                     ServersDataTable.Rows[i]["Threshold"]     = txtThreshold.Text;
                     ServersDataTable.Rows[i]["ThresholdType"] = txtThresholdType.SelectedItem.Text;
                 }
             }
             DiskGridView.DataSource = ServersDataTable;
             DiskGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         errorDiv.Style.Value = "display: block;";
         //10/3/2014 NS modified for VSPLUS-990
         errorDiv.InnerHtml = "One of the selected row values is incorrect: threshold values must be numeric and threshold type must be set for each selected disk." +
                              "<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>";
         //6/27/2014 NS added for VSPLUS-634
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
     }
 }
Exemple #2
0
        private void FillDiskGridView()
        {
            try
            {
                DataTable DiskDataTable = new DataTable();

                DiskDataTable = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetSrvRowsDiskSettings(lblServerId.Text);
                if (DiskDataTable.Rows.Count == 0 || (DiskDataTable.Rows.Count == 1 && DiskDataTable.Rows[0]["DiskName"].ToString() == "NoAlerts"))
                {
                    //12/16/2013 NS modified - created a radio button list
                    //5/12/2014 NS modified for VSPLUS-615
                    //SelCriteriaRadioButtonList.SelectedIndex = 2;
                    SelCriteriaRadioButtonList.SelectedIndex = 3;
                    AdvDiskSpaceThTrackBar.Visible           = false;
                    DiskLabel.Visible    = false;
                    Label4.Visible       = false;
                    DiskGridView.Visible = false;
                    DiskGridInfo.Visible = false;
                    //rdbSelAll.Checked = false;
                    //rdbSelFew.Checked = false;
                    //rdbNoAlerts.Checked = true;
                    DiskDataTable = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetSrvDiskSettings(NameTextBox.Text, "");
                    //12/16/2013 NS added
                    //SelectDisksRoundPanel.Visible = false;
                    //SelectDisksRoundPanel.Enabled = false;
                    //1/31/2014 NS added for VSPLUS-289
                    infoDiskDiv.Style.Value = "display: none";
                    //5/12/2014 NS added for VSPLUS-615
                    GBTextBox.Visible = false;
                    GBLabel.Visible   = false;
                    GBTitle.Visible   = false;
                }
                //5/12/2014 NS modified for VSPLUS-615
                //else if (DiskDataTable.Rows.Count == 1 && DiskDataTable.Rows[0]["DiskName"].ToString() == "0")
                else if (DiskDataTable.Rows.Count == 1 && DiskDataTable.Rows[0]["DiskName"].ToString() == "AllDisks" &&
                         DiskDataTable.Rows[0]["ThresholdType"].ToString() == "Percent")
                {
                    //12/16/2013 NS modified - created a radio button list
                    SelCriteriaRadioButtonList.SelectedIndex = 0;
                    AdvDiskSpaceThTrackBar.Visible           = true;
                    AdvDiskSpaceThTrackBar.Value             = DiskDataTable.Rows[0]["Threshold"];
                    DiskLabel.Visible    = true;
                    Label4.Visible       = true;
                    DiskGridView.Visible = false;
                    DiskGridInfo.Visible = false;
                    //rdbSelAll.Checked = true;
                    //rdbSelFew.Checked = false;
                    //rdbNoAlerts.Checked = false;


                    //12/16/2013 NS added
                    //SelectDisksRoundPanel.Visible = false;
                    //SelectDisksRoundPanel.Enabled = false;
                    //1/31/2014 NS added for VSPLUS-289
                    infoDiskDiv.Style.Value = "display: none";
                    //5/12/2014 NS added for VSPLUS-615
                    GBTextBox.Visible = false;
                    GBLabel.Visible   = false;
                    GBTitle.Visible   = false;
                    DiskDataTable     = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetSrvDiskSettings(NameTextBox.Text, "All");
                }
                //5/12/2014 NS added for VSPLUS-615
                else if (DiskDataTable.Rows.Count == 1 && DiskDataTable.Rows[0]["DiskName"].ToString() == "AllDisks" &&
                         DiskDataTable.Rows[0]["ThresholdType"].ToString() == "GB")//if (DiskDataTable.Rows.Count> 0)
                {
                    SelCriteriaRadioButtonList.SelectedIndex = 1;
                    AdvDiskSpaceThTrackBar.Visible           = false;
                    DiskLabel.Visible       = false;
                    Label4.Visible          = true;
                    DiskGridView.Visible    = false;
                    DiskGridInfo.Visible    = false;
                    infoDiskDiv.Style.Value = "display: none";
                    GBTextBox.Visible       = true;
                    GBLabel.Visible         = true;
                    GBTitle.Visible         = true;
                    if (DiskDataTable.Rows.Count > 0)
                    {
                        GBTextBox.Text = DiskDataTable.Rows[0]["Threshold"].ToString();
                    }
                    DiskDataTable = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetSrvDiskSettings(NameTextBox.Text, "All");
                }
                else
                {
                    //12/16/2013 NS modified - created a radio button list
                    //5/12/2014 NS modified for VSPLUS-615
                    //SelCriteriaRadioButtonList.SelectedIndex = 1;
                    SelCriteriaRadioButtonList.SelectedIndex = 2;
                    AdvDiskSpaceThTrackBar.Visible           = false;
                    DiskLabel.Visible    = false;
                    Label4.Visible       = false;
                    DiskGridView.Visible = true;
                    DiskGridInfo.Visible = true;
                    //rdbSelAll.Checked = false;
                    //rdbSelFew.Checked = true;
                    //rdbNoAlerts.Checked = false;
                    DiskDataTable = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetSrvDiskSettings(NameTextBox.Text, "");
                    //12/16/2013 NS added
                    //SelectDisksRoundPanel.Visible = true;
                    //SelectDisksRoundPanel.Enabled = true;
                    //1/31/2014 NS added for VSPLUS-289
                    infoDiskDiv.Style.Value = "display: block";
                    //5/12/2014 NS added for VSPLUS-615
                    GBTextBox.Visible = false;
                    GBLabel.Visible   = false;
                    GBTitle.Visible   = false;
                }
                Session["DiskDataTable"] = DiskDataTable;
                DiskGridView.DataSource  = DiskDataTable;
                DiskGridView.DataBind();
            }
            catch (Exception ex)
            {
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }