//下拉 public static List <FormControlConfig> Add(this List <FormControlConfig> controls, string lable, List <DropDownListItem> items, string value = "", string id = "", string regex = "", string inputTip = "", string errorTip = "") { var cfg = new FormControlConfig(lable, id, value, items, -1, regex, inputTip, errorTip); return(Add(controls, cfg)); }
//按钮 public static List <FormControlConfig> Add(this List <FormControlConfig> controls, string lable, FormControlType type, string value = "", string id = "", string regex = "", string inputTip = "", string errorTip = "") { var cfg = new FormControlConfig(lable, id, value, type, -1, regex, inputTip, errorTip); return(Add(controls, cfg)); }
//base public static List <FormControlConfig> Add(this List <FormControlConfig> controls, FormControlConfig newControl) { newControl.id = newControl.id.HasValue() ? newControl.id : DateTime.Now.Random(); newControl.sequence = controls.Count + 1; controls.Add(newControl); return(controls); }