public void GetTasks_Test() { GetTasksRequest request = new GetTasksRequest(); request.ContractNumber = "InHealth001"; request.Version = 1; request.StatusIds = new List <int> { 1, 2, 3 }; request.PatientId = "543c2e6b84ac050980224c50"; request.UserId = "531f2df5072ef727c4d2a3bc"; GoalsManager gManager = new GoalsManager(); GetTasksResponse response = gManager.GetTasks(request); Assert.IsNotNull(response); }
public GetTasksResponse Post(GetTasksRequest request) { GetTasksResponse response = new GetTasksResponse(); GoalsManager gm = new GoalsManager(); ValidateTokenResponse result = null; try { request.Token = base.Request.Headers["Token"] as string; result = Security.IsUserValidated(request.Version, request.Token, request.ContractNumber); if (result.UserId.Trim() != string.Empty) { request.UserId = result.UserId; response = gm.GetTasks(request); } else { throw new UnauthorizedAccessException(); } } catch (Exception ex) { CommonFormatter.FormatExceptionResponse(response, base.Response, ex); if ((ex is WebServiceException) == false) { gm.LogException(ex); } } finally { if (result != null) { AuditHelper.LogAuditData(request, result.SQLUserId, null, System.Web.HttpContext.Current.Request, request.GetType().Name); } } return(response); }