private void next_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < no_of_tables; i++)
            {
                ComboBox cb = (ComboBox)panel1.Controls["Attr@" + i.ToString()];
                newTable[i, 2] = cb.Text;
            }

            g.mustdo();
            Mapping map = new Mapping(form, newTable);

            map.TopLevel = false;
            map.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;
                    map.Height = hieght;
                    map.Width  = m.panel1.Width;
                    m.panel1.Controls.Add(map);
                }
            }
        }
Esempio n. 2
0
        public NewTableDetails(string[,] tempform, int temptables)
        {
            InitializeComponent();
            form         = tempform;
            no_of_tables = temptables;
            tables       = new string[no_of_tables, 2];

            if (temptables == 0)
            {
                tables = null;
                g.mustdo();
                Mapping map = new Mapping(form, tables);
                map.TopLevel = false;
                map.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;
                        map.Height = hieght;
                        map.Width  = m.panel1.Width;
                        m.panel1.Controls.Add(map);
                    }
                }
            }

            int k = 0;

            while (i < no_of_tables)
            {
                dv                 = new DataGridView();
                dv.Name            = "DGV" + i.ToString();
                dv.ColumnCount     = 1;
                dv.Columns[0].Name = "Variable Name";
                dv.Size            = new Size(260, 200);
                DataGridViewComboBoxColumn DGVCC = new DataGridViewComboBoxColumn();
                DGVCC.HeaderText = "Variable type";
                DGVCC.Items.AddRange("int", "varchar(50)", "varchar(100)", "varchar(250)", "varchar(500)", "float", "char");
                dv.Columns.Add(DGVCC);
                dv.Location = new Point((k * 150) + 10, 40);

                panel1.Controls.Add(dv);

                Label l = new Label();
                l.Text     = "Table Name";
                l.Location = new Point((k * 150) + 10, 12);
                l.Size     = new Size(65, 15);
                panel1.Controls.Add(l);

                TextBox t = new TextBox();
                t.Name     = "textbox" + i.ToString();
                t.Location = new Point((k * 150) + 75, 10);
                panel1.Controls.Add(t);
                k = k + 2;
                i++;
            }
        }
Esempio n. 3
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            if (txtTables.Text == "")
            {
                toolTip1.ToolTipTitle = "Number of Tables cannot be left blank";
                toolTip1.Show("Please enter valid number of tables", txtTables, 5000);
                return;
            }

            try
            {
                Convert.ToInt32(txtTables.Text);
            }
            catch
            {
                toolTip1.ToolTipTitle = "Number of Tables has to be an integer";
                toolTip1.Show("Please enter valid number of tables", txtTables, 5000);
                return;
            }
            if (Convert.ToInt32(txtTables.Text) < 0)
            {
                toolTip1.ToolTipTitle = "Number of Tables has to be an positive integer";
                toolTip1.Show("Please enter valid number of tables", txtTables, 5000);
                return;
            }
            int     no_of_tables = Convert.ToInt32(txtTables.Text);
            General g            = new General();

            g.mustdo();
            string[,] newForm = new string[form.Length / 3, 4];
            for (int i = 0; i < form.Length / 3; i++)
            {
                newForm[i, 0] = form[i, 0];
                newForm[i, 1] = form[i, 1];
                newForm[i, 2] = form[i, 2];
                newForm[i, 3] = "";
            }
            OldTableDetails OTD = new OldTableDetails(newForm, 0, count, Convert.ToInt32(no_of_tables));

            OTD.TopLevel = false;
            OTD.Visible  = true;
            for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
            {
                if (Application.OpenForms[index].Name == "MainBackend")
                {
                    MainBackend m = (MainBackend)Application.OpenForms[index];
                    m.panel1.Controls.Add(OTD);
                    int hieght = m.panel1.Height;
                    OTD.Height = hieght;
                    OTD.Width  = m.panel1.Width;
                }
            }
        }
