/// <summary> /// 返回控件值 /// </summary> /// <returns></returns> public override object GetValue() { string field1 = Control.Params["field1"]; string field2 = Control.Params["field2"]; string field3 = Control.Params["field3"]; TypeCode field1Type = PanelContext.DataSet.Tables[0].Columns[field1].DataType; TypeCode field2Type = PanelContext.DataSet.Tables[0].Columns[field2].DataType; TypeCode field3Type = PanelContext.DataSet.Tables[0].Columns[field3].DataType; Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add(field1, TypeConverter.StrToObjectByTypeCode(We7Helper.FilterHtmlChars(Request.Form[Field1DropDownList.UniqueID]), field1Type)); if (Request.Form[Field2DropDownList.UniqueID] == null) { dic.Add(field2, ""); } else { dic.Add(field2, TypeConverter.StrToObjectByTypeCode(We7Helper.FilterHtmlChars(Request.Form[Field2DropDownList.UniqueID]), field2Type));//this.Field2DropDownList.SelectedValue } if (Request.Form[Field3DropDownList.UniqueID] == null) { dic.Add(field3, ""); } else { dic.Add(field3, TypeConverter.StrToObjectByTypeCode(We7Helper.FilterHtmlChars(Request.Form[Field3DropDownList.UniqueID]), field3Type));//this.Field2DropDownList.SelectedValue } return(dic); }
void CheckUserName() { string userName = We7Helper.FilterHtmlChars(HttpContext.Current.Request["userName"]); HttpContext.Current.Response.Clear(); int length = GetStrLen(userName); if (userName == "") { HttpContext.Current.Response.Write("false|用户名不能为空"); } else if (length < 5 || length > 20) { HttpContext.Current.Response.Write("false|用户名必须是5-20位"); } else if (!Regex.IsMatch(userName, @"^[\u4E00-\u9FA5a-zA-Z0-9]+$")) { HttpContext.Current.Response.Write("false|用户名必须是必须是字母、数字或组合"); } else if (AccountHelper.ExistUserName(userName)) { HttpContext.Current.Response.Write("false|该会员名已被使用"); } else { HttpContext.Current.Response.Write("true|"); } HttpContext.Current.Response.End(); }
public override object GetValue() { if (CheckParentIsFiledControl(this.Parent) && hfValue.Value == ArticleID) { return(We7Helper.CreateNewID()); } else { return(We7Helper.FilterHtmlChars(hfValue.Value)); } }
public override object GetValue() { if (Column.DataType == TypeCode.String || Column.DataType == TypeCode.Char) { return(hfValue.Value); } else { return(TypeConverter.StrToObjectByTypeCode(We7Helper.FilterHtmlChars(hfValue.Value), Column.DataType)); } }
public override object GetValue() { string htmlFormat = Control.Params["htmlFormat"]; if (Column.DataType == TypeCode.String || Column.DataType == TypeCode.Char) { txtInput.Text = HttpUtility.HtmlEncode(txtInput.Text); return(EnCode(txtInput.Text)); } else { return(TypeConverter.StrToObjectByTypeCode(We7Helper.FilterHtmlChars(txtInput.Text), Column.DataType)); } }
/// <summary> /// 联动控件加载三级菜单数据 /// </summary> /// <param name="field2TextMapping">二级菜单文本字段</param> /// <param name="field2ValueMapping">二级菜单值字段</param> /// <param name="table">查询表名</param> /// <param name="field1ValueMapping">一级菜单值字段</param> /// <param name="field1">一级菜单当前选中的值</param> private void GetThreeCascadeField3() { string field3TextMapping = We7Helper.FilterHtmlChars(Server.UrlDecode(Request["field3TextMapping"])); string field3ValueMapping = We7Helper.FilterHtmlChars(Server.UrlDecode(Request["field3ValueMapping"])); string field2ValueMapping = We7Helper.FilterHtmlChars(Server.UrlDecode(Request["field2ValueMapping"])); string field1ValueMapping = We7Helper.FilterHtmlChars(Server.UrlDecode(Request["field1ValueMapping"])); string table = We7Helper.FilterHtmlChars(Server.UrlDecode(Request["table"])); string field1Value = We7Helper.FilterHtmlChars(Server.UrlDecode(Request["field1Value"])); string field2Value = We7Helper.FilterHtmlChars(Server.UrlDecode(Request["field2Value"])); //加载数据 string sqlField3 = @" SELECT DISTINCT [" + field3TextMapping + "],[" + field3ValueMapping + "] FROM [" + table + "] WHERE [" + field2ValueMapping + "]='" + field2Value + "' and [" + field1ValueMapping + "]='" + field1Value + "' ";//WHERE [ID]={0} IDatabase db = Assistant.GetDatabases()["We7.CMS.Common"]; SqlStatement sqlstatement = new SqlStatement(); sqlstatement.SqlClause = sqlField3; db.DbDriver.FormatSQL(sqlstatement); DataTable dt = new DataTable(); using (IConnection conn = db.CreateConnection()) { dt = conn.Query(sqlstatement); } //将数据拼接到一个字符串 StringBuilder sb = new StringBuilder(); foreach (DataRow row in dt.Rows) { sb.Append(row["" + field3TextMapping + ""] + "&" + row["" + field3ValueMapping + ""] + ","); } if (sb.Length > 1) { if (sb.ToString().Substring(sb.Length - 1, 1) == ",") { sb.Remove(sb.ToString().Length - 1, 1); } } Response.Clear(); Response.Write(sb.ToString()); Response.End(); }
void CheckEmail() { string email = We7Helper.FilterHtmlChars(HttpContext.Current.Request["email"]); HttpContext.Current.Response.Clear(); if (email == "") { HttpContext.Current.Response.Write("false|Email不能为空"); } else if (!Regex.IsMatch(email, @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")) { HttpContext.Current.Response.Write("false|Email格式不正确"); } else if (AccountHelper.ExistEmail(email)) { HttpContext.Current.Response.Write("false|该电子邮箱名已被使用"); } else { HttpContext.Current.Response.Write("true|"); } HttpContext.Current.Response.End(); }
public override object GetValue() { return(We7Helper.FilterHtmlChars(txtPath.Text)); }
public override object GetValue() { return(TypeConverter.StrToObjectByTypeCode(We7Helper.FilterHtmlChars(TxtInput.Text.Trim()), Column.DataType)); }