예제 #1
0
파일: Connect.cs 프로젝트: Ksurys/Reu-bux
        public void _BU_Status(bool value)
        {
            Action Act = () =>
            {
                checking = false;
                switch (value)
                {
                case (true):
                    get_server_list            = false;
                    toolStripStatusLabel3.Text = "Подключение установлено!";
                    toolStripButton1.Enabled   = true;
                    break;

                case (false):
                    toolStripStatusLabel3.Text = "Отсутствует подключение!";
                    panel1.Visible             = true;
                    _BU              = new Base_Using();
                    _BU.List_Server += _BU_List_Server;
                    Thread Th1 = new Thread(_BU.Get_Server_List);
                    Th1.Start();
                    break;
                }
            };

            Invoke(Act);
        }
예제 #2
0
파일: Connect.cs 프로젝트: Ksurys/Reu-bux
        private void Connect_Load(object sender, EventArgs e)
        {
            _BU         = new Base_Using();
            _BU.Status += _BU_Status;
            toolStripStatusLabel3.Text = "Проверка подключения";
            Thread Th1 = new Thread(_BU.Connection_State);

            Th1.Start();
        }
예제 #3
0
파일: Connect.cs 프로젝트: Ksurys/Reu-bux
        private void button1_Click(object sender, EventArgs e)
        {
            _BU           = new Base_Using();
            _BU.List_Dbs += _BUList_Dbs;
            Reg_Info.DS   = comboBox1.Text;
            Reg_Info.UN   = textBox1.Text;
            Reg_Info.UP   = textBox2.Text;
            Thread Th = new Thread(_BU.Get_Base_List);

            Th.Start();
        }
예제 #4
0
파일: Connect.cs 프로젝트: Ksurys/Reu-bux
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            //Program.SYSACCESS = Convert.ToInt32(_CmdSql.ExecuteScalar().ToString());
            {
                switch (toolStripTextBox1.Text == "")
                {
                case (true):
                    toolStripTextBox1.BackColor = Color.Red;
                    break;

                case (false):
                    _BU = new Base_Using();
                    _BU.Autorization(toolStripTextBox1.Text);
                    if (Program.AUTH == 1)
                    {
                        Form MM = new MainMenu();
                        MM.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Пользователь не найден");
                    }
                    toolStripTextBox1.BackColor = Color.White;
                    break;
                }
            }
//ПРОБОВАЛА РАЗГРАНИЧЕНИЕ

            //_RI.Set_Connection(); //Установка соединения с базой
            //_RI.Connection.Open();
            //switch (Program.SYSACCESS) //Проверка значения из переменной SYSACCESS в классе Program
            //{

            //    case 0:
            //        _RI.Connection.Close();
            //        Program.ADMINACCESS = false;
            //        //Program.BACKTOADMIN = true;
            //        MainMenu MM = new MainMenu();
            //        MM.Show();
            //        this.Close();
            //        break;
            //    case 1:
            //        _RI.Connection.Close();
            //        Program.ADMINACCESS = true;
            //        //Program.BACKTOADMIN = true;
            //        MainMenu MN = new MainMenu();
            //        MN.Show();
            //        this.Close();
            //        break;

            //}
        }