Lightswitch: parameter with string and integer searching properties (is it possible?)

百般思念 提交于 2019-12-11 17:12:57

问题


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:


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.



来源:https://stackoverflow.com/questions/25660497/lightswitch-parameter-with-string-and-integer-searching-properties-is-it-possi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!