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 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)); }
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)); }
public virtual ResponseTime GetMinResponseTime(ResponseTimeColumnsConfig respondTimeColumnsConfig) { return(ServiceItem.GetResponseTime(respondTimeColumnsConfig)); }