コード例 #1
0
        public Schedule GetScheduleToDoById(string sid, string userId, IAppDomainRequest req)
        {
            try
            {
                var request = new GetScheduleDataRequest();

                IRestClient client = new JsonServiceClient();

                var url = Common.Helper.BuildURL(string.Format(@"{0}/{1}/{2}/{3}/Scheduling/Schedule/{4}",
                                                               DDSchedulingUrl,
                                                               "NG",
                                                               req.Version,
                                                               req.ContractNumber,
                                                               sid), userId);

                var response = client.Get <GetScheduleDataResponse>(url);

                if (response == null)
                {
                    throw new Exception("Schedule template was not found or initialized.");
                }

                var schedule = new Schedule
                {
                    AssignedToId      = response.Schedule.AssignedToId,
                    CategoryId        = response.Schedule.CategoryId,
                    ClosedDate        = response.Schedule.ClosedDate,
                    CreatedById       = response.Schedule.CreatedById,
                    CreatedOn         = response.Schedule.CreatedOn,
                    Description       = response.Schedule.Description,
                    DueDate           = response.Schedule.DueDate,
                    StartTime         = response.Schedule.StartTime,
                    Duration          = response.Schedule.Duration,
                    DueDateRange      = response.Schedule.DueDateRange,
                    Id                = response.Schedule.Id,
                    PatientId         = response.Schedule.PatientId,
                    PriorityId        = response.Schedule.PriorityId,
                    ProgramIds        = response.Schedule.ProgramIds,
                    StatusId          = response.Schedule.StatusId,
                    Title             = response.Schedule.Title,
                    TypeId            = response.Schedule.TypeId,
                    UpdatedOn         = response.Schedule.UpdatedOn,
                    DefaultAssignment = response.Schedule.DefaultAssignment
                };

                return(schedule);
            }
            catch (Exception ex)
            {
                throw new Exception("AD:PlanElementEndpointUtil:GetScheduleToDoById()::" + ex.Message,
                                    ex.InnerException);
            }
        }
コード例 #2
0
        public GetScheduleDataResponse GetSchedule(GetScheduleDataRequest request)
        {
            try
            {
                var result = new GetScheduleDataResponse();

                var repo = Factory.GetRepository(request, RepositoryType.Schedule);
                repo.UserId     = request.UserId;
                result.Schedule = (ScheduleData)repo.FindByID(request.Id);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public void GetSchedule_Test()
        {
            GetScheduleDataRequest request = new GetScheduleDataRequest
            {
                Context        = context,
                ContractNumber = contractNumber,
                UserId         = userId,
                Version        = version,
                Id             = "53ff6b92d4332314bcab46e0"
            };

            ISchedulingDataManager cm = new SchedulingDataManager {
                Factory = new SchedulingRepositoryFactory()
            };
            GetScheduleDataResponse response = cm.GetSchedule(request);

            Assert.IsNotNull(response);
        }
コード例 #4
0
        public GetScheduleDataResponse Get(GetScheduleDataRequest request)
        {
            GetScheduleDataResponse response = new GetScheduleDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("SchedulingDD:Get()::Unauthorized Access");
                }

                response         = Manager.GetSchedule(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                FormatUtil.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Helpers.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }