Ejemplo n.º 1
0
        public virtual DateTime Calculate(DateTime registrationDateTime,
                                          ResponseTimeColumnsConfig respondTimeColumnsConfig)
        {
            if (ServiceItem == null)
            {
                return(registrationDateTime);
            }
            ResponseTime responseTime = GetMinResponseTime(respondTimeColumnsConfig);

            if (IsCalendarTimeUnit(responseTime.TimeUnitId))
            {
                return(registrationDateTime + responseTime.GetTimeSpan(UserConnection));
            }
            DateTime responseDateTime;

            if (responseTime.TimeUnitId == TermCalculationConstants.WorkingDayTimeUnitId)
            {
                var      timeZoneConvertor            = new TimeZoneConvertor(CalendarTimeZone, UserConnection.CurrentUser.TimeZone);
                DateTime calendarRegistrationDateTime = timeZoneConvertor.ToCalendarDateTime(registrationDateTime);
                responseDateTime = timeZoneConvertor.ToUserDateTime(Actions.AddWorkingDays(calendarRegistrationDateTime,
                                                                                           responseTime.Value));
                return(responseDateTime);
            }
            responseDateTime = CalculateByCalendar(registrationDateTime, responseTime.GetTimeSpan(UserConnection));
            return(responseDateTime);
        }
        public override ResponseTime GetMinResponseTime(ResponseTimeColumnsConfig respondTimeColumnsConfig)
        {
            ResponseTime serviceResponse = base.GetMinResponseTime(respondTimeColumnsConfig);

            if (ServiceInServicePact != null)
            {
                ResponseTime serviceDetailResponse = ServiceInServicePact.GetResponseTime(respondTimeColumnsConfig);
                return(serviceDetailResponse);
            }
            return(GetMinResponseTimeByPriority(serviceResponse, respondTimeColumnsConfig));
        }
Ejemplo n.º 3
0
 protected ResponseTime GetMinResponseTimeByPriority(ResponseTime serviceResponse,
                                                     ResponseTimeColumnsConfig respondTimeColumnsConfig)
 {
     if (Priority != null)
     {
         ResponseTime priorityResponse = Priority.GetResponseTime(respondTimeColumnsConfig);
         return(priorityResponse.GetTimeSpan(UserConnection) < serviceResponse.GetTimeSpan(UserConnection)
                                 ? priorityResponse
                                 : serviceResponse);
     }
     return(serviceResponse);
 }
Ejemplo n.º 4
0
        public ResponseLabelTermCalculationData GetResponseLabelTermCalculationData()
        {
            ResponseTime minResponseTime   = GetMinResponseTime(TermCalculationConstants.ReactionTimeColumnsConfig);
            ResponseTime minResolutionTime = GetMinResponseTime(TermCalculationConstants.SolutionTimeColumnsConfig);

            return(new ResponseLabelTermCalculationData {
                CalendarId = GetCalendarId(),
                CalendarTimeZone = CalendarTimeZone,
                IsResolutionInCalendarDays = IsCalendarTimeUnit(minResolutionTime.TimeUnitId),
                IsResponseInCalendarDays = IsCalendarTimeUnit(minResponseTime.TimeUnitId),
                IsResolutionInDayUnits = IsDaysTimeUnit(minResolutionTime.TimeUnitId),
                IsResponseInDayUnits = IsDaysTimeUnit(minResponseTime.TimeUnitId)
            });
        }
        public override ResponseTime GetMinResponseTime(ResponseTimeColumnsConfig respondTimeColumnsConfig)
        {
            ResponseTime serviceResponse = base.GetMinResponseTime(respondTimeColumnsConfig);

            return(GetMinResponseTimeByPriority(serviceResponse, respondTimeColumnsConfig));
        }