/// <summary> /// 构造函数 /// </summary> /// <param name="field">表单字段</param> public ChooseBox(FormField field) { ControlType = ControlType.TextBox; Url = field.URL.Trim().ToLower().StartsWith("http") ? field.URL : string.Format("{0}{1}", GetRootPath(), field.URL); Url += (Url.IndexOf("?") > 0 ? "&" : "?") + "field=" + field.Name; Field = field; }
public string GetValidatorScript(FormField field) { string script = string.Empty; if (field.DataType == DataType.Integer) { return string.Format("$(\"#{0}\").formValidator().regexValidator({{ regexp: \"intege\", datatype: \"enum\", onerror: \"【{1}】必须是整数!\" }});", field.Name, field.Text); } else if (field.DataType == DataType.Float) { return string.Format("$(\"#{0}\").formValidator().regexValidator({{ regexp: \"decmal\", datatype: \"enum\", onerror: \"【{1}】必须是浮点数!\" }});", field.Name, field.Text); } return script; }
/// <summary> /// 构造函数 /// </summary> /// <param name="field">表单字段对象</param> public MultiCombox(FormField field) { ControlType = ControlType.MultiCombox; Field = field; }
/// <summary> /// 构造函数 /// </summary> /// <param name="field">表单字段对象</param> public SingleCombox(FormField field) { ControlType = ControlType.SingleCombox; Field = field; DictID = field.DataSource; }
/// <summary> /// 构造函数 /// </summary> /// <param name="field">表单字段</param> public TextBox(FormField field) { ControlType = ControlType.TextBox; Field = field; }
/// <summary> /// 构造函数 /// </summary> /// <param name="field">表单字段</param> public DatePicker(FormField field) { ControlType = ControlType.DatePicker; Field = field; }
/// <summary> /// 构造函数 /// </summary> /// <param name="field">表单字段</param> public CheckBox(FormField field) { ControlType = ControlType.CheckBox; Field = field; }