Beispiel #1
0
 public StoppingSkill()
 {
     _orders = new OrdersCollection
     {
         { "stop", "stops brain ^_^" }
     };
 }
Beispiel #2
0
    /// <summary>
    /// Gallery/Genre/Subject/Reviews repeater nested within 'parentRptSingleWork_ItemDataBound'
    /// </summary>
    protected void parentRptSingleWork_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
    {
        //Gallery Repeater: Child
        Repeater innerRptGallery = (Repeater)e.Item.FindControl("rptGallery");

        GalleryCollection gl = new GalleryCollection(false);

        gl.FetchForId(ac[0].GalleryID);
        innerRptGallery.DataSource = gl;
        innerRptGallery.DataBind();

        //Genre Repeater: Child
        Repeater innerRptGenre = (Repeater)e.Item.FindControl("rptGenre");

        GenreCollection _gCol = new GenreCollection(false);

        _gCol.FetchByArtWorkID(artWorkId);
        innerRptGenre.DataSource = _gCol;
        innerRptGenre.DataBind();

        //Second Genre Repeater (For Related Artworks in Accordian): Child
        Repeater innerRptRelatedArt = (Repeater)e.Item.FindControl("rptRelatedArt");

        GenreCollection _gCol2 = new GenreCollection(false);

        _gCol2.FetchByArtWorkID(artWorkId);
        innerRptRelatedArt.DataSource = _gCol2;
        innerRptRelatedArt.DataBind();

        //Subject Repeater: Child
        Repeater innerRptSubject = (Repeater)e.Item.FindControl("rptSubject");

        SubjectCollection _sCol = new SubjectCollection(false);

        _sCol.FetchByArtWorkId(artWorkId);
        innerRptSubject.DataSource = _sCol;
        innerRptSubject.DataBind();

        //Sales Repeater (Using date created---> Order/OrderDetails)
        Repeater innerRptOrders = (Repeater)e.Item.FindControl("rptSalesDateCreatedList");

        OrdersCollection _ordCol = new OrdersCollection();

        _ordCol.FetchByArtworkID(artWorkId);
        innerRptOrders.DataSource = _ordCol;
        innerRptOrders.DataBind();

        //Getting the Reviews
        artReview.FetchReviewsByArtWorkId(artWorkId);

        if (!artReview.IsEmpty)
        {
            rptReview.DataSource = artReview;
            rptReview.DataBind();
        }
        else
        {
            emptyReview.Text = "There is no review for this artwork ";
        }
    }
        private void LookupComboboxBindingWindow_Loaded(object sender, RoutedEventArgs e)
        {
            IQueryable<Order> query = from o in db.Orders
                                      //where o.OrderDate >= System.Convert.ToDateTime("1/1/2009")
                                      orderby o.OrderDate descending, o.Customer.LastName
                                      select o;

            this.OrderData = new OrdersCollection(query, db);

            //  Make sure the lookup list is pulled from the same ObjectContext 
            //  (OMSEntities) that the order query uses above.
            //  Also have to make sure you return a list of Customer entites and not a 
            //  projection of just a few fields otherwise the binding won't work).
            IQueryable<Customer> customerList = from c in db.Customers
                                                where c.Orders.Count > 0
                                                orderby c.LastName, c.FirstName
                                                select c;

            CollectionViewSource orderSource = (CollectionViewSource)this.FindResource("OrdersSource");
            orderSource.Source = this.OrderData;

            CollectionViewSource customerSource = (CollectionViewSource)this.FindResource("CustomerLookup");
            customerSource.Source = customerList;   //.ToArray(); //.ToList();  // A simple list is OK here since we are not editing Customers

            this.View = (ListCollectionView)orderSource.View;
        }
