public void GetDeptMember() { string _deptid = Parameters["pdeptid"]; string _content = Parameters["psearchtext"]; List<PmPartymember> lists = new List<PmPartymember>(); PmPartymemberBiz biz = new PmPartymemberBiz(); NameValueCollection where = new NameValueCollection(); where.Add("FActivistFlag", "1"); where.Add("FObjectFlag", "0"); where.Add("FPrePartyFlag", "0"); where.Add("FPartyFlag", "0"); where.Add("FHistoryFlag", "0"); where.Add("FDepartmentId", _deptid); if (!string.IsNullOrEmpty(_content)) { where.Add("FMemberName like", "%" + _content + "%"); } NameValueCollection orderby = new NameValueCollection(); orderby.Add("FMemberCode", "ASC"); lists = biz.Select(where, orderby); Response.Write(Utils.ConvertToJson(lists)); }
public void GetGridData() { string _searchcontent = ""; string _sortname = ""; string _sortdirection = ""; string _pagenumber = ""; string _pagesize = ""; _searchcontent = Parameters["psearchcontent"]; _sortname = Parameters["psortname"]; if (!string.IsNullOrEmpty(_sortname)) { sSortName = _sortname; } _sortdirection = Parameters["psortdirection"]; if (!string.IsNullOrEmpty(_sortdirection)) { sSortDirection = _sortdirection; } _pagenumber = Parameters["ppagenumber"]; if (!string.IsNullOrEmpty(_pagenumber)) { sPageIndex = Convert.ToInt32(_pagenumber); } _pagesize = Parameters["ppagesize"]; if (!string.IsNullOrEmpty(_pagesize)) { sPageSize = Convert.ToInt32(_pagesize); } List<PmPartymember> lists = new List<PmPartymember>(); PmPartymemberBiz biz = new PmPartymemberBiz(); string _searchtext = _searchcontent; string wheresql = "(FActivistFlag = '1') and (FObjectFlag = '1') and (FPrePartyFlag = '0') and (FPartyFlag = '0') and (FHistoryFlag = '0') "; string _deptid = Parameters["pdeptid"]; if (string.IsNullOrEmpty(_deptid) || _deptid == "0") { if (userid != "1") { SysUserDeptsBiz udbiz = new SysUserDeptsBiz(); string deptidlist = udbiz.GetUserDeptList(userid); if (string.IsNullOrEmpty(deptidlist)) { wheresql += " and (FDepartmentId in (0))"; } else { wheresql += " and (FDepartmentId in (" + deptidlist + "))"; } } } else { wheresql += "(FDepartmentId = " + _deptid + ")"; } if (!string.IsNullOrEmpty(_searchtext)) { //difine wheresql wheresql += " and (FMemberName like '%" + _searchtext + "%')"; //for example:wheresql = " (FDepartmentName like '%" + _searchtext + "%') or (FDepartmentCode like '%" + _searchtext + "%')"; } NameValueCollection where = new NameValueCollection(); where.Add("condition", wheresql); NameValueCollection orderby = new NameValueCollection(); orderby.Add(_sortname, _sortdirection); Int32 totalcount = 0; lists = biz.Select(where, orderby, Convert.ToInt32(sPageIndex), Convert.ToInt32(sPageSize), out totalcount); for (int i = 0; i < lists.Count; i++) { lists[i].FOperation = "<a iconCls='icon-remove' class='btn' href='javascript:void(0)' onclick='delobject(" + lists[i].FMemberId.ToString() + ")'>取消资格</a>"; } string datasource = Utils.GetRepeaterDatasource(lists, sPageIndex, sPageSize, totalcount); Response.Write(datasource); }