Beispiel #1
0
 private void FrmUrunListesi_Load(object sender, EventArgs e)
 {
     dto = bll.Select();
     dataGridView1.DataSource            = dto.Urunler;
     cmbKategori.DataSource              = dto.Kategoriler;
     cmbKategori.DisplayMember           = "KategoriAd";
     cmbKategori.ValueMember             = "ID";
     cmbKategori.SelectedIndex           = -1;
     dataGridView1.Columns[0].Visible    = false;
     dataGridView1.Columns[5].Visible    = false;
     dataGridView1.Columns[6].Visible    = false;
     dataGridView1.Columns[7].Visible    = false;
     dataGridView1.Columns[1].HeaderText = "Ürün Adı";
     dataGridView1.Columns[2].HeaderText = "Kategori";
     dataGridView1.Columns[3].HeaderText = "Stok Miktarı";
     dataGridView1.Columns[4].HeaderText = "Ürün Fiyatı";
 }
Beispiel #2
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            if (detayDTO.ID == 0)
            {
                MessageBox.Show("Seçim yapın");
            }
            DialogResult result = MessageBox.Show("Silinsinmi", "Dikkat", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                if (bll.Delete(detayDTO))
                {
                    MessageBox.Show("Silindi");
                    bll = new UrunBLL();
                    dto = bll.Select();
                    dataGridView1.DataSource = dto.Urunler;
                }
            }
        }
 private void FrmUyari_Load(object sender, EventArgs e)
 {
     dto         = bll.Select();
     dto.Urunler = dto.Urunler.Where(x => x.StokMiktar <= 50).ToList();
     if (dto.Urunler.Count == 0)
     {
         FrmMain frm = new FrmMain();
         this.Visible = false;
         frm.ShowDialog();
     }
     dataGridView1.DataSource            = dto.Urunler;
     dataGridView1.Columns[0].Visible    = false;
     dataGridView1.Columns[5].Visible    = false;
     dataGridView1.Columns[6].Visible    = false;
     dataGridView1.Columns[7].Visible    = false;
     dataGridView1.Columns[1].HeaderText = "Ürün Adı";
     dataGridView1.Columns[2].HeaderText = "Kategori";
     dataGridView1.Columns[3].HeaderText = "Stok Miktarı";
     dataGridView1.Columns[4].HeaderText = "Ürün Fiyatı";
 }
Beispiel #4
0
 private void btnGuncelle_Click(object sender, EventArgs e)
 {
     if (detayDTO.ID == 0)
     {
         MessageBox.Show("Ürün seçiniz");
     }
     else
     {
         FrmUrun frm = new FrmUrun();
         frm.isUpdate = true;
         frm.detaydto = detayDTO;
         frm.dto      = dto;
         this.Hide();
         frm.ShowDialog();
         this.Visible             = true;
         bll                      = new UrunBLL();
         dto                      = bll.Select();
         dataGridView1.DataSource = dto.Urunler;
     }
 }