void DelModel() { if (MainGrid.SelectedItem == null) { MessageBox.Show("请选择一行"); return; } if (MessageBox.Show("是否确认删除?", "删除确认", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { model = MainGrid.SelectedItem as TB_AuditUser; model.FStatus = false; visaORM.ObjectStateManager.ChangeObjectState(model, System.Data.EntityState.Modified); visaORM.SaveChanges(); vietnamCollection.Remove(model); } }
/// <summary> /// 用于向 TB_AuditUser EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddToTB_AuditUser(TB_AuditUser tB_AuditUser) { base.AddObject("TB_AuditUser", tB_AuditUser); }
/// <summary> /// 创建新的 TB_AuditUser 对象。 /// </summary> /// <param name="fID">FID 属性的初始值。</param> public static TB_AuditUser CreateTB_AuditUser(global::System.Int32 fID) { TB_AuditUser tB_AuditUser = new TB_AuditUser(); tB_AuditUser.FID = fID; return tB_AuditUser; }
void NewModel() { model = new TB_AuditUser(); EditGrid.DataContext = model; }
private void MainGrid_SelectedItemChanged(object sender, DevExpress.Xpf.Grid.SelectedItemChangedEventArgs e) { if (e.OldItem == null) return; model = e.NewItem as TB_AuditUser; EditGrid.DataContext = model; }