Ejemplo n.º 1
0
        public void Execute(IJobExecutionContext context)
        {
            ServiceRequests requestsManager = new ServiceRequests();
            //get all the unreplaied requests and has new state
            List <RequestProvider> requests = requestsManager.GetAvalibaleRequests();

            //check if there is new requests
            if (requests.Any())
            {
                //update those requests state to expired if it has expired time
                foreach (RequestProvider request in requests.Where(request => request.ExpiryTime <= DateTime.Now))
                {
                    requestsManager.UpdateProviderRequest(request.RequestId, request.ProviderId, (int)RequestStutus.Expired,
                                                          "", request.Price ?? 0, 0);
                }

                /*  foreach (RequestProvider request in requests)
                 * {
                 *    if (request.ExpiryTime <= Servston.Utilities.GetCurrentClientDateTime())
                 *    {
                 *        requestsManager.UpdateProviderRequest(request.RequestId, request.ProviderId, (int)RequestStutus.Expired, "", request.Price ?? 0, 0);
                 *    }
                 * }*/
            }
        }