LS2013 Core Project – Tables for tile menus

Here we’ll be creating the tables and queries for managing our MetroUI screen tiles. Hang in there!

  1. In Visual Studio
  2. In LsCoreProject.Server
  3. Right click and add a table as noted below
  4. Name it: Icon

    Icon Table

  5. Add another table, name it Menu

    Menu Table

  6. Add our final table, Name it MenuTile

    Menu Tile Table

  7. Add choice lists for the following fields in MenuTile

    Tile Type List

    Tile Size List

  8. Add another choice list for OnClick, value: a, Display: a
  9. Still on the MenuTile table screen
  10. Add the following relationships
  11. Take note of the Navigation Properties!

    Menu to Menu Tile Relationship

    Menu Tile to Icon Relationship

    Menu Tile to Permission Relationship

  12. Take note of the bottom Foreign Key settings… Important!!!
  13. Now we need to create one query, still in the Menu Tile table
  14. Click on Query
  15. Add the following as noted below, name it TilesForMenu

    Tiles for menu query

  16. After creating the query, in Properties for this Query
  17. Click on Edit Additional Query Code and add the following
    			// Get the current user permissions
    			var userPermissions = this.Application.User.EffectivePermissions;
    
    			// Only pull tiles that meet the requirements, including permission level
    			query = from menuTiles in query
    				where menuTiles.Menu.Name == MenuName && (menuTiles.PermissionId == null || userPermissions.Contains(menuTiles.PermissionId))
    				orderby menuTiles.Order, menuTiles.Name
    				select menuTiles;
    
    
  18. One last piece… setting defaults
  19. Still in the MenuTile table
  20. At the bottom of the screen click on the App tab
  21. Click on Write Code, select created
  22. Add the following code into the created method
    	// Create defaults for our required, except for name of the tile
    	entity.TileColor = "lightblue";
    	entity.Type = "simple";
    	entity.Size = "default";
    
  23. Save your work and move on!

Database work for the tiles is done!

Next… Screens For Icon Management


Here are the topics and their logical order:

  1. Create the project
  2. Add external CSS
  3. Add external scripts
  4. Update the default.htm
  5. Add LogIn/LogOut/Register/ChangePassword
  6. Create the security data source
  7. Screens for permissions
  8. Screens for role management
  9. Screens for user management
  10. — You
  11. Screens for icon management
  12. Screens for menu management
  13. Create a tile menu screen
  14. Create a database project
  15. How to deploy successfully
  16. Wrap up

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: