public GiftCollection FetchAll() { GiftCollection coll = new GiftCollection(); Query qry = new Query(Gift.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public GiftCollection GetDummyGiftCollection() { var giftDict = new Dictionary <string, IGift>(); var giftCollection = new GiftCollection(); return(giftCollection); }
public Event GetEvent(string custId, GiftCollection giftCollectionR, GiftCollection giftCollectionE) { string eventId = Guid.NewGuid().ToString(); var OccasionMock = new Mock <IOccassion>(); return(new Event(eventId, OccasionMock.Object, "thisPlace", new DateTime(2020, 05, 05), giftCollectionE, giftCollectionR, custId, false)); }
public void Setup() { logger = new Mock <ILog>(); giftR = new GiftCollection(); giftE = new GiftCollection(); custId = Guid.NewGuid().ToString(); customer = new Customer("userName", "password"); customer1 = new Customer("userName2", "password"); }
public Event CreateEmptyEvent(string custId) { var mockOccasion = new Mock <IOccassion>(); var place = "test place"; var date = new DateTime(2020, 6, 3); var giftCollectionExpected = new GiftCollection(); var giftCollectionRecieved = new GiftCollection(); return(new Event(mockOccasion.Object, place, date, custId)); }
public IGiftCollection <IGift> GetGiftsForGiftIds(string [] giftIdList) { var giftCollection = new GiftCollection(); foreach (var giftId in giftIdList) { var gift = (IGift)giftDao.Read(giftId); logger.InfoFormat("Gift with id {0} added", gift.getId()); giftCollection.Add(gift); } return(giftCollection); }
public ActionResult <string> CreateEvent(Event event1) { customerController.SetCustomer(loggedInCustomer); logger.Info("Came here"); var format = "yyyy-MM-dd HH:mm"; var giftE = selectionController.GetGiftsForGiftIds(event1.giftIds); var giftR = new GiftCollection(); var date = DateTime.ParseExact(event1.date + " " + event1.time, format, CultureInfo.InvariantCulture); logger.Info("date is formateed to " + date.ToString()); IOccassion occassionInQ = selectionController.GetOccassion(event1.occassionType, event1.person1, event1.person2); customerController.CreateOccassion(occassionInQ); var result = customerController.CreateEvent(occassionInQ, event1.place, date, giftE, giftR); customerController.AddToExpectedGifts(giftE, result); return(result); }
public Invitation GetInvitation(GiftCollection giftCollectionR, GiftCollection giftCollectionE, CustomerCollection customerCollection) { return(new Invitation(customer, GetEvent(customer1.getId(), giftCollectionR, giftCollectionE))); }
public void GetGiftCollection() { GiftCollection.Add(new GiftModel { AppImage = "ms-appx:///Assets/GiftImages/ITHome+.png", AppName = "微IT", AppDesc = "纯,只为你而来", AppProductUri = new Uri("ms-windows-store://pdp/?ProductId=9NBLGGH08TFH") }); }
public GiftCollection FetchByQuery(Query qry) { GiftCollection coll = new GiftCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public GiftCollection FetchByID(object GiftKey) { GiftCollection coll = new GiftCollection().Where("Gift_Key", GiftKey).Load(); return coll; }