Exemplo n.º 1
0
        void login(object sender, EventArgs e)
        {
            //Console.WriteLine(combo1.Text);
            //Console.WriteLine(combo2.Text);
            //Console.WriteLine(text3.Text);
            //Console.WriteLine(pass.Text);
            string server;
            string database;
            if (this.radio1.Checked)
            {
                server = text1.Text;
                database = text2.Text;

                if (String.IsNullOrWhiteSpace(server) || String.IsNullOrWhiteSpace(database))
                {
                    MessageBox.Show("Trebuie introduse toate datele de conectare!");
                }
                else
                {
                    if (this.check.Checked)
                    {
                        if (!File.Exists("config.xml"))
                        {
                            dbConf.createXml();
                        }

                        if (!(dbConf.exists(server, database)))
                        {
                            if (!(dbConf.exists(server)))
                            {
                                dbConf.writeXml(server, database);
                            }
                            else
                            {
                                dbConf.writeXmlDb(server, database);
                            }
                        }
                    }
                }
            }
            else
            {
                server = combo1.Text;
                database = combo2.Text;
            }
            string user = text3.Text;
            string passwd = pass.Text;

            //EditQueryF f = new EditQueryF(server, database, user, passwd);
            //f.ShowDialog();

            if (!(String.IsNullOrWhiteSpace(server) || String.IsNullOrWhiteSpace(database)))
            {
                try
                {
                    fMDI = new MDIParent(server, database, user, passwd);
                    this.Hide();
                    fMDI.ShowDialog();
                    this.Show();
                }catch(Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemplo n.º 2
0
 private void button4_Click(object sender, EventArgs e)
 {
     MDIParent f = new MDIParent();
     f.Show();
 }