Esempio n. 1
0
        private void btnCreate_Click(object sender, System.EventArgs e)
        {
            string path = CreateFolder(tbPath.Text, tbFunctionName.Text);

            SapParameter parameter = new SapParameter()
            {
                AppServerHost        = tbAppServerHost.Text,
                Client               = tbClient.Text,
                IdleTimeout          = tbIdleTimeout.Text,
                Language             = cbLanguage.SelectedText,
                Name                 = tbName.Text,
                Password             = tbPassword.Text,
                PeakConnectionsLimit = tbPeakConnectionsLimit.Text,
                PoolSize             = tbPoolSize.Text,
                SystemNumber         = tbSystemNumber.Text,
                User                 = tbUser.Text,
                FunctionName         = tbFunctionName.Text
            };



            IRfcFunction function = SapConnection.GetFunction(parameter);

            if (function != null)
            {
                List <SapClassModel> classBuilder = SapConnection.GetAllTablesClass(function);

                foreach (var sapClass in classBuilder)
                {
                    using (var tw = File.AppendText(path + sapClass.ClassName + ".cs"))
                    {
                        tw.WriteLine(sapClass.Builder.ToString());
                        tw.Close();
                    }
                }

                MessageBox.Show(@"Complete", @"Alert", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show(@"Not found function name", @"Alert", MessageBoxButtons.OK);
            }
        }