/// <summary> /// 租用仪器共享订单列表信息 /// </summary> /// <param name="instshare"></param> /// <returns></returns> public ActionResult RentInstrumentShareListData(InstrumentShare instshare) { string responseText = ""; responseText = orderbll.rentInstrumentShareListData(instshare); return(Content(responseText)); }
/// <summary> /// 租用仪器共享订单列表信息 /// </summary> /// <param name="instshare"></param> /// <returns></returns> public string rentInstrumentShareListData(InstrumentShare instshare) { string responseText = ""; responseText = orderdal.rentInstrumentShareListData(instshare); return(responseText); }
/// <summary> /// 租用仪器共享订单列表信息 /// </summary> /// <returns></returns> public string rentInstrumentShareListData(InstrumentShare instshare) { string responseText = ""; string Select_Sql = ""; //条件语句 int count = 0; //条件查询到的记录数 int start = 0; //起始查询条数 int last = 0; //最终查询条数 int pagecount = 0; //总页数 int pagesize = 0; int nowpage = 0; if (instshare.Pagesize == "" || instshare.Pagesize == null) { pagesize = 10; } else { pagesize = Convert.ToInt32(instshare.Pagesize); } if (instshare.Nowpage == "" || instshare.Nowpage == null) { nowpage = 1; } else { nowpage = Convert.ToInt32(instshare.Nowpage); } if (instshare.Order_num != "" && instshare.Order_num != null) { Select_Sql += string.Format(" and (ORDER_SN = '{0}')", instshare.Order_num); } if (instshare.User_phone != "" && instshare.User_phone != null) { Select_Sql += string.Format(" and (USER_TEL = '{0}')", instshare.User_phone); } if (instshare.Order_regtime_start != "" && instshare.Order_regtime_start != null) { Select_Sql += string.Format(" and to_char(to_date(ADD_TIME,'yyyy-MM-dd HH24:mi:ss'),'yyyy-MM-dd') >='{0}'", instshare.Order_regtime_start); } if (instshare.Order_regtime_end != "" && instshare.Order_regtime_end != null) { Select_Sql += string.Format(" and to_char(to_date(ADD_TIME,'yyyy-MM-dd HH24:mi:ss'),'yyyy-MM-dd') <='{0}'", instshare.Order_regtime_end); } //if (order.Order_status != "00" && order.Order_status != "" && order.Order_status != null) //{ // Select_Sql += string.Format(" and (IS_RECEIVED = '{0}')", order.Order_status); //} string sql0 = "select count(*) from GXIS_BORROW_VIEW where 1=1 and DEL_FLAG='0' " + Select_Sql; DataTable dt0 = OracleHelper.GetTable(sql0, null); count = Convert.ToInt32(dt0.Rows[0][0]); //得到了全部的记录数 if (count % pagesize == 0) //计算得到全部页数 { pagecount = count / pagesize; } else { pagecount = count / pagesize + 1; } if (count == 0) { start = 0; } else { start = (nowpage - 1) * pagesize + 1; //计算该显示记录的行数范围; } if (start <= count) { if (count - start >= pagesize) //start起始 last结束 { last = start + pagesize - 1; } else { last = count; } } string sql = string.Format("select * from(select a.*,rownum row_num from (select * from GXIS_BORROW_VIEW where 1=1 and DEL_FLAG='0' {0} order by REC_ID asc) a) b where b.row_num between {1} and {2}", Select_Sql, start, last); DataTable dt = OracleHelper.GetTable(sql, null); responseText = JsonHelper.getRecordJson(dt); responseText = "{\"msg\":\"success\",\"count\":" + count.ToString() + ",\"servers\":[" + responseText + "]}"; return(responseText); }