Beispiel #4
0
        static private void CollectionSaveHierarchical()
        {
            OrdersCollection coll  = new OrdersCollection();
            Orders           order = coll.AddNew();

            order.OrderDate = DateTime.Now;

            OrderDetails detail1 = order.OrderDetailsCollection.AddNew();

            detail1.UnitPrice = 55.00M;
            detail1.Quantity  = 4;
            detail1.ProductID = 8;

            OrderDetails detail2 = order.OrderDetailsCollection.AddNew();

            detail2.UnitPrice = 25.00M;
            detail2.Quantity  = 3;
            detail2.ProductID = 4;

            coll.Save();

            int orderId         = order.OrderID.Value;
            int detail1_orderId = detail1.OrderID.Value;
            int detail2_orderId = detail2.OrderID.Value;
        }
Beispiel #5
0
        static private void Subquery()
        {
            OrdersQuery       orders  = new OrdersQuery("o");
            OrderDetailsQuery details = new OrderDetailsQuery("oi");

            orders.Select
            (
                orders.OrderID,
                orders.OrderDate,
                details.Select
                (
                    details.UnitPrice.Max()
                )
                .Where(orders.OrderID == details.OrderID).As("MaxUnitPrice")
            );

            OrdersCollection coll = new OrdersCollection();

            if (coll.Load(orders))
            {
                foreach (Orders order in coll)
                {
                }
            }
        }
        private void Window1_Loaded(object sender, RoutedEventArgs e)
        {
            IQueryable<Order> query = from o in db.Orders.Include("OrderDetails")
                                        //where o.OrderDate >= System.Convert.ToDateTime("1/1/2009")
                                        orderby o.OrderDate descending, o.Customer.LastName
                                        select o;

            this.OrderData = new OrdersCollection(query, db);

            IQueryable<Customer> customerList = from c in db.Customers
                                                where c.Orders.Count > 0
                                                orderby c.LastName, c.FirstName
                                                select c;

            IQueryable<Product> productList = from p in db.Products
                                              orderby p.Name
                                              select p;

            this.MasterViewSource = (CollectionViewSource)this.FindResource("MasterViewSource");
            this.DetailViewSource = (CollectionViewSource)this.FindResource("DetailsViewSource");
            this.MasterViewSource.Source = this.OrderData;

            CollectionViewSource customerSource = (CollectionViewSource)this.FindResource("CustomerLookup");
            customerSource.Source = customerList.ToList();  //  A simple list is OK here since we are not editing Customers

            CollectionViewSource productSource = (CollectionViewSource)this.FindResource("ProductLookup");
            productSource.Source = productList.ToList();    //  A simple list is OK here since we are not editing Products

            this.MasterView = (ListCollectionView)this.MasterViewSource.View;
            MasterView.CurrentChanged += new EventHandler(MasterView_CurrentChanged);

            this.DetailsView = (BindingListCollectionView)this.DetailViewSource.View;
        }
Beispiel #7
0
 private void Update_Orders(object sender = null, RoutedEventArgs e = null)
 {
     orders = curentSession.GetAllItems <OrdersCollection>(Request.comGetOrders);
     icOrders.ItemsSource         = orders.orders;
     grOrderInfo.DataContext      = null;
     cmbOrderStatus.SelectedIndex = -1;
 }
Beispiel #8
0
 public PersonalAssistantSkill()
 {
     _orders = new OrdersCollection
     {
         { "iam <name>", "introduces your name." },
         { "introduce <name>", "introduces friend's name." }
     };
 }
Beispiel #9
0
 public GreetingSkill()
 {
     _orders = new OrdersCollection
     {
         { "hi", "Brainy 'hi's you back" },
         { "hey", "Brainy 'hey's you back" }
     };
 }
Beispiel #10
0
        public OrdersCollection Orders_LoadAll()
        {
            OrdersCollection coll = new OrdersCollection();

            coll.es.IsLazyLoadDisabled = true;
            coll.LoadAll();
            return(coll);
        }
Beispiel #11
0
        /// <summary>
        /// Adds a new order to existing orders list/collection
        /// </summary>
        /// <param name="orderDetails">Contains order information</param>
        public void AddOrder(OrderDetails orderDetails)
        {
            // Add to active orders list
            _activeOrdersList.Add(orderDetails);

            // Add to global orders collection
            OrdersCollection.Add(orderDetails);
        }
