Пример #1
0
        void DelModel()
        {
            if (MainGrid.SelectedItem == null)
            {
                MessageBox.Show("请选择一行");
                return;
            }

            if (MessageBox.Show("是否确认删除?", "删除确认", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                model = MainGrid.SelectedItem as TCountry;
                visaORM.DeleteObject(model);
                countryCollection.Remove(model);

            }
        }
Пример #2
0
 void NewModel()
 {
     model = new TCountry();
     EditGrid.DataContext = model;
 }
Пример #3
0
 /// <summary>
 /// 创建新的 TCountry 对象。
 /// </summary>
 /// <param name="fID">FID 属性的初始值。</param>
 public static TCountry CreateTCountry(global::System.Int32 fID)
 {
     TCountry tCountry = new TCountry();
     tCountry.FID = fID;
     return tCountry;
 }
Пример #4
0
        private void MainGrid_SelectedItemChanged(object sender, DevExpress.Xpf.Grid.SelectedItemChangedEventArgs e)
        {
            if (e.OldItem == null)
                return;

            model = e.NewItem as TCountry;
            EditGrid.DataContext = model;
        }
Пример #5
0
 /// <summary>
 /// 用于向 TCountry EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToTCountry(TCountry tCountry)
 {
     base.AddObject("TCountry", tCountry);
 }