public Task<StatusData<string>> UpdateUserAvailability(StatusSetRequest request, SystemSession session)
 {
     return _jUnitOfWork.Profile.UpdateUserAvailability(request, session);
 }
        public async Task<StatusData<string>> UpdateUserAvailability(StatusSetRequest request, SystemSession session)
        {
            var serviceRequest = new Status
            {
                UserId = session.UserId.ToString(),
                StatusTypeId = ((byte)request.StatusTypeId).ToString()
            };
            if (request.StatusTypeId == SystemUserAvailabilityCode.OutOfOffice)
            {
                serviceRequest.BeginDate = request.OutOfOfficeRequest.BeginDateAndTime.Date.HasValue ? request.OutOfOfficeRequest.BeginDateAndTime.Date.ToString() : null;
                serviceRequest.BeginTime = request.OutOfOfficeRequest.BeginDateAndTime.Time.HasValue ? request.OutOfOfficeRequest.BeginDateAndTime.Time.ToString() : null;
                serviceRequest.EndDate = request.OutOfOfficeRequest.EndDateAndTime.Date.HasValue ? request.OutOfOfficeRequest.EndDateAndTime.Date.ToString() : null;
                serviceRequest.EndTime = request.OutOfOfficeRequest.EndDateAndTime.Time.HasValue ? request.OutOfOfficeRequest.EndDateAndTime.Time.ToString() : null;
                serviceRequest.Location = request.OutOfOfficeRequest.Location;
                serviceRequest.FriendId = request.OutOfOfficeRequest.AssigneeUserId.HasValue ? request.OutOfOfficeRequest.AssigneeUserId.ToString() : null;
                serviceRequest.StatusContactType = (short)request.OutOfOfficeRequest.ReceptionMode;
            }

            var response = await Task.Factory.StartNew(() => Client.UserService.setStatus(serviceRequest, session.GetSession())).ConfigureAwait(false);

            var result = new StatusData<string>
            {
                Status = (SystemDbStatus)response.DbStatusCode,
                Message = response.DbStatusMsg,
                SubStatus = response.DbSubStatusCode
            };

            return result;
        }