Esempio n. 1
0
        public void GetToDosTest()
        {
            SchedulingManager ngm = new SchedulingManager();

            GetToDosRequest request = new GetToDosRequest
            {
                Version        = version,
                ContractNumber = contractNumber,
                UserId         = userId,
                AssignedToId   = "5325c821072ef705080d3488",
                // FromDate = DateTime.Parse("9/1/2014 3:47:01 PM"),
                StatusIds = new List <int> {
                    1, 3
                }
            };

            GetToDosResponse             response = ngm.GetToDos(request);
            List <AppDomain.NG.DTO.ToDo> list     = response.ToDos;

            Assert.IsNotNull(list);
        }
Esempio n. 2
0
        public GetToDosResponse Post(GetToDosRequest request)
        {
            GetToDosResponse      response = new GetToDosResponse();
            SchedulingManager     toDoMgr  = new SchedulingManager();
            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       = toDoMgr.GetToDos(request);
                }
                else
                {
                    throw new UnauthorizedAccessException();
                }
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);
                if ((ex is WebServiceException) == false)
                {
                    toDoMgr.LogException(ex);
                }
            }
            finally
            {
                List <string> patientIds = new List <string>();
                patientIds.Add(request.PatientId);
                if (result != null)
                {
                    AuditHelper.LogAuditData(request, result.SQLUserId, patientIds, System.Web.HttpContext.Current.Request, request.GetType().Name);
                }
            }
            return(response);
        }