Example #1
0
        public static void SentOrderWithoutOffer(ISession session, bool verbose = false)
        {
            var address = session.Query <Address>().First();
            var offer   = session.Query <Offer>().First();
            var order   = new Order(address, offer);
            var sent    = new SentOrder(order);
            var line    = sent.Lines[0];
            var catalog = session.Query <Catalog>().First(c => !c.HaveOffers);

            line.CatalogId = catalog.Id;
            session.Save(sent);
            if (verbose)
            {
                Console.WriteLine("Создан отправленный заказ для товара {0}", catalog.FullName);
            }
        }
Example #2
0
        public static void OldOrder(ISession session)
        {
            var offer   = session.Query <Offer>().First(x => !x.Junk && x.RequestRatio == null);
            var address = session.Query <Address>().First();

            var order = new Order(address, offer)
            {
                CreatedOn = DateTime.Now.AddDays(-100)
            };
            var sent = new SentOrder(order)
            {
                SentOn = DateTime.Now.AddDays(-100)
            };

            session.Save(sent);
        }