public int GetPendingByAgentIdCount(long AgentId) { var agentRequests = new AgentServiceRequestRepository(context).GetPendingByAgentId(AgentId); int count = agentRequests.Where(ar => ar.Status == (int)Constant.ServiceRequestStatus.Initial).Count(); return(count); }
public List <IServiceRequest> GetPendingByAgentId(long AgentId) { var agentRequests = new AgentServiceRequestRepository(context).GetPendingByAgentId(AgentId); var serviceRequests = agentRequests.Select(a => a.ServiceRequest).ToList <IServiceRequest>(); return(serviceRequests); }
public List <IServiceRequest> GetFollowUpByAgentId(long AgentId) { var agentRequests = new AgentServiceRequestRepository(context).GetForFollowUpByAgentId(AgentId); var serviceRequests = agentRequests.Select(a => a.ServiceRequest).ToList <IServiceRequest>(). Where(r => r.TimeOccured.AddDays(ConfigurationHelper.DAYS_TO_EXPIRE_REQUEST).AddHours(-ConfigurationHelper.HOURS_TO_FOLLOW_UP) <= DateTime.UtcNow).ToList(); return(serviceRequests); }