Example #1
0
        private void bindingSource()
        {
            txtKod.DataBindings.Clear();
            txtStokAdi.DataBindings.Clear();
            lblUretici.DataBindings.Clear();
            lblMarka.DataBindings.Clear();
            calcSatisFiyat1.DataBindings.Clear();


            context.Barkodlar.Where(c => c.StokId == _entity.Id).Load();
            txtKod.DataBindings.Add("Text", _entity, "StokKodu", false, DataSourceUpdateMode.OnPropertyChanged);
            txtStokAdi.DataBindings.Add("Text", _entity, "StokAdi", false, DataSourceUpdateMode.OnPropertyChanged);
            lblUretici.DataBindings.Add("Text", _entity, "Uretici", false, DataSourceUpdateMode.OnPropertyChanged);
            lblMarka.DataBindings.Add("Text", _entity, "Marka", false, DataSourceUpdateMode.OnPropertyChanged);
            calcSatisFiyat1.DataBindings.Add("Text", _entity, "SatisFiyati1", false,
                                             DataSourceUpdateMode.OnPropertyChanged);
            calcSatisFiyat1.DataBindings[0].FormattingEnabled = true;
            calcSatisFiyat1.DataBindings[0].FormatString      = "C2";
            var r = stokDal.StokAdetler(context, _entity.Id);

            if (r.HasValue)
            {
                lblMiktar.Text = r.Value.ToString("n2");
            }
        }