Exemplo n.º 1
0
        private void btnCreateProcedure_Click(object sender, EventArgs e)
        {
            UpdateLabelScript();

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

                        string state = dbHandler.CreateProcedure(generatedDDL);

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