Example #1
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            string[] text = txtDetails.Text.Split(new string[] { "\r\n" }, StringSplitOptions.None);
            string[] test = new string[text.Length];

            for (int j = 0; j < text.Length; j++)
            {
                if (text[j].Contains("_") || text[j].Contains("@"))
                {
                    toolTip1.ToolTipTitle = text[j] + "contains '_' or '@' as intermeditae please do not use them";
                    toolTip1.Show("Please correct your mistake", txtDetails, 5000);
                    return;
                }
                test[j] = text[j].ToUpper();
            }
            if (test.Count() != test.Distinct().Count())
            {
                toolTip1.ToolTipTitle = "There are duplicate fields";
                toolTip1.Show("Please remove the dupliacte fields", txtDetails, 5000);
                return;
            }

            string formdetails = String.Join("@", text);

            form[i, 1] = formdetails;
            form[i, 0] = txtFormName.Text;
            if (chkTable.Checked)
            {
                form[i, 2] = "True";
            }
            else
            {
                form[i, 2] = "False";
            }
            General g = new General();

            if (i + 1 == (form.Length) / 3)
            {
                g.mustdo();
                //this.Visible = true;
                NoTables t = new NoTables(form);
                t.TopLevel = false;
                t.Visible  = true;
                for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
                {
                    if (Application.OpenForms[index].Name == "MainBackend")
                    {
                        MainBackend m      = (MainBackend)Application.OpenForms[index];
                        int         hieght = m.panel1.Height;
                        t.Height = hieght;
                        t.Width  = m.panel1.Width;
                        m.panel1.Controls.Add(t);
                    }
                }
            }
            else
            {
                g.mustdo();
                FormDetails frm = new FormDetails(++i, form);
                frm.TopLevel = false;
                frm.Visible  = true;
                for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
                {
                    if (Application.OpenForms[index].Name == "MainBackend")
                    {
                        MainBackend m      = (MainBackend)Application.OpenForms[index];
                        int         hieght = m.panel1.Height;
                        frm.Height = hieght;
                        frm.Width  = m.panel1.Width;
                        m.panel1.Controls.Add(frm);
                    }
                }
            }
        }
Example #2
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                toolTip1.ToolTipTitle = "OLTP name cannot be left blank";
                toolTip1.Show("Please enter valid OLTP Name", textBox1, 5000);
                return;
            }

            if (no_of_forms.Text == "")
            {
                toolTip1.ToolTipTitle = "Number of Forms cannot be left blank";
                toolTip1.Show("If you have no forms them then enter 0", no_of_forms, 5000);
                return;
            }

            try
            {
                Convert.ToInt32(no_of_forms.Text);
            }
            catch (Exception)
            {
                toolTip1.ToolTipTitle = "Number of Forms has to be an integer";
                toolTip1.Show("Please enter valid number of forms", no_of_forms, 5000);
                return;
            }

            if (Convert.ToInt32(no_of_forms.Text) <= 0)
            {
                toolTip1.ToolTipTitle = "Number of Forms has to be an positive integer";
                toolTip1.Show("Please enter valid number of forms", no_of_forms, 5000);
                return;
            }

            if (textBox2.Text == "")
            {
                toolTip1.ToolTipTitle = "Transfer Interval cannot be left blank";
                toolTip1.Show("please enter the time in Seconds", textBox2, 5000);
                return;
            }
            if (textBox2.Text == "0")
            {
                toolTip1.ToolTipTitle = "Transfer Interval cannot be zero";
                toolTip1.Show("please enter the time in Minutes", textBox2, 5000);
                return;
            }

            OLTPname       = textBox1.Text.Trim();
            interval       = Convert.ToDouble(textBox2.Text) * 1000 * 60;
            string[,] form = new string[Convert.ToInt32(no_of_forms.Text), 3];
            General g = new General();

            g.mustdo();
            FormDetails frm = new FormDetails(0, form);

            frm.TopLevel = false;
            frm.Visible  = true;
            for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
            {
                if (Application.OpenForms[index].Name == "MainBackend")
                {
                    MainBackend m      = (MainBackend)Application.OpenForms[index];
                    int         hieght = m.panel1.Height;
                    frm.Height = hieght;
                    frm.Width  = m.panel1.Width;
                    m.panel1.Controls.Add(frm);
                }
            }
        }