示例#1
0
 /// <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;
 }
示例#2
0
        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;
        }
示例#3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="field">表单字段对象</param>
 public MultiCombox(FormField field)
 {
     ControlType = ControlType.MultiCombox;
     Field = field;
 }
示例#4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="field">表单字段对象</param>
 public SingleCombox(FormField field)
 {
     ControlType = ControlType.SingleCombox;
     Field = field;
     DictID = field.DataSource;
 }
示例#5
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="field">表单字段</param>
 public TextBox(FormField field)
 {
     ControlType = ControlType.TextBox;
     Field = field;
 }
示例#6
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="field">表单字段</param>
        public DatePicker(FormField field)
        {
            ControlType = ControlType.DatePicker;

            Field = field;
        }
示例#7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="field">表单字段</param>
 public CheckBox(FormField field)
 {
     ControlType = ControlType.CheckBox;
     Field = field;
 }