DocSas/PropertyService.Domain/ModelView/CommentCards/CommentCardProvider.cs
/// <summary>
/// get comment cards as an asynchronous operation.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <param name="propertyId">The property identifier.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
get comment cards as an asynchronous operation.
get comment cards as an asynchronous operation .
public async Task<DSCResponse> GetCommentCardsAsync(Guid userId, Guid propertyId)
        {
            var msg = new Dictionary<string, string>();
            var response = new DSCResponse();
            IEnumerable<CommentCardVM> comms = null;
            var user = await _appCommon.GetUserAsync(userId);
            if(user != null)
            {
                if (user.UserTypeEnum == PSUserType.ManagementCompany.ToString())
                {
                    comms = await _commentCardRepo.GetQueryAsync<CommentCardVM>("GetCommentCards", new Dictionary<string, object>() {
                        {"recordCount", DataUtil.DefaultNumberOfRows },
                        {"propertyId",propertyId }
                    });
                }
                else if(user.UserTypeEnum == PSUserType.ManagementPersonnel.ToString())
                {
                    comms = await _commentCardRepo.GetQueryAsync<CommentCardVM>("GetCommentCards", new Dictionary<string, object>() {
                        {"recordCount", DataUtil.DefaultNumberOfRows },
                        {"propertyId",propertyId }
                    });
                }
                else
                {
                    comms = await _commentCardRepo.GetQueryAsync<CommentCardVM>("GetCommentCards", new Dictionary<string, object>() {
                        {"recordCount", DataUtil.DefaultNumberOfRows },
                        {"propertyId",propertyId },
                        {"userId",userId }
                    });
                }
            }
            response.ResponseData = comms;
            return response;
        }
public async Task < DSCResponse > GetCommentCardsAsync ( Guid userId , Guid propertyId ) { var msg = new Dictionary < string , string > ( ) ; var response = new DSCResponse ( ) ; IEnumerable < CommentCardVM > comms = null ; var user = await _appCommon . GetUserAsync ( userId ) ; if ( user != null ) { if ( user . UserTypeEnum == PSUserType . ManagementCompany . ToString ( ) ) { comms = await _commentCardRepo . GetQueryAsync < CommentCardVM > ( " " , new Dictionary < string , object > ( ) { { " " , DataUtil . DefaultNumberOfRows } , { " " , propertyId } } ) ; } else if ( user . UserTypeEnum == PSUserType . ManagementPersonnel . ToString ( ) ) { comms = await _commentCardRepo . GetQueryAsync < CommentCardVM > ( " " , new Dictionary < string , object > ( ) { { " " , DataUtil . DefaultNumberOfRows } , { " " , propertyId } } ) ; } else { comms = await _commentCardRepo . GetQueryAsync < CommentCardVM > ( " " , new Dictionary < string , object > ( ) { { " " , DataUtil . DefaultNumberOfRows } , { " " , propertyId } , { " " , userId } } ) ; } } response . ResponseData = comms ; return response ; }
get comment cards as an asynchronous operation.
get comment cards as an asynchronous operation .
None
userId
Guid
The user identifier.
The user identifier .
propertyId
Guid
The property identifier.
The property identifier .