private void txtStokKodu_KeyUp(object sender, KeyEventArgs e) { if (!string.IsNullOrEmpty(txtStokKodu.Text) && e.KeyCode == Keys.Tab) { try { //if(_currentStok==null) _currentStok = mngStk.GetById(txtStokKodu.Text, false); if (_currentStok != null) { txtStokIsmi.Text = _currentStok.StokAdi; txtBarkod.Text = _currentStok.Barkod1; txtKdv.Text = _currentStok.KdvOrani.FromNullableToString(); if (_selectedSipKalId == null || _selectedStokKodu != txtStokKodu.Text) { SetFiyat(); } cmbBirim.Focus(); } else { frmStok frm = new frmStok(this, _ftirsip); txtStokKodu.CloseAutoComplete(); frm.txtStokIsmi.Focus(); frm.WindowState = FormWindowState.Maximized; frm.ShowDialog(); } } catch (Exception exc) { MessageBox.Show(exc.Message); LogWrite.Write(exc); } } }
void yeniKayit() { if (_stokKaydet) { frmStok frm = new frmStok(); frm.Owner = this; frm.ShowDialog(); LoadStok(); } }