Exemplo n.º 1
0
 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<OEQuestionBank> lists = new List<OEQuestionBank>();
     OEQuestionBankBiz biz = new OEQuestionBankBiz();
     string _searchtext = _searchcontent;
     string wheresql = "";
     string _searchclassid = Parameters["psearchclassid"];
     OEContentClassBiz ccbiz = new OEContentClassBiz();
     string _idlist = "";
     ccbiz.GetChildrenIdList(_searchclassid, ref _idlist);
     wheresql = "( FContentClassId in (" + _idlist + ")) ";
     if (!string.IsNullOrEmpty(_searchtext))
     {
         //difine wheresql
         //for example:wheresql = " (FDepartmentName like '%" + _searchtext + "%') or (FDepartmentCode like '%" + _searchtext + "%')";
         wheresql += " and (FQBankName like '%" + _searchtext + "%')";
     }
     else
     {
         wheresql += " and (1=1)";
     }
     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);
     string datasource = Utils.GetRepeaterDatasource(lists, sPageIndex, sPageSize, totalcount);
     Response.Write(datasource);
 }
Exemplo n.º 2
0
 public void GetBankList()
 {
     string pcontentclassid = Parameters["pcontentclassid"];
     OEContentClassBiz ccbiz = new OEContentClassBiz();
     string ccidlist = "";
     ccbiz.GetChildrenIdList(pcontentclassid, ref ccidlist);
     List<OEQuestionBank> lists = new List<OEQuestionBank>();
     OEQuestionBankBiz biz = new OEQuestionBankBiz();
     NameValueCollection where = new NameValueCollection();
     where.Add("condition", "(FQBankStatus = '1') and (FContentClassId in (" + ccidlist + "))");
     lists = biz.Select(where);
     Response.Write(Utils.ConvertToJson(lists));
 }
Exemplo n.º 3
0
 public void GetQuestionBank()
 {
     string _classid = Parameters["pclassid"];
     OEContentClassBiz biz = new OEContentClassBiz();
     string _idlist = "";
     biz.GetChildrenIdList(_classid, ref _idlist);
     OEQuestionBankBiz QBBiz = new OEQuestionBankBiz();
     NameValueCollection where = new NameValueCollection();
     where.Add("condition", "FContentClassId in (" + _idlist + ")");
     NameValueCollection orderby = new NameValueCollection();
     orderby.Add("FQBankCode", "asc");
     List<OEQuestionBank> lists = new List<OEQuestionBank>();
     lists = QBBiz.Select(where, orderby);
     Response.Write(Utils.ConvertToJson(lists));
 }