Example #1
0
File: Auth.cs Project: Mariavin/WPF
        private void button6_Click(object sender, EventArgs e)
        {
            string login = textBox1.Text.Trim();
            string pass  = textBox2.Text;

            if (login.Equals("admin") && pass.Equals("password"))
            {
                Admin adminForm = new Admin();
                adminForm.Show();
                this.Hide();
            }
            else
            {
                var students = UnionRepository.GetListOfStudents();
                if (students.Any(x => x.Login.Equals(login)))
                {
                    var currentStudent = students.Find(x => x.Equals(login));
                    if (currentStudent.CheckPasword(pass))
                    {
                        Form1 profOrg = new Form1(currentStudent);
                        profOrg.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Неправильное имя или пароль");
                    }
                }
                else
                {
                    MessageBox.Show("Неправильное имя или пароль");
                }
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            dataGridView1.Visible = true;

            //dataGridView1.DataSource = Class.MembersTradeUnion.GetStudents().DefaultView;
            var students = UnionRepository.GetListOfStudents();

            dataGridView1.DataSource = UnionConverter.StudentsListToTable(students).DefaultView;

            button5.Visible = true;
            button3.Visible = true;
            button4.Visible = true;
        }