示例#1
0
            public static void Test()
            {
                EntityModules.Global.Add <TestModule>();

                var user = new UserX
                {
                    Name   = "Stone",
                    RoleID = 1
                };

                user.Save();

                user.Name = "大石头";
                user.Update();

                user.Delete();
            }
示例#2
0
 private void navBarItemDelete_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
 {
     int[] selectedRows = gridViewUser.GetSelectedRows();
     if (selectedRows.Length > 0)
     {
         List <UserX> listUser = new List <UserX>();
         foreach (var eachvar in selectedRows)
         {
             listUser.Add(this.gridViewUser.GetRow(eachvar) as UserX);
         }
         for (int index = 0; index < listUser.Count; index++)
         {
             UserX deleteuser = listUser[index];
             deleteuser.Delete();
         }
     }
     else
     {
         ////Object currentDataRow = this.gridViewUser.GetDataRow(this.gridViewUser.FocusedRowHandle);
     }
 }