Beispiel #1
0
        private void Disciplines_Load(object sender, EventArgs e)
        {
            //dataGridView1.DataSource = MainForm.FunctionOfAdding(nameoftable);

            var data1 = new List <Dvapolya>();

            Date_baseone = new dabse.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Медведев.mdb");
            Date_baseone.Open();
            dabse.OleDbCommand    com1      = new dabse.OleDbCommand("Select Название, Шифр FROM Специальности", Date_baseone);
            dabse.OleDbDataReader resulter1 = com1.ExecuteReader();

            while (resulter1.Read() == true)
            {
                var mc = new Dvapolya
                {
                    secondpole = resulter1[0].ToString().Trim(),
                    firstpole  = resulter1[1].ToString().Trim()
                };
                data1.Add(mc);
            }

            comboBox1.DataSource    = data1;
            comboBox1.DisplayMember = "secondpole";
            comboBox1.ValueMember   = "firstpole";
        }
Beispiel #2
0
        private void GroupsStudy_Load(object sender, EventArgs e)
        {
            Date_baseone.Open();
            var data1 = new List <Dvapolya>();
            var data2 = new List <Dvapolya>();
            var data3 = new List <string>();

            dabse.OleDbCommand    com1      = new dabse.OleDbCommand("Select Название, Номер FROM Группы", Date_baseone);
            dabse.OleDbDataReader resulter1 = com1.ExecuteReader();

            while (resulter1.Read() == true)
            {
                var mc = new Dvapolya
                {
                    secondpole = resulter1[0].ToString().Trim(),
                    firstpole  = resulter1[1].ToString().Trim()
                };
                data1.Add(mc);
            }
            dabse.OleDbCommand    com2      = new dabse.OleDbCommand("Select Фамилия, Имя, Отчество, Шифр FROM Студенты", Date_baseone);
            dabse.OleDbDataReader resulter2 = com2.ExecuteReader();

            while (resulter2.Read() == true)
            {
                var mc = new Dvapolya
                {
                    secondpole = resulter2[0].ToString().Trim() + " " + resulter2[1].ToString().Trim() + " " + resulter2[2].ToString().Trim(),
                    firstpole  = resulter2[3].ToString().Trim()
                };
                data2.Add(mc);
            }

            dabse.OleDbCommand    com3      = new dabse.OleDbCommand("SELECT DISTINCT (Группы_обучение.Год) FROM Группы_обучение", Date_baseone);
            dabse.OleDbDataReader resulter3 = com3.ExecuteReader();

            while (resulter3.Read() == true)
            {
                var mc = resulter3[0].ToString().Trim();
                data3.Add(mc);
            }

            comboBox1.DataSource    = data1;
            comboBox1.DisplayMember = "secondpole";
            comboBox1.ValueMember   = "firstpole";

            comboBox2.DataSource    = data2;
            comboBox2.DisplayMember = "secondpole";
            comboBox2.ValueMember   = "firstpole";

            comboBox3.DataSource = data3;
        }
Beispiel #3
0
        private void Students_Load(object sender, EventArgs e)
        {
            var data1 = new List <Dvapolya>();

            Date_baseone = new dabse.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Медведев.mdb");
            Date_baseone.Open();
            dabse.OleDbCommand    com1     = new dabse.OleDbCommand("Select Название, Шифр FROM Специальности", Date_baseone);
            dabse.OleDbDataReader resulter = com1.ExecuteReader();

            while (resulter.Read() == true)
            {
                var mc = new Dvapolya
                {
                    secondpole = resulter[0].ToString().Trim(),
                    firstpole  = resulter[1].ToString().Trim()
                };
                data1.Add(mc);
            }

            specialnost.DataSource    = data1;
            specialnost.DisplayMember = "secondpole";
            specialnost.ValueMember   = "firstpole";

            var data2 = new List <Dvapolya>();
            var nc    = new Dvapolya
            {
                secondpole = "обучается",
                firstpole  = "1"
            };

            data2.Add(nc);
            var nc1 = new Dvapolya
            {
                secondpole = "отчислен",
                firstpole  = "2"
            };

            data2.Add(nc1);

            priznakotchis.DataSource    = data2;
            priznakotchis.DisplayMember = "secondpole";
            priznakotchis.ValueMember   = "firstpole";
        }
Beispiel #4
0
        private void Ocenochki_Load(object sender, EventArgs e)
        {
            var data1 = new List <Dvapolya>();

            Date_baseone = new dabse.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Медведев.mdb");
            Date_baseone.Open();
            dabse.OleDbCommand    com1     = new dabse.OleDbCommand("Select Фамилия, Шифр FROM Студенты", Date_baseone);
            dabse.OleDbDataReader resulter = com1.ExecuteReader();

            while (resulter.Read() == true)
            {
                var mc = new Dvapolya
                {
                    secondpole = resulter[0].ToString().Trim(),
                    firstpole  = resulter[1].ToString().Trim()
                };
                data1.Add(mc);
            }

            familiya.DataSource    = data1;
            familiya.DisplayMember = "secondpole";
            familiya.ValueMember   = "firstpole";
        }
Beispiel #5
0
        private void SwichToSpec_Click(object sender, EventArgs e)
        {
            Dvapolya specs = new Dvapolya();

            specs.Show();
        }