/// <summary> /// 获取监测任务列表信息 /// </summary> /// <returns></returns> protected string getTaskInfoForJson() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; int intPageIdx = Convert.ToInt32(Request.Params["page"]); int intPagesize = Convert.ToInt32(Request.Params["pagesize"]); //构造查询对象 TMisMonitorTaskVo objTask = new TMisMonitorTaskVo(); TMisMonitorTaskLogic objTaskLogic = new TMisMonitorTaskLogic(); if (strSortname == null || strSortname.Length == 0) { strSortname = TMisMonitorTaskVo.ID_FIELD; } objTask.SORT_FIELD = strSortname; objTask.SORT_TYPE = strSortorder; objTask.CONTRACT_ID = !string.IsNullOrEmpty(Request.QueryString["contract_id"]) ? Request.QueryString["contract_id"].ToString() : ""; int intTotalCount = objTaskLogic.GetSelectResultCount(objTask);//总计的数据条数 DataTable dt = objTaskLogic.SelectByTable(objTask, intPageIdx, intPagesize); return(CreateToJson(dt, intTotalCount)); }
/// <summary> /// 获取监测任务列表信息 /// </summary> /// <returns></returns> protected void selectTask() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; int intPageIdx = Convert.ToInt32(Request.Params["page"]); int intPagesize = Convert.ToInt32(Request.Params["pagesize"]); //委托年度 string strYear = !string.IsNullOrEmpty(Request.QueryString["SrhYear"]) ? Request.QueryString["SrhYear"].ToString() : ""; //委托类型 string strContractType = !string.IsNullOrEmpty(Request.QueryString["SrhContractType"]) ? Request.QueryString["SrhContractType"].ToString() : ""; //任务单号 string strTICKET_NUM = !string.IsNullOrEmpty(Request.QueryString["SrhTICKET_NUM"]) ? Request.QueryString["SrhTICKET_NUM"].ToString() : ""; //项目名称 string strProjectName = !string.IsNullOrEmpty(Request.QueryString["SrhProjectName"]) ? Request.QueryString["SrhProjectName"].ToString() : ""; //构造查询对象 TMisMonitorTaskVo objTask = new TMisMonitorTaskVo(); TMisMonitorTaskLogic objTaskLogic = new TMisMonitorTaskLogic(); if (strSortname == null || strSortname.Length == 0) { strSortname = TMisMonitorTaskVo.ID_FIELD; } objTask.SORT_FIELD = "CREATE_DATE"; objTask.SORT_TYPE = "desc"; //objTask.SORT_FIELD = strSortname; //objTask.SORT_TYPE = strSortorder; objTask.CONTRACT_YEAR = strYear; objTask.CONTRACT_TYPE = strContractType; objTask.TICKET_NUM = strTICKET_NUM; objTask.PROJECT_NAME = strProjectName; string strJson = ""; int intTotalCount = objTaskLogic.GetSelectResultCount(objTask);//总计的数据条数 DataTable dt = objTaskLogic.SelectByTable(objTask, intPageIdx, intPagesize); strJson = CreateToJson(dt, intTotalCount); Response.Write(strJson); Response.End(); }