Exemplo n.º 1
0
 static void closeGuestRequests()
 {
     BL.IBL bl = BL.FactoryBL.GetBL();
     while (true)
     {
         var guestRs = bl.GuestRequestByCondition(GR => { return(bl.CalculateDate(GR.RegistrationDate) > BE.Configuration.DaysExpireGuestRequest); }); // list of orders according to the days passed
         foreach (BE.GuestRequest GR in guestRs)
         {
             if (GR.Status == BE.GUESTSTATUS.Active)
             {
                 bl.ChangeGuestRequestStatus(GR.GuestRequestKey);
             }
         }
         Thread.Sleep(86400000);// to active the process once a day
     }
 }