예제 #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);
        }
예제 #2
0
 public static ResponseTime GetResponseTime(this Entity entity, ResponseTimeColumnsConfig columnsConfig)
 {
     return(new ResponseTime {
         Value = entity.GetTypedColumnValue <int>(columnsConfig.ValueColumnName),
         TimeUnitId = entity.GetTypedColumnValue <Guid>(columnsConfig.TimeUnitColumnName)
     });
 }
        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));
        }
예제 #4
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);
 }
        public override ResponseTime GetMinResponseTime(ResponseTimeColumnsConfig respondTimeColumnsConfig)
        {
            ResponseTime serviceResponse = base.GetMinResponseTime(respondTimeColumnsConfig);

            return(GetMinResponseTimeByPriority(serviceResponse, respondTimeColumnsConfig));
        }
예제 #6
0
 public virtual ResponseTime GetMinResponseTime(ResponseTimeColumnsConfig respondTimeColumnsConfig)
 {
     return(ServiceItem.GetResponseTime(respondTimeColumnsConfig));
 }