예제 #1
0
파일: BLL.cs 프로젝트: Zizaveta/LotsMaster
 public static void TellForPersonAboutStartLot(int lotId)
 {
     Log.Logger("Work ServiceWork.TellForPersonAboutStartLot");
     using (AuctionContent db = new AuctionContent())
     {
         foreach (Tell elem in db.Tells.Where(elem => elem.Lot.Id == lotId))
         {
             PersonWork.SendMessage(db.Persons.First(), "Lot is start", "We want to tell you about start lot  " + elem.Lot.LotName + " NOW!!! Hurry up make your bet)", elem.Person);
         }
     }
     Log.Logger("Finish work ServiceWork.TellForPersonAboutStartLot");
 }
예제 #2
0
파일: BLL.cs 프로젝트: Zizaveta/LotsMaster
 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);
     }
 }