Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                _zrodlo = new Class_Data();

                _cel = new Class_Data();

                _bt_polacz = bt_polacz;

                _bt_polacz_cel = bt_polacz_cel;

                bt_podglad.Enabled = false;

                bt_podglad_cel.Enabled = false;

                bt_integruj.Enabled = false;

                if (ustawienia.Default.zrodlo_login == "")
                {
                    bt_polacz.Enabled = false;
                }

                if (ustawienia.Default.cel_login == "")
                {
                    bt_polacz_cel.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Błąd ładowania", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        private void bt_test_Click(object sender, EventArgs e)
        {
            try
            {
                this._polaczenie = new Class_Data();

                this._polaczenie.Connect_MsSQL(tb_host.Text, tb_baza.Text, tb_login.Text, tb_haslo.Text);

                if (this._polaczenie.error_db != null)
                {
                    throw new Exception(this._polaczenie.error_db);
                }
                else
                {
                    MessageBox.Show("Połączenie powiodło się !", "Testu połączenia", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    bt_zapisz.Enabled = true;

                    if (this._polaczenie.isOpen_MsSQL())
                    {
                        this._polaczenie.Close_MsSQL();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Błąd testu połączenia", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
        private void glowny_Load(object sender, EventArgs e)
        {
            try
            {
                this._zrodlo = new Class_Data();

                this._cel = new Class_Data();

                this.bt_integruj.Enabled = false;

                this.bt_podglad_zrodlo.Enabled = false;

                this.bt_poglad_cel.Enabled = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Błąd ładowania głównego okna", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }