コード例 #1
0
ファイル: UserDataGateway.cs プロジェクト: ynperera/ICAP2
        public ReaderResponseData SearchUsers(SearchBase searchMeta)
        {
            ReaderResponseData response = new ReaderResponseData(); //= new Dyna;

            try
            {
                UserReader reader = new UserReader();
                reader.SearchObj = searchMeta;
                Collection <User> userCollection = reader.Execute();
                response.PageIndex     = searchMeta.PageIndex;
                response.PageSize      = searchMeta.PageSize;
                response.SearchKey     = searchMeta.SearchKey;
                response.SortDirection = searchMeta.SortDirection;
                response.SortKey       = searchMeta.SortKey;
                response.StatusCode    = RequestStatus.Success;

                if (userCollection.Count > 0)
                {
                    response.Data          = userCollection;
                    response.StatusMessage = "Success";
                }
                else
                {
                    response.StatusMessage = "No Records Found";
                }
            }
            catch (Exception ex)
            {
                response.StatusCode    = RequestStatus.Failure;
                response.StatusMessage = "Failed";
            }
            return(response);
        }
コード例 #2
0
ファイル: UserDataGateway.cs プロジェクト: ynperera/ICAP2
        public UserList SearchUser(string userId)
        {
            UserList response = new UserList();

            try
            {
                UserReader        reader         = new UserReader();
                Collection <User> userCollection = reader.Execute();
                if (userCollection.Count > 0)
                {
                    response.Users         = userCollection;
                    response.StatusCode    = RequestStatus.Success;
                    response.StatusMessage = "Success";
                }
                else
                {
                    response.StatusCode    = RequestStatus.Success;
                    response.StatusMessage = "No Records Found";
                }
            }
            catch (Exception ex)
            {
            }
            return(response);
        }