Esempio n. 1
0
 protected void OpenButton_Click(object sender, EventArgs e)
 {
     if (AllDBGridView.FocusedRowIndex > -1)
     {
         DataTable dt = new DataTable();
         int       index;
         if (AllDBGridView.FocusedRowIndex > -1)
         {
             index = AllDBGridView.FocusedRowIndex;
         }
         else
         {
             index = 0;
         }
         string    HostName  = "Nohost";
         string    Server    = AllDBGridView.GetRowValues(index, "Server").ToString();
         DataTable servertab = VSWebBL.DashboardBL.DatabaseHealthBL.Ins.GetIPfromServers(Server);
         if (servertab.Rows.Count > 0)
         {
             HostName = servertab.Rows[0]["IPAddress"].ToString();
         }
         string filepath = AllDBGridView.GetRowValues(index, "Folder").ToString();
         string fileName = AllDBGridView.GetRowValues(index, "FileName").ToString();
         filepath = filepath.Replace("'\'", "'/'");
         if (filepath == "")
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "PopupCenter('http://" + HostName + "/" + fileName + "?OpenDatabase');", true);
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "PopupCenter('http://" + HostName + "/" + filepath + "/" + fileName + "?OpenDatabase');", true);
         }
         //if (filepath == "")
         //{
         //    Response.Write("<script>window.open('http://" + HostName + "/" + fileName + "?OpenDatabase','Open Database','width=500px height=50px left=(screen.width/2)-(500/2) top=(screen.height/2)-(50/2)',1)</script>");
         //}
         //else
         //{
         //    Response.Write("<script>window.open('http://" + HostName + "/" + filepath + "/" + fileName + "?OpenDatabase','Open Database','width=500px height=50px',1)</script>");
         //}
     }
     else
     {
         msglbl.Text = "Please select a database in the All Databases grid.";
         msgPopupControl.ShowOnPageLoad = true;
     }
 }
Esempio n. 2
0
 protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e)
 {
     if (e.Item.Name == "OpenDBItem")
     {
         if (AllDBGridView.FocusedRowIndex > -1)
         {
             DataTable dt = new DataTable();
             int       index;
             if (AllDBGridView.FocusedRowIndex > -1)
             {
                 index = AllDBGridView.FocusedRowIndex;
             }
             else
             {
                 index = 0;
             }
             string    HostName  = "Nohost";
             string    Server    = AllDBGridView.GetRowValues(index, "Server").ToString();
             DataTable servertab = VSWebBL.DashboardBL.DatabaseHealthBL.Ins.GetIPfromServers(Server);
             if (servertab.Rows.Count > 0)
             {
                 HostName = servertab.Rows[0]["IPAddress"].ToString();
             }
             string filepath = AllDBGridView.GetRowValues(index, "Folder").ToString();
             string fileName = AllDBGridView.GetRowValues(index, "FileName").ToString();
             filepath = filepath.Replace("'\'", "'/'");
             if (filepath == "")
             {
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "PopupCenter('http://" + HostName + "/" + fileName + "?OpenDatabase');", true);
             }
             else
             {
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "PopupCenter('http://" + HostName + "/" + filepath + "/" + fileName + "?OpenDatabase');", true);
             }
             //if (filepath == "")
             //{
             //    Response.Write("<script>window.open('http://" + HostName + "/" + fileName + "?OpenDatabase','Open Database','width=500px height=50px left=(screen.width/2)-(500/2) top=(screen.height/2)-(50/2)',1)</script>");
             //}
             //else
             //{
             //    Response.Write("<script>window.open('http://" + HostName + "/" + filepath + "/" + fileName + "?OpenDatabase','Open Database','width=500px height=50px',1)</script>");
             //}
         }
         else
         {
             msglbl.Text = "Please select a database in the All Databases grid.";
             msgPopupControl.ShowOnPageLoad = true;
         }
     }
     else if (e.Item.Name == "CompactItem")
     {
         popuptextBox.Text             = "";
         DBPopupControl.HeaderText     = "Compact Options";
         ASPxLabel1.Text               = "Please enter the desired COMPACT options.";
         ASPxLabel2.Text               = "Use -c for corrupt databases and -B for in place compaction with file size reduction.";
         ASPxLabel3.Text               = "Google 'IBM domino compact switches' for the full list of options.";
         ASPxLabel4.Visible            = false;
         DBPopupControl.ShowOnPageLoad = true;
         Session["ActBtn"]             = "CompactButton";
     }
     else if (e.Item.Name == "FixupItem")
     {
         popuptextBox.Text             = "";
         DBPopupControl.HeaderText     = "Fixup Options";
         ASPxLabel1.Text               = "Please enter the desired FIXUP options.";
         ASPxLabel2.Text               = "For example, use -Q to check more quickly but less thoroughly.";
         ASPxLabel3.Text               = "Google 'IBM fixup compact switches' for the full list of options.";
         ASPxLabel4.Visible            = true;
         ASPxLabel4.Text               = "Use -V to prevent Fixup from running on views. This option reduces the time it takes Fixup to run.";
         DBPopupControl.ShowOnPageLoad = true;
         Session["ActBtn"]             = "Fixup";
     }
     else if (e.Item.Name == "UpdallItem")
     {
         popuptextBox.Text             = "";
         DBPopupControl.HeaderText     = "Updall Options";
         ASPxLabel1.Text               = "Please enter the desired UPDALL options.";
         ASPxLabel2.Text               = "For example, use -R to rebuild all used views (resource intensive).";
         ASPxLabel3.Text               = "Use -X to rebuild the full text index.";
         ASPxLabel4.Visible            = false;
         DBPopupControl.ShowOnPageLoad = true;
         Session["ActBtn"]             = "Updall";
     }
 }