Lightswitch: parameter with string and integer sea

2019-09-06 15:36发布

Just a quick question within the HTML Client side of Visual Studio 2013 Lightswitch, is it possible to set a parameter field based from a query to allow both sting and interger values to be searched...

an example would be StaffID(int) and StaffName(string)...

cheers guys

1条回答
劳资没心,怎么记你
2楼-- · 2019-09-06 16:25

Sure - just add a .ToString() when you present on your int to the search query argument if Javascript isn't doing the conversion implicitly.

e.g.

searchString = intField.ToString() + ((intField==null)?" ";"") 
                  + strField.ToString() + ((strField==null)?" ";"")
                  + datefield.ToString()

Add this into the Executing event of the button that submits the search. Make sure you use the "Contains" operator if you're going to try a concatenated search string like the one I've built here.

查看更多
登录 后发表回答