public static void TellForPersonAboutStartLot() { Task.Run(() => { using (AuctionContent db = new AuctionContent()) { foreach (Tell elem in db.Tells.Where(elem => elem.Lot.TimeStart >= DateTime.Now)) { ClassWork.SendMessage(db.Persons.First(), "Lot is start", "We want to tell you about start lot " + elem.Lot.LotName + " NOW!!!", elem.Person); } } }); }
public static bool ForgetPassword(string email) { try { using (AuctionContent db = new AuctionContent()) { ClassWork.SendMessage(new Person() { Email = "*****@*****.**", FirstName = "Not", SecondName = "Name" }, "ForgetPassword", "Your password: " + db.Persons.First(elem => elem.Email == email).Password, db.Persons.First(elem => elem.Email == email)); return(true); } } catch (Exception ex) { Log.Logger(ex.Message); return(false); } }
public void TellForPersonAboutStartLot() { Task.Run(() => { using (AuctionContent db = new AuctionContent()) { foreach (Lot elem in db.Lots.Where(elem => elem.TellPersonsAboutStart != null && elem.TimeStart >= DateTime.Now)) { foreach (Person p in elem.TellPersonsAboutStart) { ClassWork.SendMessage(new Person() { Email = "*****@*****.**", FirstName = "Not ", SecondName = "Empty" }, "Lot is start", "We want to tell you about start lot " + elem.LotName + "Now", p); } elem.TellPersonsAboutStart = null; } db.SaveChanges(); } }); }