You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
4.9 KiB
98 lines
4.9 KiB
using System.Linq.Expressions;
|
|
using QMAPP.Common.Web;
|
|
using System.Web.Routing;
|
|
|
|
namespace System.Web.Mvc.Html
|
|
{
|
|
/// <summary>
|
|
/// 智能感知文本框
|
|
/// 创建者:李炳海
|
|
/// 创建日期:2013.4.8
|
|
/// </summary>
|
|
public static class MyQPerceptTextbox
|
|
{
|
|
/// <summary>
|
|
/// 智能感知文本框
|
|
/// </summary>
|
|
/// <typeparam name="TModel">实体类型</typeparam>
|
|
/// <typeparam name="TProperty">属性</typeparam>
|
|
/// <param name="htmlHelper">htmlHelper</param>
|
|
/// <param name="expression">字段表达式</param>
|
|
/// <param name="kind">数据类别</param>
|
|
/// <param name="callBackFunc">回调</param>
|
|
/// <returns>html代码</returns>
|
|
public static MvcHtmlString QMyPerceptTextboxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, string kind, string callBackFunc)
|
|
{
|
|
return QMyPerceptTextboxFor(htmlHelper, expression, kind, callBackFunc, null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 智能感知文本框
|
|
/// </summary>
|
|
/// <typeparam name="TModel">实体类型</typeparam>
|
|
/// <typeparam name="TProperty">属性</typeparam>
|
|
/// <param name="htmlHelper">htmlHelper</param>
|
|
/// <param name="expression">字段表达式</param>
|
|
/// <param name="kind">数据类别</param>
|
|
/// <param name="callBackFunc">回调</param>
|
|
/// <param name="htmlAttributes">属性</param>
|
|
/// <param name="ps">参数</param>
|
|
/// <returns>html代码</returns>
|
|
public static MvcHtmlString QMyPerceptTextboxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, string kind, string callBackFunc, object htmlAttributes, params string[] ps)
|
|
{
|
|
if (QPerceptTextbox.MyDataGeter == null)
|
|
QPerceptTextbox.MyDataGeter = new AppDataGeter();
|
|
|
|
return QPerceptTextbox.QPerceptTextboxFor(htmlHelper, expression, null, kind, callBackFunc, htmlAttributes, ps);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 智能感知文本框
|
|
/// </summary>
|
|
/// <typeparam name="TModel">实体类型</typeparam>
|
|
/// <typeparam name="TProperty">属性</typeparam>
|
|
/// <param name="htmlHelper">htmlHelper</param>
|
|
/// <param name="expression">字段表达式</param>
|
|
/// <param name="expressionName">字段显示表达式</param>
|
|
/// <param name="kind">数据类别</param>
|
|
/// <param name="callBackFunc">回调</param>
|
|
/// <param name="htmlAttributes">属性</param>
|
|
/// <returns>html代码</returns>
|
|
public static MvcHtmlString QMyPerceptTextboxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, Expression<Func<TModel, TProperty>> expressionName, string kind, string callBackFunc, params string[] ps)
|
|
{
|
|
return QMyPerceptTextboxFor(htmlHelper, expression, expressionName, kind, callBackFunc, null, ps);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 智能感知文本框
|
|
/// </summary>
|
|
/// <typeparam name="TModel">实体类型</typeparam>
|
|
/// <typeparam name="TProperty">属性</typeparam>
|
|
/// <param name="htmlHelper">htmlHelper</param>
|
|
/// <param name="expression">字段表达式</param>
|
|
/// <param name="expressionName">字段显示表达式</param>
|
|
/// <param name="kind">数据类别</param>
|
|
/// <param name="callBackFunc">回调</param>
|
|
/// <param name="htmlAttributes">属性</param>
|
|
/// <returns>html代码</returns>
|
|
public static MvcHtmlString QMyPerceptTextboxFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, Expression<Func<TModel, TProperty>> expressionName, string kind, string callBackFunc, object htmlAttributes, params string[] ps)
|
|
{
|
|
if (QPerceptTextbox.MyDataGeter == null)
|
|
QPerceptTextbox.MyDataGeter = new AppDataGeter();
|
|
|
|
return QPerceptTextbox.QPerceptTextboxFor(htmlHelper, expression, expressionName, kind, callBackFunc, htmlAttributes, ps);
|
|
}
|
|
|
|
#region
|
|
public static MvcHtmlString QMyPerceptTextboxForD<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, Expression<Func<TModel, TProperty>> expressionName, string kind, string callBackFunc, object htmlAttributes, string idName, string contentName, string text, params string[] ps)
|
|
{
|
|
if (QPerceptTextboxD.MyDataGeter == null)
|
|
QPerceptTextboxD.MyDataGeter = new AppDataGeter();
|
|
|
|
return QPerceptTextboxD.QPerceptTextboxForD(htmlHelper, expression, expressionName, kind, callBackFunc, new RouteValueDictionary(htmlAttributes), idName, contentName, text, ps);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|