Esempio n. 1
0
        private void MainGrid_SelectedItemChanged(object sender, DevExpress.Xpf.Grid.SelectedItemChangedEventArgs e)
        {
            if (e.OldItem == null)
            {
                return;
            }

            model = e.NewItem as TB_VietnamCompany;
            EditGrid.DataContext = model;
        }
Esempio n. 2
0
        void DelModel()
        {
            if (MainGrid.SelectedItem == null)
            {
                MessageBox.Show("请选择一行");
                return;
            }

            if (MessageBox.Show("是否确认删除?", "删除确认", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                model         = MainGrid.SelectedItem as TB_VietnamCompany;
                model.FStatus = false;
                visaORM.ObjectStateManager.ChangeObjectState(model, System.Data.EntityState.Modified);
                visaORM.SaveChanges();
                vietnamCollection.Remove(model);
            }
        }
Esempio n. 3
0
 void NewModel()
 {
     model = new TB_VietnamCompany();
     EditGrid.DataContext = model;
 }