/// <summary> /// 搜索公司 /// </summary> /// <param name="companyName"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public ReturnListModel SearchCompanyList(string companyName = "", int pageIndex = 1, int pageSize = 20) { var returnListModel = new ReturnListModel(); try { var total = 0; var list = companyDb.SearchCompanyList(out total, companyName, pageIndex, pageSize); returnListModel.info = ""; returnListModel.list = list; returnListModel.result = 0; returnListModel.total = total; return(returnListModel); } catch (Exception e) { returnListModel.info = "查询失败!"; returnListModel.list = new List <CompanyListShow>(); returnListModel.result = 1; returnListModel.total = 0; return(returnListModel); } }
/// <summary> /// 1 /// </summary> /// <returns></returns> public JsonResult LoadPageList1() { var sReturnModel = new ReturnListModel(); #region 登录验证 var currentUser = Utits.CurrentUser; if (currentUser == null) { sReturnModel.ErrorType = 3; sReturnModel.MessageContent = "登录状态已失效."; return(Json(sReturnModel)); } #endregion #region 参数处理 #region 分页参数 int page = RequestParameters.Pint("page"); int size = RequestParameters.Pint("size"); if (page < 1 || size < 1) { sReturnModel.ErrorType = 0; sReturnModel.MessageContent = "参数错误."; return(Json(sReturnModel)); } #endregion var condition = new ConditionModel(); #region 查询参数 var whereList = new List <WhereCondition>(); //部门名称 string Search = RequestParameters.Pstring("SearchDept"); if (Search.Length > 0) { var where1Condition = new WhereCondition(); where1Condition.FieldName = "Dept_Name"; where1Condition.FieldOperator = EnumOper.Contains; where1Condition.FieldValue = Search; whereList.Add(where1Condition); } condition.WhereList = whereList; #endregion #region 排序参数 var orderList = new List <OrderCondition>(); var orderCondition = new OrderCondition(); orderCondition.Ascending = true; orderCondition.FiledOrder = "OperatTime"; orderList.Add(orderCondition); condition.OrderList = orderList; #endregion #endregion int iTotalRecord = 0, iPageIndex = page - 1, iPageSize = size; var cBll = new BLL_Security(); var list = cBll.GetPageListByCondition1(iPageIndex, iPageSize, ref iTotalRecord, condition); iPageSize = iPageSize == 0 ? iTotalRecord : iPageSize; int pageCount = iTotalRecord % iPageSize == 0 ? iTotalRecord / iPageSize : iTotalRecord / iPageSize + 1; sReturnModel.ErrorType = 1; sReturnModel.CurrentPage = page; sReturnModel.PageSize = iPageSize; sReturnModel.TotalRecord = iTotalRecord; sReturnModel.PageCount = pageCount; if (list != null) { sReturnModel.Data = from a in list select new { a.ID, a.Dept_Name, a.bswz, a.dyxt, a.sfjrzwww, a.sbglryxm, a.lxfs } } ; return(Json(sReturnModel)); }
/// <summary> /// 物理服务器 /// </summary> /// <returns></returns> public ActionResult LoadPageList1() { var sReturnModel = new ReturnListModel(); #region 登录验证 var currentUser = Utits.CurrentUser; if (currentUser == null) { sReturnModel.ErrorType = 3; sReturnModel.MessageContent = "登录状态已失效."; return(Json(sReturnModel)); } #endregion #region 参数处理 #region 分页参数 int page = RequestParameters.Pint("page"); int size = RequestParameters.Pint("size"); if (page < 1 || size < 1) { sReturnModel.ErrorType = 0; sReturnModel.MessageContent = "参数错误."; return(Json(sReturnModel)); } #endregion var condition = new ConditionModel(); #region 查询参数 //var whereList = new List<WhereCondition>(); ////部门名称 //string Search = RequestParameters.Pstring("SearchDept"); //if (Search.Length > 0) //{ // var where1Condition = new WhereCondition(); // where1Condition.FieldName = "Dept_Name"; // where1Condition.FieldOperator = EnumOper.Contains; // where1Condition.FieldValue = Search; // whereList.Add(where1Condition); //} //condition.WhereList = whereList; #endregion #region 排序参数 var orderList = new List <OrderCondition>(); var orderCondition = new OrderCondition(); orderCondition.Ascending = true; orderCondition.FiledOrder = "OperatTime"; orderList.Add(orderCondition); condition.OrderList = orderList; #endregion #endregion int iTotalRecord = 0, iPageIndex = page - 1, iPageSize = size; var cBll = new BLL_Service(); var list = cBll.GetPageList1ByCondition(iPageIndex, iPageSize, ref iTotalRecord, condition); iPageSize = iPageSize == 0 ? iTotalRecord : iPageSize; int pageCount = iTotalRecord % iPageSize == 0 ? iTotalRecord / iPageSize : iTotalRecord / iPageSize + 1; sReturnModel.ErrorType = 1; sReturnModel.CurrentPage = page; sReturnModel.PageSize = iPageSize; sReturnModel.TotalRecord = iTotalRecord; sReturnModel.PageCount = pageCount; if (list != null) { sReturnModel.Data = from a in list select new { a.ID, a.fwqbh, a.xh, gmrq = a.gmrq.ToString("yyyy/MM/dd"), gbrq = a.gbrq.ToString("yyyy/MM/dd"), a.cpbb, a.xlh, a.wlwz, a.jgwz, a.zycd, } } ; return(Json(sReturnModel)); }