Beispiel #12
0
        private void OnDelete(uint?id)
        {
            var item = OrdersCollection.FirstOrDefault(x => x.ID == id);

            if (item != null)
            {
                OrdersCollection.Remove(item);
            }
        }
Beispiel #13
0
        public OrdersCollection Orders_LoadByDynamic(string serializedQuery)
        {
            OrdersQuery query = OrdersQuery.SerializeHelper.FromXml(
                serializedQuery, typeof(OrdersQuery), AllKnownTypes) as OrdersQuery;

            OrdersCollection coll = new OrdersCollection();

            coll.es.IsLazyLoadDisabled = true;
            coll.Load(query);
            return(coll);
        }
Beispiel #14
0
        public OrdersCollection GetOrders()
        {
            var model = this.Db.Orders.To <OrdersTable>();

            var order = new OrdersCollection
            {
                Orders = model
            };

            return(order);
        }
Beispiel #15
0
        public OrdersCollection.OrdersCollectionWCFPacket Orders_LoadAll()
        {
            OrdersCollection coll = new OrdersCollection();

            if (coll.LoadAll())
            {
                return(coll);
            }

            return(null);
        }
        public OrdersCollectionProxyStub Orders_SaveCollection(OrdersCollectionProxyStub collection)
        {
            if (collection != null)
            {
                OrdersCollection c = collection.GetCollection();
                c.Save();
                return(c);
            }

            return(null);
        }
        public OrdersCollectionProxyStub Orders_LoadAll()
        {
            OrdersCollection coll = new OrdersCollection();

            if (coll.LoadAll())
            {
                return(coll);
            }

            return(null);
        }
        public OrdersCollectionProxyStub Orders_QueryForCollection(string serializedQuery)
        {
            OrdersQuery query = OrdersQuery.SerializeHelper.FromXml(
                serializedQuery, typeof(OrdersQuery), AllKnownTypes) as OrdersQuery;

            OrdersCollection coll = new OrdersCollection();

            if (coll.Load(query))
            {
                return(coll);
            }

            return(null);
        }
        private void MasterDetailBindingWindow_Loaded(object sender, RoutedEventArgs e)
        {
            IQueryable<Order> query = from o in db.Orders.Include("OrderDetails")
                                      //where o.OrderDate >= System.Convert.ToDateTime("1/1/2009")
                                      orderby o.OrderDate descending, o.Customer.LastName
                                      select o;

            this.OrderData = new OrdersCollection(query, db);

            // Make sure the lookup lists are pulled from the same ObjectContext 
            //  (OMSEntities) that the order query uses above.
            // Also have to make sure you return a list of whole entites and not a 
            //  projection of just a few fields otherwise the binding won// t work.
            IQueryable<Customer> customerList = from c in db.Customers
                                                where c.Orders.Count > 0
                                                orderby c.LastName, c.FirstName
                                                select c;

            IQueryable<Product> productList = from p in db.Products
                                              orderby p.Name
                                              select p;

            this.MasterViewSource = (CollectionViewSource)this.FindResource("MasterViewSource");
            this.DetailViewSource = (CollectionViewSource)this.FindResource("DetailsViewSource");
            this.MasterViewSource.Source = this.OrderData;

            CollectionViewSource customerSource = (CollectionViewSource)this.FindResource("CustomerLookup");
            customerSource.Source = customerList.ToList();  // A simple list is OK here since we are not editing Customers
            CollectionViewSource productSource = (CollectionViewSource)this.FindResource("ProductLookup");
            productSource.Source = productList.ToList();    // A simple list is OK here since we are not editing Products

            this.MasterView = (ListCollectionView)this.MasterViewSource.View;
            MasterView.CurrentChanged += new EventHandler(MasterView_CurrentChanged);

            this.DetailsView = (BindingListCollectionView)this.DetailViewSource.View;
        }