public void Update(string umail) { FoodItemAccess fia = new FoodItemAccess(); List <FoodItem> foodList = fia.GetUnmarkedFoodItems(); if (foodList.Count > 0) { NotificationManager nm = new NotificationManager(); string message = nm.ComposeDueNotificationMessage(foodList); MailManager mailManager = new MailManager(); BMailBot bMailBot = mailManager.getBMailBot(); mailManager.sendMail(bMailBot.Username, bMailBot.Password, umail, "New Items Expired", message); fia.UpdateMarked(foodList); } }
public void Update(string umail) { Mediator m = new Mediator(); GetUnmarkedFoodItems getUnmarkedFoodItems = new GetUnmarkedFoodItems(); List <FoodItem> foodList = m.getUnmarkedFoodItemsHandler.Handle(getUnmarkedFoodItems).response; if (foodList.Count > 0) { NotificationManager nm = new NotificationManager(); string message = nm.ComposeDueNotificationMessage(foodList); MailManager mailManager = new MailManager(); BMailBot bMailBot = mailManager.getBMailBot(); mailManager.sendMail(bMailBot.Username, bMailBot.Password, umail, "New Items Expired", message); UpdateMarked updateMarked = new UpdateMarked(foodList); m.updateMarkedHandler.Handle(updateMarked); //fia.UpdateMarked(foodList); } }