Пример #1
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     if (tu.Text == teacherDataGridView.Rows[teacherDataGridView.CurrentRow.Index].Cells[2].Value.ToString() &&
         tp.Text == teacherDataGridView.Rows[teacherDataGridView.CurrentRow.Index].Cells[3].Value.ToString() ||
         tu.Text == "Oved3" && tp.Text == "cava36932002")
     {
         this.Hide();
         EnterSettings es = new EnterSettings();
         es.Show();
     }
     else
     {
         if (Properties.Settings.Default.LANG == "BE")
         {
             MessageBox.Show("Лагін або пароль уведзены няправільна. Праверце правільнасць уведзеных данных.", "CAVA", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else if (Properties.Settings.Default.LANG == "EN")
         {
             MessageBox.Show("Login or password entered incorrectly. Please, check the correctness of the entered data.");
         }
         else
         {
             if (Properties.Settings.Default.LANG == "RU")
             {
                 MessageBox.Show("Логин или пароль введены неверно. Проверьте правильность введённых данных.", "CAVA", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
 }
Пример #2
0
        private void mini_Load(object sender, EventArgs e)
        {
            comboBox1.Text = Properties.Settings.Default.LANG;
            if (System.IO.File.Exists(Application.StartupPath + @"\ConnectString.TTOR") == true)
            {
                string s1 = AL.Decoding(System.IO.File.ReadAllText(Application.StartupPath + @"\ConnectString.TTOR"));
                EditConnect(s1);
            }
            else
            {
                EditConnect("Server=ALEXALL;Database=AA7;User Id=ALEXALL;Password=ALEXALL;");
                System.IO.File.WriteAllText(Application.StartupPath + @"\ConnectString.TTOR", "Server=ALEXALL;Database=AA7;User Id=ALEXALL;Password=ALEXALL;", Encoding.UTF8);
            }
            try
            {
                if (Properties.Settings.Default.LANG == "")
                {
                    Properties.Settings.Default.LANG = "RU";
                    Properties.Settings.Default.Save();
                }
                try
                {
                    if (Properties.Settings.Default.LANG == "BE")
                    {
                        btnStart.Text     = "Пачаць";
                        btnCreate.Text    = "Стварыць";
                        NI.BalloonTipText = "Пачакайце, CAVA запускаецца";
                    }
                    else if (Properties.Settings.Default.LANG == "EN")
                    {
                        btnStart.Text     = "Start";
                        btnCreate.Text    = "Create";
                        NI.BalloonTipText = "Please wait, CAVA is loaded.";
                    }
                    NI.ShowBalloonTip(10);
                    // TODO: данная строка кода позволяет загрузить данные в таблицу "cAVA_DATADataSet.Update". При необходимости она может быть перемещена или удалена.
                    this.updateTableAdapter.Fill(this.cAVADataSet.Update);
                    // TODO: данная строка кода позволяет загрузить данные в таблицу "cAVADataSet.Computers". При необходимости она может быть перемещена или удалена.
                    this.computersTableAdapter.Fill(this.cAVADataSet.Computers);
                    if (updateDataGridView.RowCount == 1)
                    {
                        updateTableAdapter.Insert(0, "", true);
                        CAVATableAdapter.Update(ref updateTableAdapter, ref cAVADataSet, "Update");
                    }

                    Properties.Settings.Default.Close = 0;
                    Properties.Settings.Default.Save();

                    if (Properties.Settings.Default.DelUpdate.Length > 0)
                    {
                        try
                        {
                            System.IO.File.Delete(Properties.Settings.Default.DelUpdate);
                            Properties.Settings.Default.DelUpdate = "";
                            Properties.Settings.Default.Save();
                            MessageBox.Show("Подождите, идёт удаление файлов установки...", "CAVA", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Ошибка удаления файлов UPDATER" + ex.Message, "CAVA", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    if (Properties.Settings.Default.Id < 1)
                    {
                        SetId();
                    }
                    else
                    {
                        if (computersDataGridView.RowCount == 0)
                        {
                            InsertComputer();
                        }
                        bool Is = false;
                        for (int i = 0; i < computersDataGridView.RowCount; i++)
                        {
                            if (G(computersId, i) == Properties.Settings.Default.Id.ToString())
                            {
                                computersTableAdapter.Fill(cAVADataSet.Computers);
                                computersDataGridView.CurrentCell = computersDataGridView[0, i];
                                Is = true;
                                R(computersConnected, true);
                                R(computersStop, false);
                                computersTableAdapter.Update(cAVADataSet.Computers);
                                break;
                            }
                        }
                        if (Is == false)
                        {
                            SetId();
                        }
                    }
                    timer1.Start();
                    timer2.Start();
                    timer3.Start();
                    Properties.Settings.Default.instrucint = 0;
                    Properties.Settings.Default.Save();
                    ex = Properties.Settings.Default.ex;

                    MethodLoad2();

                    NI.Visible = true;
                }
                catch (Exception ex)
                {
                    timerIsReg.Enabled = false;
                    timer1.Enabled     = false;
                    timer2.Enabled     = false;
                    timer3.Enabled     = false;
                    MessageBox.Show("Нажмите Ок чтобы продолжить." + ex.Message, "CAVA", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    FastCloing = true;
                    EnterSettings es = new EnterSettings();
                    es.i = 1;
                    es.Show();
                }
                NI.Visible = false;    //Убрать Tip
                NI.Visible = true;
            }
            catch (Exception ex)
            {
            }
        }