Exemple #1
0
 private static void Timer_Tick(object sender, EventArgs e)
 {
     Log.Logger("Work ServiceWork.Timer_Tick");
     ServiceWork.TellForPersonAboutStartLot((int)((DispatcherTimer)sender).Tag);
     ((DispatcherTimer)sender).Stop();
     timers.Remove(((DispatcherTimer)sender));
     Log.Logger("Finish Work ServiceWork.Timer_Tick");
 }
Exemple #2
0
 private static void Timer_Tick(object sender, EventArgs e)
 {
     //пройтися циклом і повідомити людей
     //for
     //db.Lots.First(elem => elem.Id == lotId).TellPersonsAboutStart.Add(person);
     ServiceWork.TellForPersonAboutStartLot();
     ((DispatcherTimer)sender).Stop();
 }
Exemple #3
0
 public static bool AddLot(Lot lot, Person p)
 {
     try
     {
         using (AuctionContent db = new AuctionContent())
         {
             db.Persons.Attach(p);
             lot.WhoSale = p;
             db.Lots.Add(lot);
             db.SaveChanges();
             ServiceWork.TellAboutStartLot(lot);
             PersonWork.SendMessage(db.Persons.First(), "Auction", "Your lot " + lot.LotName + " is add. Wait for start)", p);
             return(true);
         }
     }
     catch (Exception ex)
     {
         Log.Logger(ex.Message);
         return(false);
     }
 }