void LoadData() { try { db = new KupiProdaiDBEntities(); db.tWorkers.Load(); dtSpotsman.ItemsSource = db.tWorkers.Local.ToBindingList(); } catch { MessageBox.Show("Ошибка"); db.Dispose(); } }
public WindowEdit(tWorker worker, KupiProdaiDBEntities d) { InitializeComponent(); db = d; sp = worker; tbFIO.Text = worker.sFIO; txAddress.Text = worker.address; dtpBithday.SelectedDate = worker.bithday; tbphone.Text = worker.phone; tbbase.Text = worker.base_worker; tbexp.Text = Convert.ToString(worker.experience); tbsp.Text = worker.special; tbprice.Text = Convert.ToString(worker.price); tbpas.Text = Convert.ToString(worker.passport); }