Пример #1
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);
     }
 }