public Chart()
        {
            InitializeComponent();
            _chartByCountry.ChartType = ChartType.Line;
            _chartByProduct.ChartType = ChartType.Line;
            dataServiceClient         = new DataServiceRef.NORTHWNDEntities(new Uri("http://localhost:50297/NorthWindDataService.svc/"));
            nwndQuery = dataServiceClient.Invoices;
            #region DataForCountry-Sales Chart
            var        cntryslschrtdt = GetSalesByCountry(nwndQuery.ToArray().ToList());
            DataSeries amtsers        = new DataSeries();
            amtsers.ValuesSource = cntryslschrtdt.ConvertAll(e => e.Amount).ToArray();
            _chartByCountry.Data.Children.Add(amtsers);
            var xvals = cntryslschrtdt.ConvertAll(e => e.Item).Distinct().ToArray();
            _chartByCountry.Data.ItemNames       = xvals;
            _chartByCountry.View.AxisX.Title     = CreateTextBlock("Countries");
            _chartByCountry.View.AxisX.AnnoAngle = 45;
            _chartByCountry.View.AxisY.Title     = CreateTextBlock("Sales");
            #endregion

            #region DataForProduct-Sales Chart
            var        pdctslchrtdt = GetSalesByProduct(nwndQuery.ToArray().ToList());
            DataSeries amtserspd    = new DataSeries();
            amtserspd.ValuesSource = pdctslchrtdt.ConvertAll(e => e.Amount).ToArray();
            _chartByProduct.Data.Children.Add(amtserspd);
            var xvalspd = pdctslchrtdt.ConvertAll(e => e.Item).Distinct().ToArray();
            _chartByProduct.Data.ItemNames       = xvalspd;
            _chartByProduct.View.AxisX.Title     = CreateTextBlock("Product");
            _chartByProduct.View.AxisX.AnnoAngle = 45;
            _chartByProduct.View.AxisY.Title     = CreateTextBlock("Sales");
            #endregion
        }
Пример #2
0
        public Chart()
        {
            InitializeComponent();
            _chartByCountry.ChartType = ChartType.Line;
            _chartByProduct.ChartType = ChartType.Line;
            dataServiceClient = new DataServiceRef.NORTHWNDEntities(new Uri("http://localhost:50297/NorthWindDataService.svc/"));
            nwndQuery = dataServiceClient.Invoices;
            #region DataForCountry-Sales Chart
            var cntryslschrtdt = GetSalesByCountry(nwndQuery.ToArray().ToList());
            DataSeries amtsers = new DataSeries();
            amtsers.ValuesSource = cntryslschrtdt.ConvertAll(e => e.Amount).ToArray();
            _chartByCountry.Data.Children.Add(amtsers);
            var xvals = cntryslschrtdt.ConvertAll(e => e.Item).Distinct().ToArray();
            _chartByCountry.Data.ItemNames = xvals;
            _chartByCountry.View.AxisX.Title = CreateTextBlock("Countries");
            _chartByCountry.View.AxisX.AnnoAngle = 45;
            _chartByCountry.View.AxisY.Title = CreateTextBlock("Sales");
            #endregion

            #region DataForProduct-Sales Chart
            var pdctslchrtdt = GetSalesByProduct(nwndQuery.ToArray().ToList());
            DataSeries amtserspd = new DataSeries();
            amtserspd.ValuesSource = pdctslchrtdt.ConvertAll(e => e.Amount).ToArray();
            _chartByProduct.Data.Children.Add(amtserspd);
            var xvalspd = pdctslchrtdt.ConvertAll(e => e.Item).Distinct().ToArray();
            _chartByProduct.Data.ItemNames = xvalspd;
            _chartByProduct.View.AxisX.Title = CreateTextBlock("Product");
            _chartByProduct.View.AxisX.AnnoAngle = 45;
            _chartByProduct.View.AxisY.Title = CreateTextBlock("Sales");
            #endregion
        }
Пример #3
0
        public Invoice()
        {
            InitializeComponent();

            dataServiceClient = new DataServiceRef.NORTHWNDEntities(new Uri("http://localhost:50297/NorthWindDataService.svc/"));
            nwndQuery = dataServiceClient.Invoices;
            _flex.ItemsSource = nwndQuery;
        }
        public Invoice()
        {
            InitializeComponent();


            dataServiceClient = new DataServiceRef.NORTHWNDEntities(new Uri("http://localhost:50297/NorthWindDataService.svc/"));
            nwndQuery         = dataServiceClient.Invoices;
            _flex.ItemsSource = nwndQuery;
        }
Пример #5
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // TODO: Modify the port number in the following URI as required.
            dataServiceClient = new AdventureWorksService.AdventureWorksLTEntities(
                new Uri("http://localhost:45899/AdventureWorksService.svc"));
            salesQuery = dataServiceClient.SalesOrderHeaders;

            ordersViewSource        = ((CollectionViewSource)(this.FindResource("salesOrderHeadersViewSource")));
            ordersViewSource.Source = salesQuery.Execute();
            ordersViewSource.View.MoveCurrentToFirst();
        }
Пример #6
0
        public Version GetBaseUriVersion(System.Data.Services.Client.DataServiceQuery <biz.dfch.CS.Appclusive.Core.OdataServices.Diagnostics.Endpoint> endpoint)
        {
            Contract.Requires(null != endpoint);
            Contract.Ensures(null != Contract.Result <Version>());

            var baseUri = endpoint.FirstOrDefault(e => e.Id == 1);

            Contract.Assert(null != baseUri, "Retrieving version information FAILED.");

            var result = new Version(baseUri.Version);

            return(result);
        }
Пример #7
0
        //bing 번역기로부터 번역문 얻기
        private static Translation TranslateString(TranslatorContainer tc, string inputString, string transCode, string resultCode)
        {
            System.Data.Services.Client.DataServiceQuery <MORT.TransFormOver.Translation> translationQuery = tc.Translate(inputString, resultCode, transCode);

            // Call the query and get the results as a List
            System.Collections.Generic.List <MORT.TransFormOver.Translation> translationResults = translationQuery.Execute().ToList();

            // Verify there was a result
            if (translationResults.Count() <= 0)
            {
                return(null);
            }

            // In case there were multiple results, pick the first one
            Translation translationResult = translationResults.First();

            return(translationResult);
        }