Lightswitch:具有字符串和整数搜索属性的参数(可以吗?) [英] Lightswitch: parameter with string and integer searching properties (is it possible?)

查看:109
本文介绍了Lightswitch:具有字符串和整数搜索属性的参数(可以吗?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2013 Lightswitch的HTML客户端中,只是一个简单的问题,是否有可能基于查询设置参数字段以允许同时查询字符串值和整数值...

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...

一个示例是StaffID(int)和StaffName(string)...

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

欢呼声

推荐答案

当然-如果Java没有隐式进行转换,则只需将.ToString()出现在int上时添加到搜索查询参数即可.

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

例如

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.

这篇关于Lightswitch:具有字符串和整数搜索属性的参数(可以吗?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