2014年4月7日 星期一

LightSwitch – Query, Visual Studio 2013

 

http://msdn.microsoft.com/en-us/vstudio/gg604823

http://blogs.msdn.com/b/lightswitch/archive/2013/11/07/new-navigation-features-in-lightswitch-html-client-chris-rummel-rohit-agrawal.aspx

http://msdn.microsoft.com/en-us/library/ee256728(v=vs.120).aspx

Query

http://blogs.msdn.com/b/msdntaiwan/archive/2014/04/01/vs2013-lightswitch-4.aspx

1) Add Query from Application Data

4. Change parameters to become Optional

image

Following are two query example for different Application Data

image

 

2) Browse Screen

Instead of create a new Browse Screen, we can just change the original one on its Query Source to new added query.

image

Drag & drop 2 parameters to layout and change their Control Type to Date Picker

image

The result is like below:

image

 

3) Add Query from Application Data, but search UPPER level table

1. We can add a group of filter like 4 which is query on upper level table (Customer, system enable for us by default) 2. We can also use only one parameter (FindString, in the example) to query on different fields of Cutomer and Phone tables

image

 

4) Browse Screen

Add another brwose screen base on new query added above, SearchByNameOrPhone

image

Results are like below:

SNAGHTML75bba3

Query by Phone:

SNAGHTML76b491

Query by Name:

SNAGHTML772991

 

5) Screen Navigation

1. Right click on HTMLClient of Solution Explorer –> Click Edit Screen Navigation

2. Add two browse screens in Screen Navigation menu

image

The result is like

SNAGHTML8317e5

沒有留言:

張貼留言