示例#1
0
        private void btnCreateFunction_Click(object sender, EventArgs e)
        {
            UpdateLabelScript();

            if (txtFunctionName.Text != "")
            {
                if (parametersName.Count != 0)
                {
                    if (txtSQL.Text != "")
                    {
                        string generatedDDL = GenerateDDL();

                        string state = dbHandler.CreateFunction(generatedDDL);

                        if (state == "Success")
                        {
                            MessageBox.Show("Function created succesfully!");
                        }
                        else
                        {
                            MessageBox.Show("Error while creating function\n Error Message: " + state);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Enter the sql command!!");
                    }
                }
                else
                {
                    MessageBox.Show("Add at least one parameter to create the function!!!");
                }
            }
            else
            {
                MessageBox.Show("Write the function Name!!!!");
            }
        }