Esempio n. 1
0
        private void textBox5_TextChanged(object sender, EventArgs e)
        {
            DatabaseIslem di       = new DatabaseIslem();
            string        sorguara = $"select *from Urunler where Adi like '%{textBox5.Text}%'";
            DataTable     dt       = Sorgu.SQLSorguCalistir(sorguara);

            dataGridView1.DataSource = di.UrunListe(dt);
        }
Esempio n. 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            DatabaseIslem di          = new DatabaseIslem();
            string        stoksorgusu = $"select * from Urunler where Stok=0";
            DataTable     dt          = Sorgu.SQLSorguCalistir(stoksorgusu);

            dataGridView1.DataSource = di.UrunListe(dt);
            textBox3.BackColor       = Color.Black;
            textBox2.BackColor       = Color.White;
            textBox1.BackColor       = Color.White;
        }
Esempio n. 3
0
        private void button5_Click(object sender, EventArgs e)
        {
            DatabaseIslem di   = new DatabaseIslem();
            Urun          urun = new Urun();

            urun.Barkod = dataGridView1.SelectedRows[0].Cells["Barkod"].Value.ToString();
            string sorgusil = $"delete from Urunler where Barkod= '{urun.Barkod}'";

            if (Sorgu.SQLNonSorguCalistir(sorgusil) > 0)
            {
                MessageBox.Show($"{urun.Barkod} barkodlu ürün silinmiştir.");
            }
        }
Esempio n. 4
0
        private void ToptanciEkle_Load(object sender, EventArgs e)
        {
            DatabaseIslem di = new DatabaseIslem();

            dataGridView1.DataSource = di.GetListAll();
            dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[1].DefaultCellStyle.BackColor = Color.Black;
            dataGridView1.Columns[3].DefaultCellStyle.BackColor = Color.Black;
            dataGridView1.Columns[1].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns[3].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.RowsDefaultCellStyle.Font             = new Font("Comic Sans", 12, FontStyle.Bold);
            dataGridView1.DefaultCellStyle.SelectionBackColor   = Color.Red;
            dataGridView1.DefaultCellStyle.SelectionForeColor   = Color.White;
        }
Esempio n. 5
0
        private void Musteriler_Load(object sender, EventArgs e)
        {
            DatabaseIslem di    = new DatabaseIslem();
            string        sorgu = $"Select * from Musteri";
            DataTable     dt    = Sorgu.SQLSorguCalistir(sorgu);

            dataGridView1.DataSource = di.MusteriListe(dt);
            dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[1].DefaultCellStyle.BackColor = Color.Black;
            dataGridView1.Columns[3].DefaultCellStyle.BackColor = Color.Black;
            dataGridView1.Columns[1].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns[3].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.RowsDefaultCellStyle.Font             = new Font("Comic Sans", 12, FontStyle.Bold);
            dataGridView1.DefaultCellStyle.SelectionBackColor   = Color.Red;
            dataGridView1.DefaultCellStyle.SelectionForeColor   = Color.White;
        }
Esempio n. 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string        a, b, c;
            double        az = 0, nakit = 0, kredi = 0;
            Satis         satis = new Satis();
            DatabaseIslem di    = new DatabaseIslem();

            a = dateTimePicker2.Value.ToString("yyyy/MM/dd");
            b = dateTimePicker1.Value.ToString("yyyy/MM/dd");
            string    stoksorgusu = $"select * from Satis where '{b}'<= SatisTarihi and SatisTarihi <= '{a}'";
            DataTable dt          = Sorgu.SQLSorguCalistir(stoksorgusu);

            dataGridView1.DataSource = di.SatisList(dt);
            foreach (DataRow item in dt.Rows)
            {
                az = Convert.ToInt32(item["SatisTipi"]);
                c  = item["SatisTutar"].ToString();
                if (az == 1)
                {
                    nakit += Convert.ToDouble(c);
                }
                else
                {
                    kredi += Convert.ToDouble(c);
                }
            }
            label6.Text = nakit.ToString() + " TL";
            label7.Text = kredi.ToString() + " TL";
            label8.Text = (nakit + kredi).ToString() + " TL";
            dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[0].DefaultCellStyle.BackColor = Color.Black;
            dataGridView1.Columns[2].DefaultCellStyle.BackColor = Color.Black;
            dataGridView1.Columns[0].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.Columns[2].DefaultCellStyle.ForeColor = Color.White;
            dataGridView1.RowsDefaultCellStyle.Font             = new Font("Comic Sans", 12, FontStyle.Bold);
            dataGridView1.DefaultCellStyle.SelectionBackColor   = Color.Red;
            dataGridView1.DefaultCellStyle.SelectionForeColor   = Color.White;
        }