Esempio n. 4
0
        public void loadNewTableDetails()
        {
            g.mustdo();
            NewTableDetails ntd1 = new NewTableDetails(form, no_of_tables);

            ntd1.TopLevel = false;
            ntd1.Visible  = true;
            for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
            {
                if (Application.OpenForms[index].Name == "MainBackend")
                {
                    MainBackend m = (MainBackend)Application.OpenForms[index];
                    m.panel1.Controls.Add(ntd1);
                    int hieght = m.panel1.Height;
                    ntd1.Height = hieght;
                    ntd1.Width  = m.panel1.Width;
                }
            }
            //ntd1.ShowDialog();
        }
Esempio n. 5
0
        public void loadAgain()
        {
            //Thread.Sleep(50);
            g.mustdo();
            OldTableDetails old = new OldTableDetails(form, i, count, no_of_tables);

            old.TopLevel = false;
            old.Visible  = true;
            for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
            {
                if (Application.OpenForms[index].Name == "MainBackend")
                {
                    MainBackend m = (MainBackend)Application.OpenForms[index];
                    m.panel1.Controls.Add(old);
                    int hieght = m.panel1.Height;
                    old.Height = hieght;
                    old.Width  = m.panel1.Width;
                }
            }
            //old.ShowDialog();
        }
Esempio n. 6
0
        private void AdvancedLogs_Click(object sender, EventArgs e)
        {
            General g = new General();

            g.mustdo();
            CompanyLogs frm = new CompanyLogs();

            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);
                }
            }
        }
Esempio n. 7
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);
                    }
                }
            }
        }
Esempio n. 8
0
        public void loadMainbackend()
        {
            MainBackend m = new MainBackend(user);

            m.ShowDialog();
        }
Esempio n. 9
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (check())
            {
                for (int l = 0; l < i; l++)
                {
                    DataGridView DGV        = (DataGridView)panel1.Controls["DGV" + (l).ToString()];
                    int          no_of_rows = DGV.RowCount;
                    TextBox      tb         = (TextBox)panel1.Controls["textbox" + (l).ToString()];
                    tables[l, 0] = tb.Text;
                    string[] eachrow = new string[no_of_rows - 1];
                    string[] test    = new string[no_of_rows - 1];

                    ///Check for columns spaces or special characters
                    for (int j = 0; j < no_of_rows - 1; j++)
                    {
                        string[] error = DGV.Rows[j].Cells[0].Value.ToString().Split(' ');
                        if (error.Length > 1)
                        {
                            MessageBox.Show(DGV.Rows[j].Cells[0].Value.ToString() + " is having spaces. Please remove them");
                            return;
                        }
                        if (DGV.Rows[j].Cells[0].Value.ToString().Contains("_") || DGV.Rows[j].Cells[0].Value.ToString().Contains("@"))
                        {
                            MessageBox.Show(DGV.Rows[j].Cells[0].Value.ToString() + " is having special character '_' or '@' or both. Please remove them");
                            return;
                        }
                        test[j] = DGV.Rows[j].Cells[0].Value.ToString().ToUpper();
                    }
                    if (test.Count() != test.Distinct().Count())
                    {
                        MessageBox.Show("There are duplicate coulumn names. Please remove them in order to continue");
                    }

                    for (int j = 0; j < no_of_rows - 1; j++)
                    {
                        eachrow[j] = DGV.Rows[j].Cells[0].Value.ToString() + "_" + DGV.Rows[j].Cells[1].Value.ToString();
                    }
                    tables[l, 1] = String.Join("@", eachrow);
                }

                g.mustdo();
                NewTablePrimaryKeys map = new NewTablePrimaryKeys(form, tables);
                map.TopLevel = false;
                map.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;
                        map.Height = hieght;
                        map.Width  = m.panel1.Width;
                        m.panel1.Controls.Add(map);
                    }
                }
            }
            else
            {
                MessageBox.Show("There is some error");
            }
        }
Esempio n. 10
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);
                }
            }
        }