/// <summary> /// 获取WEC_REQUEST对象 /// 找不到或找到但是状态为禁止,都返回null /// //ygh 2014/3/7 /// </summary> /// <param name="text"></param> /// <returns></returns> public WEC_REQUEST getWECREQUEST(string content_str) { WEC_REQUEST cond = new WEC_REQUEST(); cond.KEYWORD = content_str; cond.OrderBy("TID desc"); WEC_REQUEST objVal = BLLTable <WEC_REQUEST> .GetRowData(cond); if (objVal == null || objVal.STATUS == 1) { WEC_REQUEST cond1 = new WEC_REQUEST(); cond1.MATCH_TYPE = 1;//1为包含匹配 cond1.af_WhereSQL = "AND CHARINDEX(KEYWORD,'" + content_str + "') >0"; cond1.OrderBy("TID desc"); WEC_REQUEST objVal1 = BLLTable <WEC_REQUEST> .GetRowData(cond1); if (objVal1 == null || objVal1.STATUS == 1) { return(null); } return(objVal1); } //List<WEC_REQUEST> lst = BLLTable<WEC_REQUEST>.Select(new WEC_REQUEST(), cond); //cond1.Like(WEC_REQUEST.Attribute.KEYWORD, content_str); return(objVal); }
protected void Page_Load(object sender, EventArgs e) { #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(WEC_REQUEST.Attribute.EXP1); //hideTableColumnList.Add(WEC_REQUEST.Attribute.EXP2); //hideTableColumnList.Add(WEC_REQUEST.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(WEC_REQUEST.Attribute.EXP1); //hideFindColumnList.Add(WEC_REQUEST.Attribute.EXP2); //hideFindColumnList.Add(WEC_REQUEST.Attribute.EXP3); #endregion condObj.OrderBy(WEC_REQUEST.Attribute.TID, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "查询"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { WEC_REQUEST roleOld = new WEC_REQUEST(); roleOld.Where(WEC_REQUEST.Attribute.TID, Request["ids"].ToString()); listObj = BLLTable <WEC_REQUEST> .Select(valObj, roleOld); for (int i = 0; i < listObj.Count; i++) { if (i > 0) { hidOld.Value += ","; hidInitIDS.Value += ","; } hidOld.Value += "{ID:'" + listObj[i].TID + "',Name:'" + listObj[i].TID + "'}";//这里的Name用于显示在列表中,请自行重定义。 hidInitIDS.Value += listObj[i].TID; } } try { listObj = BLLTable <WEC_REQUEST> .SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; } catch (Exception ex) { litWarn.Text = ex.Message; } } }