private void simpleButtonSave_Click(object sender, EventArgs e) { if (bindingSourceMain.Current != null) { if (bindingSourceMain.Current is UserX) { bindingSourceMain.EndEdit(); bindingSourceMain.ResetBindings(false); UserX currentUser = bindingSourceMain.Current as UserX; currentUser.Update(); } } }
public static void Test() { EntityModules.Global.Add <TestModule>(); var user = new UserX { Name = "Stone", RoleID = 1 }; user.Save(); user.Name = "大石头"; user.Update(); user.Delete(); }