private void upgradeButton_Click(object sender, EventArgs e)
        {
            bool ready = true;
            string strMessage = "";


            if (this.updateDir.Text == "")
            {
                ready = false;
                strMessage = "Please provide the location of your JCMS interface file (jcms.mdb)";
            }
            else
            {
                if (!System.IO.File.Exists(this.updateDir.Text))
                {
                    ready = false;
                    if (strMessage != "")
                    {
                        strMessage = strMessage + "\n";
                    }
                    strMessage = strMessage + string.Format("The requested file {0} could not be found, please check that file exists.", this.updateDir.Text);
                }
                else
                {
                    if (checkFileOpen())
                    {
                        ready = false;
                        if (strMessage != "")
                        {
                            strMessage = strMessage + "\n";
                        }
                        strMessage = strMessage + string.Format("The file {0} is open, please close the requested file before upgrading.", this.updateDir.Text);
                    }
                }
            }
            if (this.host.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }                
                strMessage = strMessage + "Please provide the host on which your MySQL server is located (if on the machine you're running this application type 'localhost')";
            }
            if(this.port.Text == ""){
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL port (likely 3306)";
            }
            if(this.username.Text == ""){
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL username";
            }/*
            if(this.password.Text == ""){
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide the password associated with the provided MySQL username";
            }*/
            if(this.databaseDropdown.Text == ""){
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please select a database to upgrade";
            }
            if (ready)
            {
                this.Hide();
                processProgress progressForm = new processProgress(theHost, thePort, theUsername, thePassword, this.databaseDropdown.Text, this.updateDir.Text);
                progressForm.Show();
            }
            else
            {
                MessageBox.Show(strMessage);
            }
        }
Beispiel #2
0
        private void upgradeButton_Click(object sender, EventArgs e)
        {
            bool   ready      = true;
            string strMessage = "";


            if (this.updateDir.Text == "")
            {
                ready      = false;
                strMessage = "Please provide the location of your JCMS interface file (jcms.mdb)";
            }
            else
            {
                if (!System.IO.File.Exists(this.updateDir.Text))
                {
                    ready = false;
                    if (strMessage != "")
                    {
                        strMessage = strMessage + "\n";
                    }
                    strMessage = strMessage + string.Format("The requested file {0} could not be found, please check that file exists.", this.updateDir.Text);
                }
                else
                {
                    if (checkFileOpen())
                    {
                        ready = false;
                        if (strMessage != "")
                        {
                            strMessage = strMessage + "\n";
                        }
                        strMessage = strMessage + string.Format("The file {0} is open, please close the requested file before upgrading.", this.updateDir.Text);
                    }
                }
            }
            if (this.host.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide the host on which your MySQL server is located (if on the machine you're running this application type 'localhost')";
            }
            if (this.port.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL port (likely 3306)";
            }
            if (this.username.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL username";
            }/*
              * if(this.password.Text == ""){
              * ready = false;
              * if (strMessage != "")
              * {
              *     strMessage = strMessage + "\n";
              * }
              * strMessage = strMessage + "Please provide the password associated with the provided MySQL username";
              * }*/
            if (this.databaseDropdown.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please select a database to upgrade";
            }
            if (ready)
            {
                this.Hide();
                processProgress progressForm = new processProgress(theHost, thePort, theUsername, thePassword, this.databaseDropdown.Text, this.updateDir.Text);
                progressForm.Show();
            }
            else
            {
                MessageBox.Show(strMessage);
            }
        }
Beispiel #3
0
        private void installButton_Click(object sender, EventArgs e)
        {
            bool   ready      = true;
            string strMessage = "";

            if (this.installDir.Text == "")
            {
                ready      = false;
                strMessage = "Please choose a directory in which you would like to install JCMS.";
            }
            if (!Directory.Exists(System.IO.Path.GetDirectoryName(this.installDir.Text)))
            {
                ready      = false;
                strMessage = "The selected directory could not be found.";
            }
            if (!System.IO.Path.GetExtension(this.installDir.Text).Equals(".mdb"))
            {
                ready      = false;
                strMessage = "File extension must be .mdb";
            }
            if (this.host.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide the host on which your MySQL server is located (if on the machine you're running this application type 'localhost')";
            }
            if (this.port.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL port (likely 3443)";
            }
            if (this.username.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL username";
            }/*
              * if (this.password.Text == "")
              * {
              * ready = false;
              * if (strMessage != "")
              * {
              *     strMessage = strMessage + "\n";
              * }
              * strMessage = strMessage + "Please provide the password associated with the provided MySQL username";
              * }*/
            if (this.database.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please select a database to upgrade";
            }
            if (ready)
            {
                processProgress theProgress = new processProgress(this.host.Text, this.port.Text, this.username.Text, this.password.Text, this.database.Text, this.installDir.Text);
                this.Hide();
                theProgress.Show();
            }
            else
            {
                MessageBox.Show(strMessage);
            }
        }
        private void installButton_Click(object sender, EventArgs e)
        {
            bool ready = true;
            string strMessage = "";

            if (this.installDir.Text == "")
            {
                ready = false;
                strMessage = "Please choose a directory in which you would like to install JCMS.";
            }
            if(!Directory.Exists(System.IO.Path.GetDirectoryName(this.installDir.Text)))
            {
                ready = false;
                strMessage = "The selected directory could not be found.";
            }
            if(!System.IO.Path.GetExtension(this.installDir.Text).Equals(".mdb")){
                ready = false;
                strMessage = "File extension must be .mdb";
            }
            if (this.host.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide the host on which your MySQL server is located (if on the machine you're running this application type 'localhost')";
            }
            if (this.port.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL port (likely 3443)";
            }
            if (this.username.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide a MySQL username";
            }/*
            if (this.password.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please provide the password associated with the provided MySQL username";
            }*/
            if (this.database.Text == "")
            {
                ready = false;
                if (strMessage != "")
                {
                    strMessage = strMessage + "\n";
                }
                strMessage = strMessage + "Please select a database to upgrade";
            }
            if (ready)
            {
                processProgress theProgress = new processProgress(this.host.Text, this.port.Text, this.username.Text, this.password.Text, this.database.Text, this.installDir.Text);
                this.Hide();
                theProgress.Show();
            }
            else
            {
                MessageBox.Show(strMessage);
            }
        }