コード例 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("Index!");
            TextBox txtenvID       = DetailsView1.FindControl("txtEnvironmentID") as TextBox;
            TextBox txtClientName  = DetailsView1.FindControl("txtClientName") as TextBox;
            TextBox txtProductName = DetailsView1.FindControl("txtProductName") as TextBox;
            TextBox txtEnvironmentAppServerEnvType = DetailsView1.FindControl("txtEnvironmentAppServerEnvType") as TextBox;
            TextBox txtDBServerEnvType             = DetailsView1.FindControl("txtDBServerEnvType") as TextBox;
            TextBox txtAppServerName                     = DetailsView1.FindControl("txtAppServerName") as TextBox;
            TextBox txtAppServerOS                       = DetailsView1.FindControl("txtAppServerOS") as TextBox;
            TextBox txtAppServerOSBuild                  = DetailsView1.FindControl("txtAppServerOSBuild") as TextBox;
            TextBox txtAppServerIsX86Version             = DetailsView1.FindControl("txtAppServerIsX86Version") as TextBox;
            TextBox txtAppServerIsVirtual                = DetailsView1.FindControl("txtAppServerIsVirtual") as TextBox;
            TextBox txtAppServerProcessor                = DetailsView1.FindControl("txtAppServerProcessor") as TextBox;
            TextBox txtAppServerMemory                   = DetailsView1.FindControl("txtAppServerMemory") as TextBox;
            TextBox txtAppServerWebBrowser               = DetailsView1.FindControl("txtAppServerWebBrowser") as TextBox;
            TextBox txtAppServerWebBrowserVersion        = DetailsView1.FindControl("txtAppServerWebBrowserVersion") as TextBox;
            TextBox txtAppServerWorkingDirectoryLocation = DetailsView1.FindControl("txtAppServerWorkingDirectoryLocation") as TextBox;
            TextBox txtAppHyperLink                      = DetailsView1.FindControl("txtAppHyperLink") as TextBox;
            TextBox txtAppServerIP                       = DetailsView1.FindControl("txtAppServerIP") as TextBox;
            TextBox txtAppServerPort                     = DetailsView1.FindControl("txtAppServerPort") as TextBox;
            TextBox txtAppServerDependency               = DetailsView1.FindControl("txtAppServerDependency") as TextBox;
            TextBox txtDBServerName                      = DetailsView1.FindControl("txtDBServerName") as TextBox;
            TextBox txtDBServerIsX86Version              = DetailsView1.FindControl("txtDBServerIsX86Version") as TextBox;
            TextBox txtDBServerIsVirtual                 = DetailsView1.FindControl("txtDBServerIsVirtual") as TextBox;
            TextBox txtDBServerMemory                    = DetailsView1.FindControl("txtDBServerMemory") as TextBox;
            TextBox txtDBServerProcessor                 = DetailsView1.FindControl("txtDBServerProcessor") as TextBox;
            TextBox txtDBServerOS                = DetailsView1.FindControl("txtDBServerOS") as TextBox;
            TextBox txtDBServerOSBuild           = DetailsView1.FindControl("txtDBServerOSBuild") as TextBox;
            TextBox txtDBServerDirectoryLocation = DetailsView1.FindControl("txtDBServerDirectoryLocation") as TextBox;
            TextBox txtDBMDFFileLocation         = DetailsView1.FindControl("txtDBMDFFileLocation") as TextBox;
            TextBox txtDBMDFFileSize             = DetailsView1.FindControl("txtDBMDFFileSize") as TextBox;
            TextBox txtDBLDFFileLocation         = DetailsView1.FindControl("txtDBLDFFileLocation") as TextBox;
            TextBox txtDBLDFFileSize             = DetailsView1.FindControl("txtDBLDFFileSize") as TextBox;
            TextBox txtDBServerIP                = DetailsView1.FindControl("txtDBServerIP") as TextBox;
            TextBox txtDBServerPort              = DetailsView1.FindControl("txtDBServerPort") as TextBox;
            TextBox txtDBServerDependency        = DetailsView1.FindControl("txtDBServerDependency") as TextBox;
            int     EnvID       = Convert.ToInt32(txtenvID.Text.ToString());
            string  ClientName  = txtClientName.Text.ToString();
            int     ClientID    = Convert.ToInt32(2);
            string  ProductName = txtProductName.Text.ToString();
            int     ProductID   = Convert.ToInt32(4);
            string  EnvironmentAppServerEnvType = txtEnvironmentAppServerEnvType.Text.ToString();
            int     AppServerEnvType            = Convert.ToInt32(1);
            string  DBServerEnvType             = txtDBServerEnvType.Text.ToString();
            int     DBServerEnvTypeID           = Convert.ToInt32(1);
            string  AppServerName                     = txtAppServerName.Text.ToString();
            string  AppServerOS                       = txtAppServerOS.Text.ToString();
            Int64   AppServerOSBuild                  = Convert.ToInt64(txtAppServerOSBuild.Text.ToString());
            Boolean AppServerIsX86Version             = Convert.ToBoolean(txtAppServerIsX86Version.Text.ToString());
            Boolean AppServerIsVirtual                = Convert.ToBoolean(txtAppServerIsVirtual.Text.ToString());
            string  AppServerProcessor                = txtAppServerProcessor.Text.ToString();
            int     AppServerMemory                   = Convert.ToInt32(txtAppServerMemory.Text.ToString());
            string  AppServerWebBrowser               = txtAppServerWebBrowser.Text.ToString();
            int     AppServerWebBrowserVersion        = Convert.ToInt32(txtAppServerWebBrowserVersion.Text.ToString());
            string  AppServerWorkingDirectoryLocation = txtAppServerWorkingDirectoryLocation.Text.ToString();
            string  AppHyperLink                      = txtAppHyperLink.Text.ToString();
            string  AppServerIP                       = txtAppServerIP.Text.ToString();
            int     AppServerPort                     = Convert.ToInt32(txtAppServerPort.Text.ToString());
            string  AppServerDependency               = txtAppServerDependency.Text.ToString();
            string  DBServerName                      = txtDBServerName.Text.ToString();
            Boolean DBServerIsX86Version              = Convert.ToBoolean(txtDBServerIsX86Version.Text.ToString());
            Boolean DBServerIsVirtual                 = Convert.ToBoolean(txtDBServerIsVirtual.Text.ToString());
            int     DBServerMemory                    = Convert.ToInt32(txtDBServerMemory.Text.ToString());
            string  DBServerProcessor                 = txtDBServerProcessor.Text.ToString();
            string  DBServerOS                = txtDBServerOS.Text.ToString();
            Int64   DBServerOSBuild           = Convert.ToInt64(txtDBServerOSBuild.Text.ToString());
            string  DBServerDirectoryLocation = txtDBServerDirectoryLocation.Text.ToString();
            string  DBMDFFileLocation         = txtDBMDFFileLocation.Text.ToString();
            Int64   DBMDFFileSize             = Convert.ToInt64(txtDBMDFFileSize.Text.ToString());
            string  DBLDFFileLocation         = txtDBLDFFileLocation.Text.ToString();
            Int64   DBLDFFileSize             = Convert.ToInt64(txtDBLDFFileSize.Text.ToString());
            string  DBServerIP                = txtDBServerIP.Text.ToString();
            int     DBServerPort              = Convert.ToInt32(txtDBServerPort.Text.ToString());
            string  DBServerDependency        = txtDBServerDependency.Text.ToString();

            Debug.WriteLine("");
            Debug.WriteLine("Data From Detail View:");
            Debug.WriteLine("Environment ID: " + EnvID);
            Debug.WriteLine("ClientName: " + ClientName);
            Debug.WriteLine("Product Name: " + ProductName);
            Debug.WriteLine("App Server Env Type: " + EnvironmentAppServerEnvType);
            Debug.WriteLine("DB Server Env Type: " + DBServerEnvType);
            Debug.WriteLine("App Server Name: " + AppServerName);
            Debug.WriteLine("App Server OS: " + AppServerOS);
            Debug.WriteLine("App Server OS Build: " + AppServerOSBuild);
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int ResultQuery            = dbcon.setAnEnvironment(EnvID, ClientID, ProductID, AppServerEnvType, DBServerEnvTypeID, AppServerName, AppServerOS, AppServerOSBuild, AppServerIsX86Version, AppServerIsVirtual, AppServerProcessor, AppServerMemory, AppServerWebBrowser, AppServerWebBrowserVersion, AppServerWorkingDirectoryLocation, AppHyperLink, AppServerIP, AppServerPort, AppServerDependency, DBServerName, DBServerIsX86Version, DBServerIsVirtual, DBServerMemory, DBServerProcessor, DBServerOS, DBServerOSBuild, DBServerDirectoryLocation, DBMDFFileLocation, DBMDFFileSize, DBLDFFileLocation, DBLDFFileSize, DBServerIP, DBServerPort, DBServerDependency);

            //Console.WriteLine("<script>alert(" + ResultQuery + "record has been updated." + ")</script>");
            //ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery + "record has been updated." + ")</script>", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery +")</script>", true);
            DetailsView1.Visible = false;
            //DetailsView1.Style.Add("display", "none");
            _BindService();
        }