/// <summary> /// 分页获取用户信息 /// </summary> /// <returns></returns> public QueryResult <User> GetUserInfoByPaging(GetObjectsByPagingArgs args) { ArgumentHelper.Require(args.SchoolId, "SchoolId", Arguments.Positive); ArgumentHelper.Require(args.PageSize, "PageSize", Arguments.Positive); ArgumentHelper.Require(args.PageIndex, "PageIndex", Arguments.Positive); return(ContainerFactory <IUserRepository> .Instance.GetUserInfoByPaging(args)); }
/// <summary> /// 通过姓名和电话尾号模糊查询 /// </summary> /// <param name="args"></param> /// <returns></returns> public QueryResult <Student> QueryStudent(GetObjectsByPagingArgs args) { ArgumentHelper.Require(args.SchoolId, "SchoolId", Arguments.Positive); ArgumentHelper.Require(args.PageSize, "PageSize", Arguments.Positive); ArgumentHelper.Require(args.PageIndex, "PageIndex", Arguments.Positive); return(ContainerFactory <IStudentRepository> .Instance.GetStudentListByPaging(args)); }
public ViewResult List(int pageIndex = 1) { var schoolId = ApplicationContext.SchoolId; var args = new GetObjectsByPagingArgs() { PageSize = 10, SchoolId = schoolId, PageIndex = pageIndex, WhereStr = "", OrderBy = " order by st.modify_time desc " }; var result = StudentService.Instance.GetStudentListByPaging(args); ViewData["PageCount"] = (args.RowsCount - 1) / args.PageSize + 1; ViewData["PageSize"] = args.PageSize; ViewData["PageIndex"] = args.PageIndex; return(View(result.Items)); }
public ViewResult Renew(int pageIndex = 1) { var schoolId = ApplicationContext.SchoolId; var args = new GetObjectsByPagingArgs() { PageSize = 10, SchoolId = schoolId, PageIndex = pageIndex, WhereStr = "", OrderBy = "" }; var result = EntryService.Instance.GetEntryListByPaging(args); ViewData["PageCount"] = args.RowsCount / args.PageSize + 1; ViewData["PageSize"] = args.PageSize; ViewData["PageIndex"] = args.PageIndex; return(View(result.Items)); }
public string QueryStudent(string stuName, string stdPhone, int pageIndex = 1) { string wherestr = " and st.name like '%" + stuName + "%'"; if (stdPhone.Trim() != "") { wherestr = wherestr + " and (right(st.tel1,4)='" + stdPhone + "' or right(st.tel1,4)='" + stdPhone + "' or right(st.tel1,4)='" + stdPhone + "')"; } var schoolId = ApplicationContext.SchoolId; var args = new GetObjectsByPagingArgs() { PageSize = 10, SchoolId = schoolId, PageIndex = pageIndex, WhereStr = wherestr, OrderBy = " order by st.modify_time desc " }; var result = StudentService.Instance.GetStudentListByPaging(args); return(JsonHelper.Serialize(result)); }
public QueryResult <Student> GetStudentListByPaging(GetObjectsByPagingArgs args) { try { DynamicParameters p = new DynamicParameters(); p.Add("@p_school_id", args.SchoolId); p.Add("@p_page_size", args.PageSize); p.Add("@p_page_now", args.PageIndex); p.Add("@p_order_string", args.OrderBy); p.Add("@p_where_string", args.WhereStr); p.Add("@p_out_rows", null, DbType.Int32, ParameterDirection.Output); var result = ContainerFactory <ISqlExcuteContext> .Instance.ExcuteQueryProcedure <Student>(args.SchoolId, "get_students_by_paging", p); args.RowsCount = p.Get <int>("@p_out_rows"); return(result); } catch (Exception e) { LogHelper.Error(this.GetType(), "学生模块--通过分页获取学生列表失败", e); return(QueryResult.Failure <Student>(e.ToString())); } }