Esempio n. 1
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string query = "select ID_tovara,ID_kategorii,Nazvanie,Opisanie,Srok_eksplotacii,Sostoianie_prodaji,Kachestvo_tovara,Srok_otkladivania_tovara_v_nedelah from dbo.Tovar";
            var    list  =
                DBConnectionService.SendQueryToSqlServer(query)?.Select(row => new IdentityItem(row[0], row[1])).ToArray();

            comboBox1.Items.Clear();
            comboBox1.Items.AddRange(list);
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string query = @"SELECT Klienti.ID_klienta, Klienti.Familia,Klienti.Imia,Klienti.Otchestvo,Klienti.Nomer_pasporta,Klienti.Ceria_pasporta,Sdacha_v_Lambard.Data_sdachi,Tovar.Nazvanie,Tovar.ID_kategorii FROM dbo.Klienti,dbo.Sdacha_v_Lambard,dbo.Tovar where Tovar.Nazvanie = 'Холодильник' and (Sdacha_v_Lambard.Data_sdachi between '2005-10-04' and '2007-09-19') and Klienti.ID_klienta = '9' and Tovar.ID_kategorii = '19'";
            var    list  = DBConnectionService.SendQueryToSqlServer(query);

            Задание_1.ClearAndAddColumnsDataGridView(dataGridView1, "ID_klienta", "Familia", "Imia", "Otchestvo", "Nomer_pasporta", "Ceria_pasporta", "Data_sdachi", "Nazvanie", "ID_kategorii");
            foreach (var row in list)
            {
                dataGridView1.Rows.Add(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8]);
            }
        }
Esempio n. 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string query = "select * from Cylindr_Head";

            if (!string.IsNullOrEmpty(TextBox1.Text))
            {
                query += "where Cylindr_Head= '" + TextBox1.Text + "'";
            }
            var list = DBConnectionService.SendQueryToSqlServer(query);

            dataGridView1.Columns.Clear();
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string query = @"SELECT distinct Klienti.ID_klienta,Klienti.Familia,Klienti.Imia,Klienti.Otchestvo,Cena.Summa_dla_vikupa_veshei
            from dbo.Klienti,dbo.Cena
            order by Klienti.ID_klienta,Cena.Summa_dla_vikupa_veshei";
            var    list  = DBConnectionService.SendQueryToSqlServer(query);

            Form6.ClearAndAddColumnsDataGridView(dataGridView1, "Klienti.ID_klienta", "Klienti.Familia", "Klienti.Imia", "Klienti.Otchestvo", "Cena.Summa_dla_vikupa_veshei");
            foreach (var row in list)
            {
                dataGridView1.Rows.Add(row[0], row[1], row[2], row[3], row[4]);
            }
        }
Esempio n. 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            string query = @"select Klienti.Imia,Klienti.Familia,Klienti.Otchestvo,Tovar.Srok_otkladivania_tovara_v_nedelah,Sdacha_v_Lambard.Data_prodaji,Tovar.Sostoianie_prodaji
              from dbo.Klienti, dbo.Sdacha_v_Lambard, dbo.Tovar
              where Tovar.Srok_otkladivania_tovara_v_nedelah = '1'and Tovar.Sostoianie_prodaji != 'Распродан'";
            var    list  = DBConnectionService.SendQueryToSqlServer(query);

            Form2.ClearAndAddColumnsDataGridView(dataGridView1, "Familia", "Imia", "Otchestvo", "Srok_otkladivania_tovara_v_nedelah", "Data_prodaji", "Sostoianie_prodaji");
            foreach (var row in list)
            {
                dataGridView1.Rows.Add(row[0], row[1], row[2], row[3], row[4], row[5]);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string query = @"SELECT Tovar.Nazvanie,Tovar.Kachestvo_tovara,Sdacha_v_Lambard.Data_nevozvrata
            from dbo.Tovar,dbo.Sdacha_v_Lambard
            where Tovar.Kachestvo_tovara = 'Самый новый' and Tovar.Nazvanie = 'Телевизор х9999'";
            var    list  = DBConnectionService.SendQueryToSqlServer(query);

            Form4.ClearAndAddColumnsDataGridView(dataGridView1, "Tovar.Nazvanie", "Tovar.Kachestvo_tovara", "Sdacha_v_Lambard.Data_nevozvrata");
            foreach (var row in list)
            {
                dataGridView1.Rows.Add(row[0], row[1], row[2]);
            }
        }
Esempio n. 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            string query = @"SELECT count(Kategorii_tovarov.Nasvanie),Nasvanie
            from dbo.Kategorii_tovarov
            group by Nasvanie";
            var    list  = DBConnectionService.SendQueryToSqlServer(query);

            Form5.ClearAndAddColumnsDataGridView(dataGridView1, "Kategorii_tovarov.Nasvanie");
            foreach (var row in list)
            {
                dataGridView1.Rows.Add(row[0], row[1]);
            }
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            string query = @"SELECT Sdacha_v_Lambard.Data_nevozvrata,Tovar.Sostoianie_prodaji,SUM (Summa)
             from dbo.Sdacha_v_Lambard,dbo.Tovar
             where Tovar.Sostoianie_prodaji != 'Распродан' and Sdacha_v_Lambard.Data_nevozvrata < '2007-05-01'
             group by Sdacha_v_Lambard.Data_nevozvrata,Tovar.Sostoianie_prodaji";
            var    list  = DBConnectionService.SendQueryToSqlServer(query);

            Form3.ClearAndAddColumnsDataGridView(dataGridView1, "Sdacha_v_Lambard.Data_nevozvrata", "Tovar.Sostoianie_prodaji", "Summa");
            foreach (var row in list)
            {
                dataGridView1.Rows.Add(row[0], row[1], row[2]);
            }
        }
Esempio n. 9
0
        private void button1_Click(object sender, EventArgs e)
        {
            string query = "select * from Cena";

            if (!string.IsNullOrEmpty(textBox1.Text))
            {
                query += "where Cena= '" + textBox1.Text + "'";
            }
            var list = DBConnectionService.SendQueryToSqlServer(query);

            dataGridView1.Rows.Clear();
            foreach (var l in list)
            {
                dataGridView1.Rows.Add(l[0], l[1], l[2], l[3], l[4], l[5]);
            }
            dataGridView1.Refresh();
        }