Esempio n. 1
0
        private void Initialize()
        {
            _db                 = new FaturaContext();
            _secilenMusteri     = null;
            _secilenUrun        = null;
            _faturaDetaylari    = new HashSet <FaturaDetay>();
            _secilenFaturaDetay = null;

            dgvYeniFatura.DataSource = _faturaDetaylari;

            FaturaDetay fatura = _db.FaturaDetays.ToList().LastOrDefault();

            _faturaID        = fatura == null ? 1 : fatura.FaturaID;
            lblFaturaID.Text = _faturaID.ToString();

            cbUrunAdi.DisplayMember = "UrunAdi";
            cbUrunAdi.ValueMember   = "UrunID";
            cbUrunAdi.DataSource    = _db.Urunler.ToList();

            cbMusteriSehir.DisplayMember = "Aciklama";
            cbMusteriSehir.ValueMember   = "IlId";
            cbMusteriSehir.DataSource    = _db.Iller.ToList();
            cbMusteriSehir.Enabled       = false;

            cbMusteriIlce.DisplayMember = "Aciklama";
            cbMusteriIlce.ValueMember   = "IlceId";
            cbMusteriIlce.DataSource    = _db.Ilceler.ToList();
            cbMusteriIlce.Enabled       = false;

            cbMusteri.DisplayMember = "MusteriUnvani";
            cbMusteri.ValueMember   = "MusteriID";
            cbMusteri.DataSource    = _db.Musteriler.ToList();
        }
        private void Initialize()
        {
            _db             = new FaturaContext();
            _secilenMusteri = null;
            _faturaMasters  = new List <FaturaMaster>();

            cbMusteriSehir.DisplayMember = "Aciklama";
            cbMusteriSehir.ValueMember   = "IlId";
            cbMusteriSehir.DataSource    = _db.Iller.ToList();
        }
 private void Initialize()
 {
     _db = new FaturaContext();
     dgvFaturaDetaylari.DataSource = _faturaDetays;
 }