コード例 #1
0
        private void MDI_Load(object sender, EventArgs e)
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            if (File.Exists(path + "\\connect"))
            {
                login log = new login();
                MainClass.showWindow(log, this);
            }
            else
            {
                settings set = new settings();
                MainClass.showWindow(set, this);
            }
        }
コード例 #2
0
        private void tslLogout_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("ARE YOU SURE YOU WANT TO LOGOUT...?", "Log OUt", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dialogResult == DialogResult.Yes)
            {
                login frm = new login();
                frm.Show();
                this.Close();
            }
            else
            {
                return;
            }
        }
コード例 #3
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            string s;
            string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            if (isCB.Checked)
            {
                if (serverTxt.Text != "" && databaseTxt.Text != "")
                {
                    s = "datasource=" + serverTxt.Text + ";Initial Catalog=" + databaseTxt.Text + ";Integrated Security=true;MultipleActiveResultSets=true;";
                    File.WriteAllText(path + "\\connect", s);

                    DialogResult dr = MessageBox.Show("Setting successfully saved....", "information...", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (dr == DialogResult.OK)
                    {
                        login log = new login();
                        MainClass.showWindow(log, this, MDI.ActiveForm);
                    }
                }
                else
                {
                    MessageBox.Show("Please fill complete Data to continue.");
                }
            }
            else
            {
                if (serverTxt.Text != "" && databaseTxt.Text != "" && userTxt.Text != "" && passTxt.Text != "")
                {
                    s = "datasource=" + serverTxt.Text + ";Initial Catalog=" + databaseTxt.Text + ";User ID=" + userTxt.Text + ";Password="******";MultipleActiveResultSets=true;";
                    File.WriteAllText(path + "\\connect", s);

                    DialogResult dr = MessageBox.Show("Setting successfully saved....", "information...", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (dr == DialogResult.OK)
                    {
                        login log = new login();
                        MainClass.showWindow(log, this, MDI.ActiveForm);
                    }
                }
                else
                {
                    MessageBox.Show("Please fill complete Data to continue.");
                }
            }
        }
コード例 #4
0
        private void saveBtn_Click(object sender, EventArgs e)
        {
            string s;
            string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            if (checkBox1.Checked)
            {
                if (serverTxt.Text != "" && dbTxt.Text != "")
                {
                    s = "Data Source=" + serverTxt.Text + ";Initial Catalog=" + dbTxt.Text + ";Integrated Security=true;";
                    File.WriteAllText(path + "\\connect", s);
                    DialogResult dr = MessageBox.Show("Saved Successfully....", "Information....", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (dr == DialogResult.OK)
                    {
                        login log = new login();
                        MainClass.showWindow(log, this, MDI.ActiveForm);
                    }
                }
                else
                {
                    MessageBox.Show("Please fill above fields");
                }
            }
            else
            {
                if (serverTxt.Text != "" && dbTxt.Text != "" && userTxt.Text != "" && passTxt.Text != "")
                {
                    s = "Data Source=" + serverTxt.Text + ";Initial Catalog=" + dbTxt.Text + ";User ID=" + userTxt.Text + ";Password="******";";
                    File.WriteAllText(path + "\\connect", s);
                    DialogResult dr = MessageBox.Show("Saved Successfully....", "Information....", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (dr == DialogResult.OK)
                    {
                        login log = new login();
                        MainClass.showWindow(log, this, MDI.ActiveForm);
                    }
                }
                else
                {
                    MessageBox.Show("Please fill above fields");
                }
            }
        }
コード例 #5
0
        private void saveBTN_Click(object sender, EventArgs e)
        {
            string s;
            string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            if (isCB.Checked)
            {
                if (serverTXT.Text != "" && databaseTXT.Text != "")
                {
                    s = "Data Source=" + serverTXT.Text + ";Initial Catalog=" + databaseTXT.Text + ";Integrated Security=true;";
                    File.WriteAllText(path + "\\connect", s);
                    DialogResult dr = MessageBox.Show("Settings Successfully Saved !!!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (dr == DialogResult.OK)
                    {
                        login log = new login();
                        MainClass.showWindow(log, this, MDi.ActiveForm);
                    }
                }

                else
                {
                    MessageBox.Show("Please give complete data for continue");
                }
            }
            else
            {
                if (serverTXT.Text != "" && databaseTXT.Text != "" && userTXT.Text != "" && passTXT.Text != "")
                {
                    s = "Data Source=" + serverTXT.Text + ";Initial Catalog=" + databaseTXT.Text + ";User Id=" + userTXT.Text + ";Password="******";";
                    File.WriteAllText(path + "\\connect", s);
                }
                else
                {
                    MessageBox.Show("Please give complete data for continue");
                }
            }
        }