Beispiel #1
0
        async void db()
        {
            ctx = new AutoMgrSvc.AutoMgrDbEntities(new Uri("http://192.168.0.101:23796/Service/AutoMgrDbSvc.svc/"));

            //AutoMgrSvc.inventory inventory = new AutoMgrSvc.inventory();
            //var goods = from g in ctx.goods where g.id < 100 select g;
            //foreach (var gg in goods)
            //{
            //    if (gg.id == 1100)
            //        break;
            //}

            //inventories = new DataServiceCollection<AutoMgrSvc.inventory>();
            //inventories.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(complete);
            //var query = from inv in ctx.inventory select inv;
            //inventories.LoadAsync(query);
            ////inventories.Load(from inv in ctx.inventory select inv);
            ////foreach (var inv in inventories)
            ////{
            ////    int i = inv.id;
            ////}

            goodses = new DataServiceCollection <AutoMgrSvc.goods>();
            //goodses.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(goods_complete);
            var qry = (from goods in ctx.goods.Expand("shelf") select goods).Skip(1).Take(10);
            await goodses.AsyncQuery(qry);

            //goodses.LoadAsync(qry);
            foreach (var goods in goodses)
            {
                int i = goods.id;
            }
        }
Beispiel #2
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
            //db();

            ctx = new AutoMgrSvc.AutoMgrDbEntities(new Uri("http://192.168.0.101:23796/Service/AutoMgrDbSvc.svc/"));
        }
Beispiel #3
0
        private readonly AutoMgrSvc.AutoMgrDbEntities _context;// = new AutoMgrSvc.AutoMgrDbEntities(new Uri("http://192.168.0.101:23796/Service/AutoMgrDbSvc.svc/"));

        public VMGoodsSelection(INavigationService navigationService, AutoMgrSvc.AutoMgrDbEntities context)
        {
            if (IsInDesignMode)
            {
                // Code runs in Blend --> create design time data.
            }
            else
            {
                // Code runs "for real"
                _navigationService = navigationService;
                _context           = context;
            }

            GoodsOutput = new ObservableCollection <AutoMgrSvc.goods>();
        }