Example #1
0
 private void btnKopyala_Click(object sender, EventArgs e)
 {
     if (gridView1.RowCount != 0)
     {
         secilen = Convert.ToInt32(gridView1.GetFocusedRowCellValue(colId));
         Entities.Tables.Masraf masrafEntity = new Entities.Tables.Masraf();
         masrafEntity = masrafDAL.GetByFilter(context, c => c.Id == secilen);
         frmMasrafIslem form = new frmMasrafIslem(masrafEntity, true);
         form.ShowDialog();
         if (form.saved)
         {
             MasrafListele();
         }
     }
     else
     {
         MessageBox.Show("Seçili Stok Bulunamadı");
     }
 }
Example #2
0
        public frmMasrafIslem(Entities.Tables.Masraf entity, bool kopyala = false)
        {
            InitializeComponent();

            if (kopyala)
            {
                _entity            = new Entities.Tables.Masraf();
                _entity.Id         = -1;
                _entity.MasrafKodu = "";
                _entity.Durumu     = entity.Durumu;
                _entity.MasrafAdi  = entity.MasrafAdi;
                _entity.Grubu      = entity.Grubu;
                _entity.Aciklama   = entity.Aciklama;
            }
            else
            {
                _entity = entity;
            }
            togDurum.DataBindings.Add("EditValue", _entity, "Durumu", false, DataSourceUpdateMode.OnPropertyChanged);
            txtKod.DataBindings.Add("Text", _entity, "MasrafKodu", false, DataSourceUpdateMode.OnPropertyChanged);
            txtMasrafAdi.DataBindings.Add("Text", _entity, "MasrafAdi", false, DataSourceUpdateMode.OnPropertyChanged);
            txtAciklama.DataBindings.Add("Text", _entity, "Aciklama", false, DataSourceUpdateMode.OnPropertyChanged);
            txtGrup.DataBindings.Add("Text", _entity, "Grubu", false, DataSourceUpdateMode.OnPropertyChanged);
        }