protected void Bt_Search_Click(object sender, EventArgs e)
        {
            string sysCodeID = RCB_SysCodeList.SelectedItem.Value.Trim();
            BLL.SysCodeDetail scd = new BLL.SysCodeDetail();
            List<Model.SysCodeDetail> SyscodeDetialList = new List<Model.SysCodeDetail>();
            string keywords = TB_SubCode.Text.ToLower().Trim();
            SyscodeDetialList = scd.GetModelList(0,sysCodeID,-1,-1,false);
            if (keywords != "")
            {
                SyscodeDetialList.RemoveAll(st => !st.SYSCodeDetialID.ToLower().Contains(keywords));
            }

            if (SyscodeDetialList == null || SyscodeDetialList.Count==0)
                return;

            /*筛选尚未关联的记录*/
            List<Model.SysCodeDetail> newSyscodeDetialTypeList = new List<Model.SysCodeDetail>();
            List<Model.SysCodeRelation> scrModelList = scr.GetModelList(1,subSysCodeId,-1,-1,false);
            foreach (Model.SysCodeDetail scdmodel in SyscodeDetialList)
            {
                if (scrModelList.Exists(st => (st.SysCodeDetialIDEx.Equals(scdmodel.SYSCodeDetialID) ||
                                                    st.SysCodeDetialIDEx.Equals(scdmodel.SYSCodeDetialID))))
                {
                    continue;
                }
                newSyscodeDetialTypeList.Add(scdmodel);
            }
            ViewState["SyscodeDetialTypeList"] = newSyscodeDetialTypeList;
            RGrid_SubSysCode.DataSource = newSyscodeDetialTypeList;
            RGrid_SubSysCode.DataBind();
            RGrid_SubSysCode.Visible = true;
            RadScriptManager.RegisterStartupScript(this.Page, this.GetType(), "c1", "changeWindowSize();", true);
        }
Пример #2
0
 protected void Bt_Search_Click(object sender, EventArgs e)
 {
     int searchType = int.Parse(RCB_SearchType.SelectedItem.Value);
     string keyWords = TB_KeyWords.Text.Trim();
     BLL.SysCodeDetail scd = new BLL.SysCodeDetail();
     List<Model.SysCodeDetail> scdModelList = scd.GetModelList(0, sysCodeId, -1, -1, false);
     if (keyWords != "")
     {
         if (searchType == 1)
         {
             scdModelList.RemoveAll(st => !st.SYSCodeDetialID.Contains(keyWords));
         }
         else{
             scdModelList.RemoveAll(st => !st.SYSCodeDetialContext.Contains(keyWords));
         }
     }
     RGrid_SubSysCode.DataSource = scdModelList;
     ViewState["SubSysCodeList"] = scdModelList;
     RGrid_SubSysCode.DataBind();
     RGrid_SubSysCode.Visible = true;
     RadScriptManager.RegisterStartupScript(Page, GetType(), "c0", "changeWindowSize();", true);
 }