//------------------------------------------------------------------------------ public virtual void GetOrgList() { ResponseOrgList wrapper = new ResponseOrgList(); wrapper.message = "Success"; wrapper.code = 0; wrapper.action = "org/get"; List<Org> objs = api.GetOrgList( ); // get data wrapper.data = objs; util.SerializeTypeToResponse(_format, _context, wrapper); }
//------------------------------------------------------------------------------ public virtual void GetOrgListByUuid() { string _uuid = (string)util.GetParamValue(_context, "uuid"); ResponseOrgList wrapper = new ResponseOrgList(); wrapper.message = "Success"; wrapper.code = 0; wrapper.action = "org/get/by-uuid"; List<Org> objs = api.GetOrgListByUuid( _uuid ); // get data wrapper.data = objs; util.SerializeTypeToResponse(_format, _context, wrapper); }
//------------------------------------------------------------------------------ public virtual void BrowseOrgListByFilter() { ResponseOrgList wrapper = new ResponseOrgList(); wrapper.message = "Success"; wrapper.code = 0; wrapper.action = "org/browse/by-filter"; SearchFilter obj = new SearchFilter(); obj.page = Convert.ToInt32(util.GetParamValue(_context, "page")); obj.page_size = Convert.ToInt32(util.GetParamValue(_context, "page-size")); obj.filter = util.GetParamValue(_context, "filter"); OrgResult result = api.BrowseOrgListByFilter(obj); wrapper.info.Add("total_rows", result.total_rows); wrapper.info.Add("total_pages", result.total_pages); wrapper.info.Add("page", result.page); wrapper.info.Add("page_size", result.page_size); // get data wrapper.data = result.data; util.SerializeTypeToResponse(_format, _context, wrapper); }